Creating Functions for Stored Procedures

  • Comments posted to this topic are about the item Creating Functions for Stored Procedures

  • the C# link is broken ... however ... I was able to download the VB code

  • I wanted to know how it was done in c# but the link is broken.

  • I have script that generate DML stored procs for all tables. This will help me generate even more code, if only the C# script is available. Please fix the link

  • I am getting the following error while accessing the C# code:

    The resource could not be found

    Sorry, we could not find the resource at http://www.sqlservercentral.com:80/Files/CreateADO_Call_BySPName_C

    If problems persist, please contact us to let us know.

  • Just curious, if you are working in an environment where DBA's DON'T know not to use sp_, is there another way to filter out the system procs and keep the rest? SQL Server doesn't hold onto a createid, does it?

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

  • Marcelo Luiz Soares de Souza (10/10/2008)


    The link for C# TSQL script is http://www.sqlservercentral.com/Files/CreateADO_Call_BySPName_Cs_GetFile.sql/1788.sql.%5B/quote%5D

    Thanks I got the code. I didn't saw this link while posting the earlier message. Please rectify this in the article also. πŸ™‚

  • Alex,

    This is AWESOME. This is going to save me a heap of time. Thanks a million for sharing.

    -Barry

  • Believe it on not – I did. This is was while ago, but when I joined to project, all sprocs named as SP_. It took about a month to convince managers to stay out of prefix SP_.

  • jcrawf02 (10/10/2008)


    Just curious, if you are working in an environment where DBA's DON'T know not to use sp_, is there another way to filter out the system procs and keep the rest?

    Yes...

    If you use Information_Schema.Routines as the source of information, only user objects are listed. You can also brute force things using one of the following...

    WHERE OBJECTPROPERTY(id , 'IsMsShipped') = 0

    WHERE OBJECTPROPERTY(OBJECT_ID(tablenamecolumn) , 'IsMsShipped') = 0

    WHERE OBJECTPROPERTY(OBJECT_ID(schemanamecolumn+'.'+tablenamecolumn) , 'IsMsShipped') = 0

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thanks to everyone for good response (and bad as well). Sorry for broken C# link, but it’s nothing to do with the article.

  • You could use select * from sys.objects where is_ms_shipped = 0 as well. I am not INFORMATION_SCHEMA fan. This is personal preference.:D

  • The link has been corrected in the article.

  • Alex Grinberg (10/10/2008)


    You could use select * from sys.objects where is_ms_shipped = 0 as well. I am not INFORMATION_SCHEMA fan. This is personal preference.:D

    Heh... I forgot about that. I'm still a bit stuck in the world of 2k. Thanks for the reminder. πŸ™‚

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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