|
-
Dec 17th, 2009, 09:27 AM
#1
Thread Starter
Fanatic Member
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
-
Dec 17th, 2009, 12:16 PM
#2
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
-
Dec 17th, 2009, 12:28 PM
#3
Thread Starter
Fanatic Member
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
-
Dec 17th, 2009, 12:30 PM
#4
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
-
Dec 17th, 2009, 12:41 PM
#5
Thread Starter
Fanatic Member
Re: Read rendered storeed procedure
Excellent, thank you. That's the approach I'm going to take.
Strick
-
Dec 18th, 2009, 10:30 AM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|