Reputation: 9864
I have problem with autocompletion in MSSMS 2008. Every time when I try to write simple 'Id' column MSSMS replace it with 'IDENTITY' (because IDENTITY is first entry that starts on letter I).
I found that entries in autocompletion dropdown aren't sorted correctly, so I have:
entries starting on letter I:
IDENTITY
...
ISNULL
...
ICQNumber
..
Id
Is there any way to change this wrong behaviour to correct one? I mean - force MSSMS 2008 to sort it correctly?
Upvotes: 8
Views: 1496
Reputation: 1
Probably not best practice - as correctly suggested by Joe Stefanelli, but...
If you don't have a table in your database named Id you can create one and the "intelliSense" will default to this instead of IDENTITY.
Upvotes: -1
Reputation: 7836
It seems that Intellisense has some case sensitivity going on.
Typing either id
or ID
causes it to prompt IDENTITY
but typing Id
causes it to prompt Id
.
It's still a pain, but I find that remembering to type Id
saves a lot of use of the backspace key.
Upvotes: 10
Reputation: 135888
The best solution I've found (and it's a good practice anyhow) is to start column references with the table name (or alias):
SELECT YourTable.id
FROM YourTable
OR
SELECT yt.id
FROM YourTable yt
Upvotes: 3