Thursday, October 25, 2007

Diff DataBases

Just a memo for the good tablediff command.

C:\Program Files\Microsoft SQL Server\90\COM>tablediff -sourceserver "SQL2005" -
sourcedatabase "MyDB1" -sourcetable "ABC" -destinationserver "SQL2005" -destinat
iondatabase "MyDB2" -destinationtable "ABC" -f "c:\Diff"

Quick example can be found at:
http://www.databasejournal.com/features/mssql/article.php/3594926

Tuesday, October 23, 2007

SQL string compare with accent-insensitive

I'm always forgetting the collation name used for this prupose.
How to compare strings without caring about accents:

select *
from t1 inner join t2 on t1.description collate SQL_Latin1_General_Cp850_CI_AI like t2.description collate SQL_Latin1_General_Cp850_CI_AI