SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
4.0 beta - Code snippets not working

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
4.0 beta - Code snippets not working
Author Message
TDarnall



Joined: 13 Nov 2007
Posts: 7
Country: United States

Post 4.0 beta - Code snippets not working Reply with quote
I can not get any of the code snippets to work, whether they be ones installed by default, or newly created snippets.
I have the option turned on for my instance.

I am running MSSQL2005, Management Studio, Vista 64bit.







Wed Oct 08, 2008 5:11 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6500

Post Reply with quote
Are you pressing Ctrkl+Enter after snipped name which is the default key for inserting snipped code?

If you want snippets to be inserted automatically after name is typed and without pressing Ctrl+Enter, change the snippet key or the default key to "Last char"
Thu Oct 09, 2008 9:38 am View user's profile Send private message
TDarnall



Joined: 13 Nov 2007
Posts: 7
Country: United States

Post Reply with quote
Nope, i was pressing Cntrl+Space and expecting the snippet to show in the list like it does in Red-Gate SQL Prompt. My bad. It works fine now using Cntrl+Enter.
Thu Oct 09, 2008 9:41 am View user's profile Send private message
shaddow58



Joined: 15 Feb 2007
Posts: 8

Post Reply with quote
I am running XP Pro SP3 with MSSQL Management Studio 2005 or Query Analyzer. When I use the Cursor Snippet (cur) and press Crtl Enter it brings up the list of database objects and when I select an object it puts that in for the %object% value, but if I do not select an object it does not put in the snippet. It forces me to use an object from the list to use the snippet.

In Management Studio when I type cur i have to press esc before I can use crtl Enter because the inteli-sence has a keyword highlighted and when I press crtl Enter it puts in that key word. For cur is would put in CURRENT.

In both apps when I type cur (press ect in Management Studio) and use backspace to delete all of cur and type anything that is keyword and press enter, it will put in the cursor snippet with that keyword as the object (%object%). It seems to do this will all snippets that bring up the object window.
Fri Oct 10, 2008 4:27 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6500

Post Reply with quote
Here is brief background. The "cur" snippet came from the previous version when keywords prompts were not available. Now the snippet name conflicts with the keyword. To avoid this, I suggest renaming the snippet to simple cs or something else that doesn't match keywords.

Alternatively, can also disable the "Auto-select first list item" option. This way you can continue typing and the keyword popup will not obstruct your typing. After typing cur you can press Esc, and you wouldn't need to delete anything. You can then press Ctrl+Enter right away, and start working with the snippet.

Hope this helps. If I've missed your point, please let me know.


Last edited by SysOp on Wed Oct 15, 2008 10:26 am; edited 1 time in total
Fri Oct 10, 2008 4:38 pm View user's profile Send private message
shaddow58



Joined: 15 Feb 2007
Posts: 8

Post Reply with quote
That is only half of the issue I have. If I press Esc to hide the keywords and then press Ctrl + Enter it brings up the list of database objects and I have to choose one from the list to get the snippet to work. There are a number of queries in my organization where the select statement looks like this:
select * into #temp_table from table_name

The way the snippet is currently I cannot use that temp table with the cursor.
Wed Oct 15, 2008 10:25 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6500

Post Reply with quote
Why don't you want to rename the snippet from "cur" to something else? If you rename it, the entire name conflicting issue will be gone.

By the way, if you want a snippet for selecting into a tempt table, just modify one of the existing snippets as needed or create a brand new snippet. Snippets that come with the default installation are just samples designed to help you learn how to use this powerful feature. You can customize them any way you want, delete, create new, etc.. It is all yours.
Wed Oct 15, 2008 10:31 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.