SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Keyword sysname case

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Keyword sysname case
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Keyword sysname case Reply with quote
According to 2008 R2 Books Online:
Quote:
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
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 View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
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 View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
SysOp wrote:
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
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 View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
Excellent idea, thank you.
Thu Oct 21, 2010 3:26 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.