SQL injection attacks are nothing new and hopefully everyone is protecting themselves from it. An interesting by-product of the standard method of protection from the basic sql injection attack (replace single quotes with two single quotes) is increasing the size of the original value. When building a command in a variable, its possible to truncate […]
You are browsing archives for
Month: February 2007
Shrinking Databases bit-by-bit to avoid long delays
Michael Jones has a neat script for shrinking databases in small chunks to avoid having the server locked up for a long period. declare @sql varchar(8000) declare @name sysname declare @sizeMB int declare @UsedMB int declare @FreeMB int declare @ShrinkMB int — Desired free space in MB after shrink set @FreeMB = 1000 — Increment […]
Converting SSIS Data Types to .Net Data Types
If you use Scripting tasks, the CLR or build components for SSIS, you will need to convert values from their SSIS types into .Net types. Here’s a quick list of the SSIS data types and their .Net companion. Integration Services Data Types Managed Data Type DT_WSTR DT_TEXT DT_STR System.String DT_BYTES DT_IMAGE System.Byte[] […]
Troubleshooting Delegation in SQL Server
I just came across a good article by Keith Brown on a common trap when setting up SQL Server with kerberos delegation. As he noted, the port number for the Sql Server Service should be specified when setting the service principal name (SPN). Delegation is a powerful feature of Active Directory but can be difficult […]
C# Defines Infinity ?
Wow! I though C# was a neat programming language that solved many problems; apparently they’ve also solved the age old question: How big is infinity? Maybe I need to use Convert.ToBigInfinity() ?
What with this database called [$(DatabaseName)] ?
I just handed a work mate an output script from DataDude, which he ran in Management Studio. Instead of producing the expected database he ended up with one called $(DatabaseName) Remember database pro uses SQLCMD to deploy databases If you use Management Studio to run an output script, you’ll need to swap into SQLCMD mode […]
Generating a new SSIS Package GUID with the dtutil Utitlity
If you make a copy of a .dtsx file, the Package ID property remains the same. This value is logged as the SourceID, and to ensure it is unique, you should generate a new value for any copies of a package. dtutil /FILE "Copy of sample.dtsx" /IDRegenerate Or the short hand version dtutil /FILE "Copy […]