Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfer Tables, Stored Procedures & UFS to a folder 1

Status
Not open for further replies.

Efa

Programmer
Jul 9, 2001
18
0
0
AU
Hello

Just wondering if anyone can help me with a problem.
I have created my own database called EfaDB. I have my own stored procedures, tables and user defined functions etc in it.
Basically i need to know is it possible to copy these tables, SPs, UDFs etc to a folder so i can pass on to a different computer on the same network.

I know about the import/ export utility but they go directly to another database. I just want to store it in a folder and allow other computers to choose which procedures tables etc they need.

Cheers

Efa
 

You can generate scripts from Enterprise Manager and store them in a folder. These scripts could then be used to create objects in another database. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
 
You could just copy the UDF's, Stored Procs and Tables into notepad thus creatin the scripts in ntepad format and if you want to also pass on the table data you can use the export wizard and select Text File as the data source Billy H

bhogar@acxiom.co.uk
 
I followed tlbroadbent's instruction by generating the scripts from the Enterprise Manager and put them in a folder. The only problem is taking them from the folder and putting them into my new database. I have at least 60 stored procedures, udfs and about 30 tables.

Just wondering if there is a faster way of copying these files into my new database.

At the moment the only way i can do so is if i copy what is in my invividual file create a new stored procedure and paste in the info.

Is there a faster way to do this as opposed to copy and pasting?

Cheers again

Efa
 

You could use the OSQL command line utility to execute the script(s).

osql /S Servername /U username /P password /i createobj.sql

Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
 
I tried using the osql command line utility but had probs with it as i've never used it before.

I wrote:

C:\>osql /S Aoife /U sa /P myPassword
e:/table/tables/dbo.ActiveCampaigns.TAB

it returned this:

1> 2> 3> 1> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 1> 2> 3>

I'm not quite sure about osql's purpose for what i'm trying to do.
All i really want to do is find a quicker way of creating new stored procedures, udf's etc. without having to go

New Stored Procedure>Paste in text from the script i have previously generated.

Any ideas would be so appreciated.

Cheers

Efa

 

[ol][li]You forgot the /i option to identify the input file.
[li]Does e:/table/tables/dbo.ActiveCampaigns.TAB contain SQL statements or data? The purpose of OSQL is to run SQL statements, not insert data from a text file.
[li]Are you intending to transfer object definitions (schema) and data to the other database?[/ol] Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
 
Sorry about that must have deleted /i by accident when i wrote it in my post. It was included in my osql execution.

My ActiveCampaign file does contain sql statements.

What i want to happen is for this sql file to be added to my stored procedures in my other database from the folder where i put my generated scripts.

Cheers again

Efa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top