Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I have a database with many stored procedures. I want to export those stored procedure statements into sql files, so I can execute them again.
I want to create a windows application to do such jobs.
Is there an existing tool can do such jobs?
How can I write the code in C# ?
Do you have any suggestion ?
 
I need your help. Thank you firstly.
 
The reason why I want to do this is that,
I had created many stored procedures, and I need all statements to execute when I install the application in a remote server.
Posted 9-Jun-11 2:03am
taony1.7K
Edited 9-Jun-11 3:42am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This command might help,
 
select ROUTINE_DEFINITION from INFORMATION_SCHEMA.ROUTINES
 
Every row is a stored procedure
  Permalink  
Comments
taony at 9-Jun-11 8:43am
   
Thank you, I am going to try this command.
taony at 9-Jun-11 9:00am
   
Thank you, you are right. It helped me a lot.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Why would you want to do that? If the stored procedures are already in the database, there's no reason to export them to their own files. You're completely defeating the purpose of having the stored procedures IN the database.
  Permalink  
Comments
taony at 9-Jun-11 9:00am
   
Thank you for giving me a answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 7,130
1 DamithSL 5,089
2 Maciej Los 4,866
3 Sergey Alexandrovich Kryukov 4,647
4 Kornfeld Eliyahu Peter 4,409


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 9 Jun 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100