Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kt
Yak Posting Veteran
88 Posts |
Posted - 2013-02-25 : 10:41:29
|
Hi,I am inherited the code from previous developer and not sure why he used COLLATE database_default from his query. Slect …..FROM tbl1 a LEFT JOIN tbl2 b ON a.Code COLLATE database_default= b.code.here are some code from each table.tbl1300800-92501597,301000-92501597,301200-92501597tbl2"#1"-1/8" STAMP, 071614-7210256V, 071614-72102580, thanks |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-02-25 : 11:11:12
|
It may be because the Code column in tbl1 had a collation that was incompatible with the collation of Code column of tbl2 (which may have had the default collation.) You can see what the collations are using the following queries. SELECT DATABASEPROPERTYEX('YourDatabaseNameHere','Collation')SELECT collation_nameFROM sys.columnsWHERE OBJECT_NAME(OBJECT_ID) = 'tbl1' AND name = 'Code'; |
|
|
|
|
|