10 SQL Snippets For Faster, More Effective Code

  • Comments posted to this topic are about the item 10 SQL Snippets For Faster, More Effective Code

  • Some I end up using a lot.

    isc ->

    SELECT *

    FROM INFORMATION_SCHEMA.COLUMNS

    WHERE TABLE_NAME = ''

    isr ->

    SELECT *

    FROM INFORMATION_SCHEMA.ROUTINES r

    WHERE r.ROUTINE_DEFINITION LIKE '%%'

    ra->

    RANK ( ) OVER (PARTITION BY $CURSOR$ ORDER BY )

    rai ->

    RAISERROR ('Error raised in TRY block.', -- Message text.

    16, -- Severity.

    1 -- State.

    );

  • Group by and order by were already in my snippets and I'm pretty sure I didn't put them there. Nice examples, though.

  • Thanks!

    I /think/ gb and ob may have been more recently added 🙂

  • I particularly like 'ra' out of these.

    Do you want to submit them to the github repo as a pull request :-)?

Viewing 5 posts - 1 through 4 (of 4 total)

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