SQL Server
Reinstalled SQL Server 2005, with the wrong collation??
03 years ago
If yes, then following the instructions below, from MSDN (http://msdn.microsoft.com/en-us/library/ms179254.aspx):
Make sure you have all the information or scripts needed to re-create your user databases and all the objects in them. See my note below
Export all your data using a tool such as bulk [...]
List of database tables, with count of records.
03 years ago
in General
Use the script below, to return a list of database tables (the schema and table name) along with a count of the records within each table. This can come in useful if you are trying to compare databases.
DECLARE @TableName VARCHAR(100)
DECLARE @Schema VARCHAR(100)
DECLARE @SQL VARCHAR(1000)
DECLARE [...]
Problems with installing SQL Server
03 years ago
If you are trying to install SQL Server 2005, and receive an error regarding the SQL Server Native Client package being missing, go to your “servers” install CD/folder, and right-click on the sqlncli.msi file, and click on Uninstall.
Once uninstalled, just re-run the setup again, and it should [...]
Add Row Number to imported data (using SSIS)
03 years ago
If you are using SQL Server Integration Services (SSIS) to import data and want to record the row number against each record, then the Konesans Row Number Transformation product is exactly what you need.
Please click here for more information about the Konesans Row Number Transformation product [...]
COALESCE – Return first non-NULL value from multiple choices
03 years ago
in Transact-SQL
Whilst studying for my MCITP Database Developer certification, I have come across a very useful function that returns the value of the first non-NULL value from multiple choices:
SELECT LastName, FirstName, COALESCE(MobilePhone, HomePhone) AS Phone
If the MobilePhone field is blank, it will use the [...]
Create a stored procedure using a parameter default of NULL
03 years ago
in Transact-SQL
The default value of a parameter can be specified as NULL. In this case, if you do not supply a parameter, SQL Server executes the stored procedure according to its other statements. No error message is displayed.
The procedure definition can also specify that some other action be taken if you do [...]