I need the "create table... " statement for a particular table and stored procedure to recreate them in another database. Forget the backup and restore. I have to do it in vb6. Its the same thing you get when you copy the Table And paste it in query analyzer. Its sql server 2000 Edit: Now I Know it can be asked as 'How To Script Entire Database Through VB6'.
Asked
Active
Viewed 888 times
1 Answers
1
Take a look at this StackOverlow post which talks about the same. Although it is not VB6-specific, you should be able to apply this solution without a problem.
Essentially you create a stored procedure that will generate the CREATE TABLE
statement for the given table. The stored procedure will examine the sysobjects
table to build the SQL.
Your VB6 application can run the stored procedure on server 'A' fetching the CREATE TABLE
SQL. Then connect to server 'B' and run that SQL to create the table on the other server.

Community
- 1
- 1

Dave Michener
- 1,058
- 11
- 30