Solved

How to extract all my store procs from DB Artisan to a local directory?

Posted on 2008-10-02
14
1,195 Views
Last Modified: 2012-05-05
Hi,

I want to know how to get or copy all the store procedures to a local directory.  
I am able to extract and copy one by one.  Right click on a store procedure name and then click on extract and say file-> save as to my local folder.  But I have more than 100 store procedures so I need to know if there is any easier way so that I can save all of the store procedures in a batch.  Please let me know if there is any nice way of doing it.

Thanks in advance.
0
Comment
Question by:rbhargaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
  • 2
14 Comments
 
LVL 19

Expert Comment

by:grant300
ID: 22628531
I don't know if DBArtisan has that capability or not.  Have you tried doing a multiple selection and then right mouse clicking?  Have you tried selecting the Procedure folder and right mouse clicking?

I use RapidSQL all the time and we routine export hundreds of stored procedures.  I would be surprised if there was not a way to do it in DBArtisan.

Have you looked to see if there is a way to export objects to a flat file instead of to the editor window?

Regards,
Bill
0
 

Author Comment

by:rbhargaw
ID: 22628996
1. Multiple selection with Right click and "extract" opens only one file.
2. No option on Right click of Folder (other than connect, disconnect)


Multiple selection with Right click and "opens" will give all the files but you need to do save as and then copy the name. Export objects are not present.


0
 
LVL 6

Expert Comment

by:IncisiveOne
ID: 22640017
Explorer-datasources-SERVER-databases-DATABASE-procedures.  On the right, you shold have a full list of sprocs (by owner, name, etc). Click at the top of the list.  Using the scroll bar on the far right, go to the bottom of the list. SHIFT-Click on the last entry.  you should have multiple selection.  Now hit the Extrac Button.
0
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

 

Author Comment

by:rbhargaw
ID: 22671746
DBArtisan does not have option to export all the stored procedure at once. I am closing the ticket.
0
 
LVL 6

Accepted Solution

by:
IncisiveOne earned 125 total points
ID: 22676043
1  Author's comment is incorrect, looks like he has scrolling problems or does not understand right-click, shift-click, etc.  I have and use DBArtisan 8.5.5 & Sybase extensively.  File attached showing DBArtisan multiple selection as per my solution (following which the Extract button needs to be used).
2  There are alternate (without using DBArtisan) simple methods but these cannot be tabled unless there is a dialogue, which the author is not progressing with.

(The upload does not appear to finish ... Objecting as is after 15 mins)
0
 

Author Comment

by:rbhargaw
ID: 22678283
Hello IncisiveOne,

I did tried The same "Click at the top of the list.  Using the scroll bar on the far right, go to the bottom of the list. SHIFT-Click on the last entry and then right click extract", that opened only one stored procedure.

Can you tell me any method to do that?

Thanks
0
 

Author Comment

by:rbhargaw
ID: 22678291
Increasing the point since the discussion will go furthur
0
 
LVL 6

Expert Comment

by:IncisiveOne
ID: 22683453
I still believe your problems are in the area of keystrokes.  Therefore we are going to have to get very specific with instructions.  You did not do what I requested, pls try again.
0  Accept that what you want is possible.
1  Scroll to the top of the list, select the first proc entry.
2  Using the scroll bar, scroll to the bottom of the list.
3  Holding the shift key down, click on the last proc entry in the list.  At this stage your screen should look like mine (attached file; the entire selected set of entries should be blue).  If you have not succeeded in selecting all the entries, then do not go further, post again.
4 Do not use "right-click ... Extract"
5 Leave the multiple selection as is. Hit the Extract BUTTON (in my screen, it is fourth from the left.
DBArtisan-Multi-Selectn.jpg
0
 
LVL 6

Expert Comment

by:IncisiveOne
ID: 22683472
6 Now you should get a dialogue with a progress bar(second attached file)
7 Which will be placed in one SQL window, which can be saved to one file.

Cheers
Derek
DBArtisan-Multi-Extractn.jpg
0
 

Author Comment

by:rbhargaw
ID: 22683989
Derek,

I tried as indicated by you. If I choose 3 stored procedures, all 3 stored procedures will come up in ONE file.
Hope I am right till now. How do I save them individually??

I want these stored procedures as proc1.sql, proc2.sql, proc3.sql so to be able save in my local drive.



Thanks
Roop
0
 
LVL 6

Expert Comment

by:IncisiveOne
ID: 22684115
Hang on, your original question asks to extract & store all the stored procs together, in a "batch".  I understood that to be ONE file.  Now it seems you want each sproc in a separate file, but you want to do the extraction/store in one command (or set of keystrokes).  Now the mention of "folder" makes more sense to me.

You are trying to mix single-selection facilities (one sproc per file) with multiple-selection (a batch of sprocs which means a batch file) and get one sproc per file. Have you seen this with any PC program ... multiple select ... each to a separate file ... but specify just one folder ?  I have not.  DBArtisan does not do that.   I have not come across any PC program that does that.  I thought you were having difficulty doing something which can be reasonably expected of PC software.  My apologies, Suggestion and all comments retracted.

Now if you decide that 100 x (2 clicks + 2 keystrokes) is not too much effort (I manage 1500 sprocs via DBArtisan), you can do them one at a time; the filename defaults to the sproc name; you need to choose the folder once, on the first Save.  

Of course, this task is a once-off; once you have your sprocs synched with your files, just keep them synched.  The alternative is to avoid storing the sprocs in files, and rely (for restoration purposes) on the database backup alone; there is no need to keep two backup copies.  When you cut a release, or need version control, you can multiple select all sprocs and store in one batch file, with a release/version name, in the same way that you would have all defaults in one file, all datatypes, in one file, etc.
0
 

Author Comment

by:rbhargaw
ID: 22684213
My apology, I guess, coz of one line, the whole Q&A went in different path.

 I needed them for version control as we need to specify the file name and tag # associated with them in the CM meetings, if changes are made in Stored procedures going forward.

So I did extract one by one all the procs as it should be one-off task and  closed the ticket but then we land up here :)
0
 
LVL 19

Expert Comment

by:grant300
ID: 22687541
DbArtisian is the wrong tool.

Get a copy of RapdiSQL Pro.  It has interfaces to several popular Source Code Control tools and has the ability to do the kind of file-by-file project control you need to do.

Regards,
Bill
0
 
LVL 6

Expert Comment

by:IncisiveOne
ID: 22695981
Or ddlgen (Sybase s/w delivered with Sybase)
Or SQLProgrammer (Faust)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Today’s effective marketing is about coming down to the customers’ level and engaging in a whole new way. A text message is one of the most effective and influential ways that you can engage your customers. Here are eight ways that you can utilize t…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question