SQL Server insert and case sensitivity.....

  • We have a table in SQL Server.... say the table has two rows in it and the first column/row is MARK and the other row is mark.... if you send an update statement where this column is mark why would it update both rows ???

    Is this due to the SQL Server installation options of default case insensitive ???

     

    We have data in a DB2 table that we are trying to replicate in SQL Server and running into this type of problem...

     

    Any help on this would be greatly appreciated...

  • SQL server is case insensitive by default... I don't know how to solve the replication isssue though.

  • That is what I thought... It is an install of SQL Server parameter.... I 'think' this can be database specific in SQL 2000... not sure though... I know I would have to unload and reload the tables in the db.... I can't simply reinstall SQL Server though as there are 50 other dbs on this server... hum...

  • That's all I found... I'd ask a real expert the best path to do this :

    ALTER DATABASE DbName

    COLLATE collation_name

  • Markus,

    You are correct that it can be db specific. You can even go as far as column specific with SQL2000. Be careful of what you ask for though because it doesn't affect the data only - all objects in the db become Case Sensitive if you go with the db settings.

    Almost forgot!!

    You can also format your query like this

    Select fieldname from table where fieldname = 'mark' COLLATE SQL_Latin1_General_CP1_CS_AS

    this will "force" the collation of the field to match on the exact casing of mark

    Good Luck,

    Darrell

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

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