Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6090175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:11:02+00:00 2026-05-23T12:11:02+00:00

I have a SQL Server with several databases. I want for one of these

  • 0

I have a SQL Server with several databases. I want for one of these databases to be case sensitive to names of variable and for others to not.

I need to change settings so I could run this script without errors

DECLARE @A int
DECLARE @a int

How can you change one database to be case sensitive (for its variable names), while allowing other databases on the instance to be case insensitive for variable names?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:11:03+00:00Added an answer on May 23, 2026 at 12:11 pm

    You need to change the server collation to case sensitive to get the behavior you want. Just changing the collation for the db is not enough.


    The default collation of a SQL Server installation, SQL_Latin1_General_CP1_CI_AS is not case sensitive.

    It sounds like you want to modify the collation of your server to one that is case-insensitive. Choose one with _CS. The _CI means “case insensitive“, and case-sensitive is _CS. Maybe you’ll want Latin1_General_CS_AS.

    This is a great answer to a previous question on Changing SQL Server collation to case insensitive from case sensitive?.

    From the SQL Server Books Online:

    COLLATE (Transact-SQL)

    The collation of an identifier depends on the level at which it is defined.

    • Identifiers of instance-level objects, such as logins and database names, are assigned the default collation of the instance.
    • Identifiers of objects within a database, such as tables, views, and column names, are assigned the default collation of the database.

      For example, two tables with names different only in case may be created in a database with case-sensitive collation, but may not be created in a database with case-insensitive collation. For more information, see Database Identifiers.

    • The identifiers for variables, GOTO labels, temporary stored procedures, and temporary tables are in the default collation of the server instance.

      Variables, GOTO labels, temporary stored procedures, and temporary tables can be created when the connection context is associated with one database, and then referenced when the context has been switched to another database.

    You can check your server collation using:

    SELECT SERVERPROPERTY('collation');
    
    SQL_Latin1_General_CP1_CI_AS
    (1 row(s) affected)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At work, we have several applications with databases in a centralized SQL server. Whenever
Our SQL Server 2000 instance hosts several databases which are all similar, one for
We want to replicate data from one database to several others (on another server).
I have an SQL server database that I am querying and I only want
I have a SQL Server 2000, C# & ASP.net web app. We want to
I have an SQL Server DB with a table with these fields: A bit
I'm helping implement a SQL Server 2008 database and I have several columns that
I have several databases named very similar (my-db-1, my-db-2, my-db-3, my-db-4). I want to
I have an application that uses a SQL Server database with several instances of
I have a SQL Server database and several clients that use it (via a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.