September 21, 2011 at 9:30 pm
Comments posted to this topic are about the item Custom SSMS Shortcuts for ETL Developer. Part 1: SELECT in a Keystroke
Olga Klimova
BI Consultant, MCITP
www.returnonintelligence.ca
September 21, 2011 at 11:46 pm
Or, use Mladen Prajdic's SSMS tools pack and set up a "SQL Snippet" with a shortcut e.g.
"se"
To use it, Press se then the enter key and it will write out the snippet e.g. "SELECT Top 50 * FROM"
Its useful for commonly referenced long table names and all sorts of keywords and SQL phrases.
When I first started using SSMS I missed the history tool in Oracle SQL Developer so that's how I discovered the SSMS tools pack. I highly recommend it.
September 22, 2011 at 12:35 am
Nice, but the SP unnecessary. You can write in the SSMS "Select TOP 50 * FROM "
September 22, 2011 at 1:17 am
shayk (9/22/2011)
Nice, but the SP unnecessary. You can write in the SSMS "Select TOP 50 * FROM "
I also use this "Select TOP 50 * FROM ". It is better than sp, because if you connect to another server, maybe that the stored proc doesn't exist.
September 22, 2011 at 1:19 am
nice good concept but not much help full in practical field,,,, follow the previous comments
thankss
[font="Comic Sans MS"]Rahul:-P[/font]
September 22, 2011 at 1:45 am
Thanks for the article. As has been pointed out, the stored procedure is not required, as there is a better way. (And I'm sure Olga will agree.)
However, if I hadn't read the article, I would not have considered either method. So thanks for bringing this to my attention!
I like it!
September 22, 2011 at 2:58 am
Thanks for the insight you have given. I ran the s.procedure on Person.Person against Adventureworks2008 database. My query was like this:
CREATE PROCEDURE dbo.sp_select
@Person NVARCHAR(200)
AS
DECLARE @cmd NVARCHAR (255)
SET @cmd = 'SELECT TOP 50 * from ' + @Person
EXEC sp_executesql @cmd
GO
I set up the shortcut keys as well but when I ran pressed the keys, I got this error message:
Msg 201, Level 16, State 4, Procedure sp_select, Line 0
Procedure or function 'sp_select' expects parameter '@Person', which was not supplied.
Please, how do I go beyond this so I get the right answer?
Thank you!
September 22, 2011 at 3:37 am
SaintGr8 (9/22/2011)
Thanks for the insight you have given. I ran the s.procedure on Person.Person against Adventureworks2008 database. My query was like this:CREATE PROCEDURE dbo.sp_select
@Person NVARCHAR(200)
AS
DECLARE @cmd NVARCHAR (255)
SET @cmd = 'SELECT TOP 50 * from ' + @Person
EXEC sp_executesql @cmd
GO
I set up the shortcut keys as well but when I ran pressed the keys, I got this error message:
Msg 201, Level 16, State 4, Procedure sp_select, Line 0
Procedure or function 'sp_select' expects parameter '@Person', which was not supplied.
Please, how do I go beyond this so I get the right answer?
Thank you!
Type and highlight the table name...then press your keyboard shortcut (eg CTRL + 5)
gsc_dba
September 22, 2011 at 4:48 am
Nice article and a very good remider for shortcuts, only the sample is not very usefull.
PS: I can simply right click on table and choose the select top xx rows, as you can set the number of rows to any value you want
September 22, 2011 at 4:56 am
The sp doesn't work for tables which are not in dbo scheme
September 22, 2011 at 5:01 am
cgrigolini (9/22/2011)
The sp doesn't work for tables which are not in dbo scheme
So, how to you go about that please?
September 22, 2011 at 5:07 am
Sorry, what do you mean "how to you go about that"?
September 22, 2011 at 5:26 am
Do you have to do something to turn on keyboard shortcuts? I have done this but when I press Ctrl+F1 nothing happens.
Thanks,
Brian.
September 22, 2011 at 5:31 am
I've done nothing, apart from defining the shortcut, as explained in the article.
I like the tool (I was used to use ALT<F1> to see table definition), but still there is the problem that it doesn't work with tables which are in scheme other than dbo, even specifying it.
Thank you
Carlo
September 22, 2011 at 5:49 am
Very Useful
Viewing 15 posts - 1 through 15 (of 34 total)
You must be logged in to reply to this topic. Login to reply