June 13, 2011, 8:20 am
This is a collection of links to free articles that may help in studying for
Exam 70 448 -Microsoft SQL Server 2008, Business Intelligence Development and Maintenance
I have broken this up into 6 posts based on the major areas of skills being measured taken from the Microsoft Learning page at
http://www.microsoft.com/learning/en/us/exam.aspx?id=70-448
First up is :
Implementing an SSIS Solution – which accounts for 17 % of the total skils measured
- SSIS Videos -
- Implement control flow.
This objective may include but is not limited to:
- Checkpoints;
- Debug control flow;
- Transactions;
- implement the appropriate control flow task to solve a problem;
- Data profiling and quality ;
- Implement data flow.
This objective may include but is not limited to:
- Debug data flow;
- Implement the appropriate data flow components
- Implement dynamic package behavior by using property expressions;
- Implement package logic by using variables;
- This objective may include but is not limited to:
- system variables;
- user variables;
- variable scope
- Implement package configurations.
- Implement auditing, logging, and event handling.
This objective may include but is not limited to:
- use system variables for auditing;
- use event handlers; propagate events;
- use log providers;
- data profiling
- Extend SSIS packages by using .NET code;
- This objective may include but is not limited to;
- Use the script task;
- Use the script component;
- Use custom assemblies;
January 3, 2010, 3:09 pm
SSIS package to Sync databases between “like” environments, for instance production and test or acceptance.
This package was created in VS2008 and may have functionality only available in 2008 but will work against SQL2005 servers
There is some reliance that the environments will be the same – drive letters, file locations. Users are not synced as part of this package as generally these will be static (hopefully you are using groups) The job uses the admin UNC paths so the package needs to be run with administrative credentials of both servers or shares will need to be created with the appropriate permissions.
- The package first queries msdb on the source server and retrieves the paths of the last full backups.
- It passes the database name, path and full unc path into a foreach loop container.
- The file system task copies the backup to the path defined in the FullDestPath variable
- An execute SQL task sets the database (if it exists) to single user
- An execute SQL task restores the database using the full admin unc path of step 3 – This could be changed to a share to allow the process to run with less privileges
- The loop completes this for all non system or reportserver databases (this is defined in the sql script in step 2)
- Success email is sent on completion
- There is also an On error event handler at the root of the package that emails any package failure
Package Overview

-
Parameters


-
Retrieve Database name and last full backup Path
- Create an Execute T-SQL Statement task against your Source server (msdb database)
- With a full result set to an Object data type – here I have used rowset1

- Use the SQL statement below,
WITH BACKUPS
AS (
SELECT
a.Server
,a.database_name
,B.physical_device_name
FROM
(
SELECT
CONVERT(NVARCHAR(MAX), SERVERPROPERTY('Servername')) AS Server
,msdb.dbo.backupset.database_name
,MAX(msdb.dbo.backupset.backup_finish_date) AS last_db_backup_date
FROM
msdb.dbo.backupmediafamily
INNER JOIN msdb.dbo.backupset
ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id
WHERE
msdb..backupset.type = 'D'
AND msdb.dbo.backupset.database_name NOT IN (
'Master', 'msdb', 'model', 'reportserver',
'reportservertempdb' )
GROUP BY
msdb.dbo.backupset.database_name
) AS A
LEFT JOIN (
SELECT
CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server
,msdb.dbo.backupset.database_name
,msdb.dbo.backupset.backup_finish_date
,msdb.dbo.backupmediafamily.physical_device_name
FROM
msdb.dbo.backupmediafamily
INNER JOIN msdb.dbo.backupset
ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id
WHERE
msdb..backupset.type = 'D'
) AS B
ON A.[server] = B.[server]
AND A.[database_name] = B.[database_name]
AND A.[last_db_backup_date] = B.[backup_finish_date]
)
SELECT
[database_name]
,[physical_device_name] AS databasePath
,'\\' + [Server] + '\' + REPLACE([physical_device_name], ':', '$') AS FullSourcePath
FROM
[BACKUPS]
- Set your result set

-
Use a ForEach Loop Container
- Set the enumerator to Foreach ADO Enumerator with your object source as your object variable .

-
- Map your variables

-
Add a File System Task
- Configure with your source and destination variable and a Copy File operation

-
-
Create T-SQL Statement Task against your destination server (master database)
DECLARE @databaseName VARCHAR(50)
SET @databaseName = ?
IF EXISTS
(SELECT name FROM sys.databases WHERE name = @databaseName)
EXEC('ALTER DATABASE ' + @databaseName + ' SET SINGLE_USER WITH ROLLBACK IMMEDIATE')
- Map your parameter like this

-
Create T-SQL Statement Task against your destination server (master database)
DECLARE @databaseName VARCHAR(50)
DECLARE @FullDestPath VARCHAR(MAX)
SET @databasename = ?
SET @FullDestPath = ?
EXEC(
'RESTORE DATABASE ' + @databaseName + ' FROM DISK =
N''' + @FullDestPath + '''WITH RECOVERY, FILE = 1, NOUNLOAD, REPLACE, STATS = 10')
GO
- Map your parameters like this

-
Add a Send Mail task using the following expressions

-
On the even Handlers tab
- Create an onError handler at the root of the package

- Add a Send mail task with the following expressions

- I also create a config file to allow the package to be used in different locations without editing the package itself
- databaseName – value
- DestPath – value ( this is either a share or UNC – it does NOT contain the server name – it uses the DestServer variable so it should be in the format “C$\sql\backups” or “mybackupshare”
- DestServer – value
- SMTPFailureTo – value
- SMTPFrom – value
- SMTPServer – value
- SMTPSuccessTo – value
- SourceServer – value
December 19, 2009, 2:22 pm
I buy a lot of technical books, I have at least 10 SQL 2008 books, I normally go for the professional versions and I actually read them. The trouble is there huge! They are a pain to carry round and just plain awkward to read. I usually end up using a stand as most technical books have walkthrough’s or demos – try holding up one of those books or even prop them up while you are trying to type. This means I generally only read in the evenings at home. When I saw the 24 hour trainer book I figured here is a good sized book I can carry around and actually read.
I have always struggled with SSIS, it looks cool and seems friendly but whenever I tried to do anything I couldn’t figure out my arse from my elbow. I have a need to sync databases, cubes, packages etc between environments. I figured it would be a cool to try and do it in SSIS. Solving my problem and increasing my knowledge at the same time.
I originally started watching the dvd demos and following along. Then I switched to the book – don’t get me wrong it was great to see the packages being constructed – (nice to see it instead of following on from a book). But the book presented the “try it” with hints so you could attempt to build the package without just mimicking the demo. Also the DVD was not the greatest quality – I found it hard to see some of the scripts, when I didn’t have the book in front of me.
I named all my packages as the task that was being covered instead of chapter name as suggested because I feel like I can refer back to them easily- I did all my script tasks in C# – the book was VB only.
Overall I found this to be an excellent book, I really learnt a lot. I definitely appreciate the smaller size.
Note: Authors – how about breaking your books into series to keep the size down.
I’m going to attempt to build my Environment Sync – if it works I’ll post some details