Collate Syntax Error

  • I am trying to create a table using:

    CREATE TABLE [dbo].

    (

    [cust_no] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL)

    But it gave me an error:

    Incorrect syntax near 'COLLATE'.

    What did I miss? Thank You!

  • Check the compatibility level with sp_helpdb. If it's less than 80, you can't use collations on columns.

    --Jonathan



    --Jonathan

  • Thank you, Jonathan. You are right. The compatibility level is 65. What determines the compatibility level? What can be done to make it 80? Thanks again.

  • quote:


    Thank you, Jonathan. You are right. The compatibility level is 65. What determines the compatibility level? What can be done to make it 80? Thanks again.


    The compatibility level was set for some (good?) reason, so you should check with others at your site before changing it using:

    
    
    sp_dbcmptlevel <dbname>,80

    --Jonathan



    --Jonathan

  • Thank you!!!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply