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

  • Olga Klimova

    SSC Enthusiast

    Points: 171

    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

  • davoscollective

    SSCertifiable

    Points: 6355

    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.

  • shayk

    Grasshopper

    Points: 23

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

  • Carlo Romagnano

    SSC-Insane

    Points: 21985

    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.

  • Rahul The Dba

    SSChasing Mays

    Points: 647

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

    thankss

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

  • David McKinney

    SSChampion

    Points: 10449

    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!

  • SaintGr8

    SSC Veteran

    Points: 229

    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!

  • gsc_dba

    SSCertifiable

    Points: 5407

    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

  • mslliviu

    SSC Journeyman

    Points: 94

    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

  • cgrigolini

    Mr or Mrs. 500

    Points: 545

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

  • SaintGr8

    SSC Veteran

    Points: 229

    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?

  • cgrigolini

    Mr or Mrs. 500

    Points: 545

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

  • Brian Carlson

    SSCarpal Tunnel

    Points: 4160

    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.

  • cgrigolini

    Mr or Mrs. 500

    Points: 545

    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

  • sankalpa

    SSC Enthusiast

    Points: 122

    Very Useful

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

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