Creating Functions for Stored Procedures

  • Alex Grinberg-230981

    SSC Eights!

    Points: 896

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

  • roger clarke

    SSC Enthusiast

    Points: 183

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

  • aburgess

    SSC Rookie

    Points: 27

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

  • Cheetah

    Old Hand

    Points: 332

    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

  • Marcelo Luiz Soares de Souza

    Grasshopper

    Points: 24

    The link for C# TSQL script is http://www.sqlservercentral.com/Files/CreateADO_Call_BySPName_Cs_GetFile.sql/1788.sql.

  • Anipaul

    SSC-Insane

    Points: 24681

    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.

  • jcrawf02

    SSC-Insane

    Points: 24198

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

  • Anipaul

    SSC-Insane

    Points: 24681

    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. πŸ™‚

  • Barry Couch

    SSC Veteran

    Points: 233

    Alex,

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

    -Barry

  • Alex Grinberg-230981

    SSC Eights!

    Points: 896

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

  • Jeff Moden

    SSC Guru

    Points: 994682

    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.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."
    When you put the right degree of spin on it, the number 3|8 is also a glyph that describes the nature of a DBAs job. πŸ˜‰

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

  • Alex Grinberg-230981

    SSC Eights!

    Points: 896

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

  • Alex Grinberg-230981

    SSC Eights!

    Points: 896

    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

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 715912

    The link has been corrected in the article.

  • Jeff Moden

    SSC Guru

    Points: 994682

    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.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."
    When you put the right degree of spin on it, the number 3|8 is also a glyph that describes the nature of a DBAs job. πŸ˜‰

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

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

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