Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Shortcut key

Author  Topic 

Arunshyam
Starting Member

1 Post

Posted - 2009-12-16 : 12:37:18
Can i use user defined stored procedure as shortcut key?
For example,
the shortcut key Alt+F1 for sp_help and Ctrl+1 for sp_who...
like that i want to give a shortcut key sp_select(This is a user defined stored proc)
create proc sp_select(@tblname varchar(500))
as
exec('select * from '+tblname)

now i want to use this procedure as shortcut key

can i use? or is there any other way to do this same?

Arunshyam

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-16 : 12:38:42
Why even bother using stored procedures when you aren't making use of their benefits?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2009-12-16 : 12:48:26
See Tip 3 here: http://www.eggheadcafe.com/tutorials/aspnet/b039a933-1815-4c21-bc5d-e5f4cd421c5d/5-sql-server-management-s.aspx

It refers to this: http://www.codeproject.com/KB/database/SQLShortCutKey.aspx which is uncannily similar to your question.


Ryan Randall - Yak of all trades
Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-12-17 : 02:03:44
quote:
Originally posted by Arunshyam

Can i use user defined stored procedure as shortcut key?
For example,
the shortcut key Alt+F1 for sp_help and Ctrl+1 for sp_who...
like that i want to give a shortcut key sp_select(This is a user defined stored proc)
create proc sp_select(@tblname varchar(500))
as
exec('select * from '+tblname)

now i want to use this procedure as shortcut key

can i use? or is there any other way to do this same?

Arunshyam


I dont see the actual benefit using this
Did you know that if you implement this you are returning ALL the rows from the table?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2009-12-17 : 05:48:10
As tip 3 says: "If most of the tables you handle are large, you can tweak that stored procedure to show you just the top 10 or 25 rows to quickly see a few."

I can see a small benefit, but it's so small I've never bothered to set it up myself.


Ryan Randall - Yak of all trades
Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2009-12-17 : 06:57:13
http://connectsql.blogspot.com/2009/07/execute-most-frequent-queries-with.html
Go to Top of Page
   

- Advertisement -