Red Gate forums :: View topic - UPDATE...SET...FROM
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation

SQL Prompt code snippets forum

UPDATE...SET...FROM

Search in SQL Prompt code snippets forum
Post new topic   Reply to topic
Jump to:  
Author Message
jamiet



Joined: 29 Jan 2007
Posts: 8

PostPosted: Mon Jan 29, 2007 7:06 pm    Post subject: UPDATE...SET...FROM Reply with quote

I've looked within the options panel for a way of exporting snippets but I can't find a way. So I might as well just post it up here in freetext:

Snippet: usf
Description: UPDATE...SET...FROM
Category: DDL
Code:
UPDATE
SET
FROM



I was quite surprised there wasn't one there for UPDATE already actually. Anyway, its in mine now!!!

-Jamie

P.S. Is there a way to export/import snippets?
Back to top
View user's profile Send private message
massybird



Joined: 14 Feb 2007
Posts: 4

PostPosted: Thu Feb 15, 2007 4:29 pm    Post subject: Reply with quote

The only thing I would add to your snippet would be:

UPDATE $CURSOR$ SET

so the cursor is positioned right after the UPDATE keyword when SQL Prompt resolves the snippet. That way you avoid moving the cursor yourself to type in the name of the table you're updating. Good suggestion on import/export of snippets.
Back to top
View user's profile Send private message
nico



Joined: 20 Feb 2007
Posts: 3

PostPosted: Tue Feb 20, 2007 4:27 am    Post subject: setting cursor Reply with quote

Hi massybird,

I tried to set the cursor in my snippet using the $CURSOR$ statement. But upon testing it in the query analyzer, it only showed the text itself. Hope you can help me out.

Thanks,

Nico
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
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