 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
TDarnall
Joined: 13 Nov 2007 Posts: 7 Country: United States |
|
4.0 beta - Code snippets not working |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
TDarnall
Joined: 13 Nov 2007 Posts: 7 Country: United States |
|
|
|
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 |
|
 |
shaddow58
Joined: 15 Feb 2007 Posts: 8
|
|
|
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
shaddow58
Joined: 15 Feb 2007 Posts: 8
|
|
|
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
|
|
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
|
|
|