Custom SSMS Shortcuts for ETL Developer. Part 1: SELECT in a Keystroke

  • 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

  • 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.

  • Nice, but the SP unnecessary. You can write in the SSMS "Select TOP 50 * FROM "

  • 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.

  • nice good concept but not much help full in practical field,,,, follow the previous comments

    thankss

    [font="Comic Sans MS"]Rahul:-P[/font]

  • 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!

  • 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!

  • 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

  • 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

  • The sp doesn't work for tables which are not in dbo scheme

  • 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?

  • Sorry, what do you mean "how to you go about that"?

  • 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.

  • 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

  • Very Useful

Viewing 15 posts - 1 through 15 (of 34 total)

You must be logged in to reply to this topic. Login to reply