Click here to Skip to main content
15,879,326 members
Home / Discussions / Database
   

Database

 
GeneralRe: Tricky Query that includes a time difference Pin
Richard Deeming20-Feb-17 6:52
mveRichard Deeming20-Feb-17 6:52 
GeneralRe: Tricky Query that includes a time difference Pin
john_berman20-Feb-17 7:04
john_berman20-Feb-17 7:04 
GeneralRe: Tricky Query that includes a time difference Pin
john_berman20-Feb-17 7:06
john_berman20-Feb-17 7:06 
QuestionDatabase Design - Help Appreciated Pin
john_berman19-Feb-17 21:03
john_berman19-Feb-17 21:03 
AnswerRe: Database Design - Help Appreciated Pin
Mycroft Holmes19-Feb-17 21:38
professionalMycroft Holmes19-Feb-17 21:38 
GeneralRe: Database Design - Help Appreciated Pin
john_berman20-Feb-17 6:07
john_berman20-Feb-17 6:07 
QuestionDB Case Sensitivity, unexpected/surprising behaviour Pin
User 1106097918-Feb-17 1:17
User 1106097918-Feb-17 1:17 
AnswerRe: DB Case Sensitivity, unexpected/surprising behaviour Pin
Richard Deeming18-Feb-17 1:35
mveRichard Deeming18-Feb-17 1:35 
It might seem odd at first glance, but it makes sense when you consider the fact that the names of all the objects within the database are stored in system tables within the database itself.

If the default collation for the database is case-sensitive, then the collation for all of the system tables is case-sensitive. So SELECT * FROM sys.tables WHERE name = 'Test' isn't going to match a row where name = 'TEST'.

Whilst Microsoft could have chosen to make the system tables always case-insensitive, that would have been a breaking change. Earlier versions of SQL Server didn't allow you to mix collations within a single database, so introducing that change in a later version could have broken existing databases or scripts.

There are effectively two "solutions":
  1. Always create your databases using a case-insensitive collation, and use a case-sensitive collation on individual columns;
  2. Always write your scripts using the case of the table and columns names as defined when they were created;


SQL Server Case Sensitive Collations and DMVs[^]



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


PraiseRe: DB Case Sensitivity, unexpected/surprising behaviour Pin
User 1106097918-Feb-17 1:40
User 1106097918-Feb-17 1:40 
GeneralRe: DB Case Sensitivity, unexpected/surprising behaviour Pin
User 1106097918-Feb-17 3:49
User 1106097918-Feb-17 3:49 
GeneralRe: DB Case Sensitivity, unexpected/surprising behaviour Pin
Richard Deeming18-Feb-17 8:30
mveRichard Deeming18-Feb-17 8:30 
GeneralRe: DB Case Sensitivity, unexpected/surprising behaviour Pin
User 1106097918-Feb-17 8:35
User 1106097918-Feb-17 8:35 
QuestionBest Praxis for “user-id/primary” Pin
User 1106097917-Feb-17 9:19
User 1106097917-Feb-17 9:19 
AnswerRe: Best Praxis for “user-id/primary” Pin
Gerry Schmitz17-Feb-17 10:28
mveGerry Schmitz17-Feb-17 10:28 
PraiseRe: Best Praxis for “user-id/primary” Pin
User 1106097917-Feb-17 10:30
User 1106097917-Feb-17 10:30 
GeneralRe: Best Praxis for “user-id/primary” Pin
Gerry Schmitz17-Feb-17 11:00
mveGerry Schmitz17-Feb-17 11:00 
AnswerRe: Best Praxis for “user-id/primary” Pin
Eddy Vluggen17-Feb-17 12:45
professionalEddy Vluggen17-Feb-17 12:45 
PraiseRe: Best Praxis for “user-id/primary” Pin
User 1106097918-Feb-17 0:27
User 1106097918-Feb-17 0:27 
GeneralRe: Best Praxis for “user-id/primary” Pin
Eddy Vluggen19-Feb-17 8:45
professionalEddy Vluggen19-Feb-17 8:45 
QuestionVery big database question. Need answers ? Pin
Yogi S.17-Feb-17 7:27
Yogi S.17-Feb-17 7:27 
AnswerRe: Very big database question. Need answers ? Pin
Eddy Vluggen17-Feb-17 7:52
professionalEddy Vluggen17-Feb-17 7:52 
QuestionHow to calculate the eligibility year of Promotion if Present Year - last year of Promotion is greater than or Equals to 3 (Three) Pin
Okezie Victor17-Feb-17 0:05
Okezie Victor17-Feb-17 0:05 
AnswerRe: How to calculate the eligibility year of Promotion if Present Year - last year of Promotion is greater than or Equals to 3 (Three) Pin
Mycroft Holmes17-Feb-17 12:57
professionalMycroft Holmes17-Feb-17 12:57 
GeneralRe: How to calculate the eligibility year of Promotion if Present Year - last year of Promotion is greater than or Equals to 3 (Three) Pin
Okezie Victor28-Mar-17 3:46
Okezie Victor28-Mar-17 3:46 
Questionwhat is the best way indexing foreign key from multiple table? Pin
Gilbert Consellado9-Feb-17 23:30
professionalGilbert Consellado9-Feb-17 23:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.