Link to home
Start Free TrialLog in
Avatar of anushahanna
anushahannaFlag for United States of America

asked on

script out a list of tables/procs

I have a list of tables and Stored Procs I want to move from One server to another. Is it possible to pass the list of tablenames and Stored procs and just pull out a script to run in the new server?

Thanks
Avatar of anushahanna
anushahanna
Flag of United States of America image

ASKER

Just wanted to explain more clearly..

The tables and procs do not exist in the second server.

As an example, Database1 in Server1 may have 200 tables, and Database1 in Server2 has only 160 tables. I can generate the list of the remaining 40 tables and I would like to create a script with the 'create table ' scripts.. Likewise with the Stored Procs also..

thanks
Avatar of fhillyer1
fhillyer1

have you considered backing up on the first server and then restoring on the secong one?
i dont know if the data on the second server can be replaced, or you just want the structure with no data?
ASKER CERTIFIED SOLUTION
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
IF this is SQL Server, couldn't you simply use the SQL Server Import Export wizard?

http://www.aspfree.com/c/a/MS-SQL-Server/SQL-2000-Data-Transfer-is-a-Snap-with-SQL-2005/

OR

Backup Database1 and Restore the backup file to Database2?
backup & restore will not work. Server1's DB has data, but Server2's DB has another set of data, but should have same structure. Hence SSIS also will not work.

If I use Generate Scripts Wizard, it does not help to just choose those 40 tables, even if I can selected them, can I?

so, apart from 3rd party tools, what I need to get done is not possible with inbuilt tools, right?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial