SqlShare.com Logo
 
Skip Navigation Links
Home
Video List
Events
Classes
About Us
Login / Register
Subscribe RSS Feed 

Confio Ignite

Using SELECT to Generate SQL Commands

Today we will show how with just a bit of typing you can use SELECT to generate a series of statements that you can then run as commands. Our example shows how to apply a GRANT to many stored procedures, but you can find a lot of ways to use this trick.

Duration:
2 mins 48 secs
Skill Level:
100
Rating:
4.27 out of 5
Publish Date:
October 19, 2010
Using SELECT to Generate SQL Commands You must be logged in to view this video.  
Bookmark and Share
 
1=Poor, 3=Good, 5=Excellent

About the Author

Image of Andy Warren
Andy Warren is a software trainer focusing on SQL Server, a member of the PASS Board of Directors, and a principal in this site - SQLShare.com.

References



Comments
Lanny Mullis on 10/19/2010
I've used this technique to generate C#, Iron Python and all other types of code. Great shortcut!

Faisal Lodhi on 10/19/2010
Thank you

MohanD on 10/19/2010
Thank you... good example

Calvin Johnson on 10/19/2010
Nice!

Guy Williams on 10/19/2010
You guys ROCK!!!!

Frank on 10/19/2010
awesome!

stan on 10/19/2010
You can also output the results to text for an easier cut and paste operation. Sometimes, the grid does get in the way.

75617F013D on 10/19/2010
Thank you captian obvious. I was really thinking you were going to do an Execute on these in some more direct way...

Scott Schwarze on 10/19/2010
Time saver!! Not always good to use the GUI.

Susan Ray on 10/19/2010
Very userful, I have used a query very similar before to do just that grant permission on a bunch of stored procedures. thank you.

Albert on 10/19/2010
as usal very good, como siempre muy buenos

Jesse Sarlo on 10/19/2010
Very helpful!

Talha on 10/19/2010
It is definitely useful but can't think of where it could be used. May be i never paid attention. Its good to look at Select from this angle.

Bill Johnson on 10/19/2010
Good tip! Thanks again......

Martin Miller on 10/19/2010
Great tip! Thanks Andy.

Michael on 10/19/2010
Wonderfully useful!

Sean on 10/19/2010
This is one of the first things I learned in SQL management and it has gotten me out of horus of work several times. Well presented training.

Aftab on 10/19/2010
Great

Don Gilman on 10/19/2010
he's a great presenter.

Subhash on 10/20/2010
Good One !!!

joey aeb on 10/20/2010
Descent

Tim Bochard on 10/20/2010
great stuff, thanks

dfortier on 10/20/2010
Very nice!

Sudirman Hassan on 10/21/2010
I've been using this technique for very long time already. Really useful to speed-up development.

Pru on 10/21/2010
Brings back memories of techniques I used to use. Good refresher as well as a good technique to remember. Thanks!

Trent on 10/25/2010
good info for beginner level dba's

jorma valkonen on 10/26/2010
Nice work... Keep it up! There is lot of us (I think) who You can help to ease the daily pain, at least a little ;) the rest of it we just have to luxuriate.

FELIX on 10/27/2010
excellent video!

david on 10/27/2010
Good shortcut

John on 10/27/2010
kewl trick

san myint on 10/28/2010
very good approach to handle that.

Robert Neal on 10/30/2010
a very good solution to a problem. I will use this soon.

murali on 10/31/2010
good one



Must Be Logged In
 

How Do I Become a Video Author? |  Newsletter History

Copyright © Fourdeuce, Inc., 2005-2009. All Rights Reserved | Privacy Policy | Terms & Conditions