plq
asked on
Reset collation
How can I programmatically (using TSQL) remove the collation sequence from all fields in a database, so that each field has collation sequence "database default" ?
At the moment most fields have a hard coded collation sequence which is different from the database default, and any fields added by the programs will default to the database default, so there's a collation mismatch on each where clause/join etc. I want to get them the same.
sql 2000
thanks
At the moment most fields have a hard coded collation sequence which is different from the database default, and any fields added by the programs will default to the database default, so there's a collation mismatch on each where clause/join etc. I want to get them the same.
sql 2000
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try changing it to:
set @strcollateSeq = 'database_default' -- or whatever collation seq you want to use
/Richard
set @strcollateSeq = 'database_default' -- or whatever collation seq you want to use
/Richard
ASKER
Excellent
Thanks for helping
Thanks for helping
ASKER
Any idea how to set to <database default> instead of a specific collation ?
print ('alter table ' + @strTable + ' Alter column ' + @strcolName + ' ' + @strDataType + @strprecision
+ ' COLLATE ' + ????????????????????????? + ' ' + case when @intNullable = 1 then ' Null ' else ' Not Null' end)