Results 1 to 6 of 6

Thread: Read rendered storeed procedure

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Read rendered storeed procedure

    Hello,

    I have a stored procedure that someone else created using dynamic SQL. I'm just curious, is there a way vb.net (2008) can read the stored procedure the same way SQL Server interprets it?

    So in other words I'd only see the actual select statement instead of all the concatentation and stuff associated with dynamic SQL

    Thanks,

    Strick

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Read rendered storeed procedure

    Create an output parameter as type varchar(max), then set the output parameter equal to your query, and use .net code to read the output parameter
    That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma

    Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Re: Read rendered stored procedure

    That's a really good idea. Thanks. One question though, this would run the sp though wouldn't it?

    Strick

  4. #4
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Read rendered storeed procedure

    Yes. If that's not what you want, you could add a debug input parameter using bit type, to determine if you want to return the SQL, or execute it.
    That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma

    Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Re: Read rendered storeed procedure

    Excellent, thank you. That's the approach I'm going to take.

    Strick

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Read rendered storeed procedure

    Thread moved to 'Database Development' forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width