Saturday, July 10, 2010

What is a "Uniquifier"? If you have a clustered index defined on a non-unique colum(s) SQL Server will adds a 4 byte field to the row to make the clustered index ordered and unique. The value is null if the clustered index row is unique.

Thursday, July 08, 2010

sp_MSforeachdb
@command1 {nvarchar(2000)}
, @replacechar {nchar(1)}
, @command2 {nvarchar(2000)}
, @command3 {nvarchar(2000)}
, @precommand {nvarchar(2000)}
, @postcommand {nvarchar(2000)}

Where:

  • @command1 - is the first command to be executed by "sp_MSforeachdb" and is defined as nvarchar(2000)
  • @replacechar - is a character in the command string that will be replaced with the table name being processed (default replacechar is a "?")
  • @command2 and @command3 are two additional commands that can be run against each database
  • @precommand - is a nvarchar(2000) parameter that specifies a command to be run prior to processing any database
  • @postcommand - is also an nvarchar(2000) field used to identify a command to be run after all commands have been processed against all databases.
I have found that in real life the nvarchar(2000) really means 1928.

Wednesday, July 07, 2010

Do not use sp_adduser or sp_dropuser use Create User and Drop User because they are being deprecated. Also when you use sp_adduser a schema is created with the user name when used in SQL Server 2005/2008 that is owned by the user. This schema can not be removed without first transferring ownership to dbo with
ALTER AUTHORIZATION ON SCHEMA::[username] TO [dbo] first
Just had my first article in the SQL Server World Published:

SSIS Package to Script All SQL Server Jobs to Individual Files on SQLServerCentral.com