Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
Keyword sysname case |
|
According to 2008 R2 Books Online:
 |
 |
Important:
In databases that are case-sensitive, or that have a binary collation, sysname is recognized as a SQL Server system data type only when it appears in lowercase. |
which is rather irritating, because SQL Agent makes keyword SYSNAME uppercase and creates syntactically incorrect code when having a database with the criteria described above. And this is only the smaller part of the annoyance, it also breaks snippets containing this keyword in uppercase. Removing SYSNAME from the list of keywords helped to an extent (it does not get uppercased) but it also removed it from keyword popup.
Maybe making Code Formatting rules being case insesitive on analysis and enforce case sensitivity when applying the format (as it is written in the rules) would offer greater flexibility.
|
|
Mon Oct 11, 2010 10:17 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
You can simply remove it from the list of keywords to format. Please see Code Formatting tab in SQL Assistant options, the keywords section
|
|
Mon Oct 11, 2010 10:27 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
That's what I did, and after that I could format it whatever I liked, but it disappeared from the popup.
|
|
Mon Oct 11, 2010 10:40 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Unfortunately I cannot offer any other workaround at this time that would fix the formatting and yet keep that keyword in the keywords list. To the best of my knowledge this is the only case of a single case-sensitive keyword across all 9 types of supported database systems.
Please consider adding a quick code snippet, for example "sn"[Ctrl+Enter] which you can use to quickly enter sysname keyword in lower case.
|
|
Mon Oct 11, 2010 11:16 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
 |
 |
To the best of my knowledge this is the only case of a single case-sensitive keyword across all 9 types of supported database systems. |
Yes, I think so too. That's why its irritating. MS made that nonsense. I just removed it from the keyword list. I can live with it not being on the popup list, and have already modified most of my snippets, it's the breaking of consequent behavior that bothers me. Ehh, never mind.
|
|
Tue Oct 12, 2010 3:10 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
There appears to be a simple solution for this issue:
1. On Code Formatting tab in SQL Assistant options set Convert Keywords option from default Upper-case to Custom-case.
2. Expand the keywords section below, copy all keywords to SQL Editor and convert all of them to upper case, except lines in [ ] brackets. Change SYSNAME keyword to lower case.
3. Paste keywords back to keywords section and click OK to apply changes.
That's it.
|
|
Wed Oct 20, 2010 11:51 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Excellent idea, thank you.
|
|
Thu Oct 21, 2010 3:26 am |
|
 |
|