Link to home
Start Free TrialLog in
Avatar of vj_mi
vj_mi

asked on

How to specify Collate when creating temp tables

Hi,

I create following temp table:
         
CREATE TABLE #MyTemp(        
 [Desc] [nvarchar] (50),        
 [Code] [smallint],        
 [Ikey] [smallint]  
)        

Now how do I specify COLLATE SQL_Latin1_General_CP1_CI_AS collation for this table? Note that it should run on both SQL 2000 and SQL 2005

Regards,
MI

       
ASKER CERTIFIED SOLUTION
Avatar of adathelad
adathelad
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vj_mi
vj_mi

ASKER

So do I need to set for all columns or only columns where this table is joined with other tables?

Regards,
MI
It doesn't matter for the numerical columns.

I presume you were having collation errors, hence why you want to explicitly set the collation? If not, then no need to specify it.

Otherwise, yes I *think* you only need it on the columns used to join on other tables that have a different collation.