Click here to Skip to main content
Click here to Skip to main content

SELECT * FROM, sp_helptext ShortCut for SQL Query Analyzer

By , 12 Jun 2006
 

Introduction

For them, who are fed up of typing 'SELECT * FROM' for tables for which they want
to retrieve the data and want to see text of the stored procedures.

1. Create following procedure in your working database / or master database if you have the permission and give EXECUTE permission to other Roles/Users.

CREATE PROC sp_SelectFromTable @tbl VARCHAR (128)
AS
EXEC ('SELECT * FROM ' + @tbl )
GO

Now open SQL Query Analyzer >> Tools >> Customize >> Custom Tab type sp_SelectFromTable against Ctrl+3 (or whatever shortcut key you like to choose )

To use above Key shortcut -
Type any table name in your database, select the table name and say Ctrl+3


2. Make a short cut key for seeing the text of Stored Procedure.
open SQL Query Analyzer >> Tools >> Customize >> Custom Tab
type sp_helptext against Ctrl+4 (or whatever shortcut key you like to choose )

To use above Key shortcut -
Type any Stored Procedure name in your database, select the SP name and say Ctrl+4.

These are small but may be useful for SQL Query Analyzer users.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Paresh Goyal
Web Developer
India India
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 1memberBlkbam22-Jan-11 6:40 
This could be found by simply reading the BOL (Books online). Learn your tools before looking for tips on them.
Generalselect problemmemberhercules77710-Feb-07 1:39 
hi
 
when i select(highlight) the stored proc name & press ctrl 4 i get Procedure 'sp_helptext' expects parameter '@objname', which was not supplied.
 
the sp name is not getting passed over
 
any ideas
 
paul
GeneralRe: select problemmemberParesh Goyal10-Feb-07 3:28 
Hi,
 
Have you done the first step of setting up shortcut key as-
Make a short cut key for seeing the text of Stored Procedure.
open SQL Query Analyzer >> Tools >> Customize >> Custom Tab
type sp_helptext against Ctrl+4 (or whatever shortcut key you like to choose )
 
Regards,
Paresh Goyal.
GeneralRe: select problemmemberhercules77710-Feb-07 11:29 
hi
 
found the problem very subtle .... i had left a space after the sp_helptext command in the custom tab for cntrl 4
 
thanks for your help

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130617.1 | Last Updated 12 Jun 2006
Article Copyright 2006 by Paresh Goyal
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid