Wednesday, January 27, 2010

BUG: SSIS 2008 derived columns from User variables data type

I wanted to create a derived column from a user:variable in SSIS so that I could combine the input of a CSV into a SQL table along with a column name saying where the CSV came from.

Usually you initialise the user:variable before the package starts with a non relevant string, such as "1234" then updated it to the correct value once the process starts.

The problem is that when you use the Derived Coulmn Transformation Editor and add a Derived Column as SSIS fills in the Data Type automatically for you and wont let you change its data length. So if you initialise the user:variable with "1234" the new column will be defined with a Data type Unicode string [DT_WSTR] 4 - notice maximum length of 4!

So if you update the user:variable string to a length of 5 characters SSIS fails!

My work around is to make sure that you initialise the user:variable string with a value which has a length of the maximum possible string which you are likely to encouter.

Hopefully this will be resolved in future releases.

Tuesday, January 26, 2010

Another Microsoft SQL exam passed

I'm sure it gets harder to study and pass exams as each year goes by, however just managed to achieve 98% in Microsoft SQL Server 2008, Implimentation and Maintenance so off for a beer to celebrate.

Summing Excel Range Intersects

Ever wanted to add up the value of the Intersecting Sets or Ranges.

I had a couple of Ranges as rowns,
eg Dept1 = Rows A1:N4 , Dept2 = Rows (A5:N6, A12:N16) etc

and then Columns Ranges for Jan, Feb
eg Jan = Column B1:B12, Feb = C1:C12 etc.

I wanted to get the sum of the Intersection between Ranges Dept1 for Jan. To do this use a Space as an operator. eg =Sum(Dept1 Jan)

Whilist everyone knows about the comma as a Union operator not many people have heard of space as an Intersect operator - see "Reference operators" in Excel help for more info

Tuesday, January 19, 2010

Using Windows 7 for "Server-like" loads

I'm studying for a SQL 2008 exam and found that you can mirror up to 3 backups to different devices, so when a client had some new Windows 7 machines delivered with loads of spare hard drive, I thought this would be an excellent location to backup an additioanal copy of SQL to overnight.

However after about a 15Gb backup from SQL 2005 server onto a Windows 7 share, the Windows 7 workstation seemed to loose its visibility from any of the Windows 2003 servers. (The other Windows 7 machines could still see the share).

A reboot solved the issue, until I tried to backup again!

Looking in the event log, I found memory errors showing as Non-Paged pool problems.

After a lot of searching, I came across the article below - it would appear that from the old SysInternals Site there used to be an article called "Tunining Workstations for Server-Like Loads". Microsoft seem to have "tidied up" these old articles and I couldnt find any links to the references shown on Technet, however if you make the registry changes to a Windows 7 machine, it seems a lot happier pretending to be a backup file server overnight.

Set the following registry to key to 1

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\LargeSystemCache

and set the following registry key to ‘3′:


Reboot and enjoy!

Event ID 2017 and 2021 - Google Groups

Tuesday, January 12, 2010