Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 What is the correct way to export tables

Author  Topic 

mark1504
Posting Yak Master

103 Posts

Posted - 2005-02-22 : 09:26:26
I have to move some tables from my online DB to another server/ISP. I've offered to use Enterprise Manager to export-import tables, and have done similar things before without a problem. But the customer's ISP can't/won't give me access to their DB so I can't use Enterprise Manager or QA.

So what is the correct format (and etiquette) for giving them their data tables in this situation?

And what about Stored Procedures? I have a script file with these in so I guess I can give that to them and let them create the SP's from that.

Any advice would be appreciated.

Thanks
Mark

nr
SQLTeam MVY

12543 Posts

Posted - 2005-02-22 : 11:13:02
Easiest way is to use bcp to export the data to a text file and to generate a script of the tables.
Send them the files and tell them to run the scripts and then bcp in the data (you can give them a osql batch to do it if necessary).
Be careful about the export format - if you let them do the bcp in you will have to tell them the format. Simplest is native format but you will have to say whether you use -N or -n - and make sure the collation is the same.

SPs - yes just give them a script file.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

mark1504
Posting Yak Master

103 Posts

Posted - 2005-02-24 : 09:55:38
Hi
Thanks for that. For reasons I don't understand, they cannot use Bulk Import. I've sent them scripts and text files as per your suggestion.

Now they are saying (via second hand knowledge!) that one can have structure and data in the same script file. I haven't come across that before, and haven't been able to find such a feature in Enterprise Manager or Query Analyzer.
Has anybody heard of this? Or have they been misled?
Thanks
Mark
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2005-02-24 : 10:56:32
You can put insert statements in the script file.
Have a look at
http://www.mindsdoor.net/SQLTsql/sp_CreateDataLoadScript.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

mark1504
Posting Yak Master

103 Posts

Posted - 2005-02-24 : 11:12:57
Thanks. I must admit I don't understand this script or how I use it. Is there any notes on this?

Nor do I see a script and data in the same file, which is what I've been asked for. Is it possible? Can Enterprise Manager or Query Analyzer produce such a thing?
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2005-02-24 : 12:20:50
That sp creates a load of insert statements which you can add to the file after the table create statement.

enterprise manager doesn't do it.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

mark1504
Posting Yak Master

103 Posts

Posted - 2005-02-24 : 14:16:40
Hi

Thanks, I've been trying out the SP, which is easy to run, but it didn't produce a usable file, as the tables were too 'wide', and with too much mixed text.

Anyway, it's not my problem anymore. If a user goes to a host that doesn't allow direct DB access via EM and QA, that's his own fault!

Many thanks for your interest in my issue.
Regards
Mark

Go to Top of Page
   

- Advertisement -