Solved

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

Posted on 2008-10-02
14
1,167 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
  • 6
  • 6
  • 2
14 Comments
 
LVL 19

Expert Comment

by:grant300
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:rbhargaw
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Increasing the point since the discussion will go furthur
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 6

Expert Comment

by:IncisiveOne
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Or ddlgen (Sybase s/w delivered with Sybase)
Or SQLProgrammer (Faust)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now