August 10, 2018 at 1:31 pm
I need to copy some selected objects (tables, views, functions, stored procedures) from one DB (Order) to another DB (OrderHistory)
Which way can do this job?
Import and export only can do tables.
August 13, 2018 at 1:25 am
In Management Studio right click on your database then Tasks --> Generate Scripts. Post back if you have any problems.
Thanks
August 13, 2018 at 1:29 am
adonetok - Friday, August 10, 2018 1:31 PMI need to copy some selected objects (tables, views, functions, stored procedures) from one DB (Order) to another DB (OrderHistory)
Which way can do this job?
Import and export only can do tables.
Why not simply restore the Order database as OrderHistory?
😎
August 13, 2018 at 6:03 am
I'll also add that if you had proper source control running, this would be a cake walk. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
August 20, 2018 at 4:11 am
adonetok - Friday, August 10, 2018 1:31 PMI need to copy some selected objects (tables, views, functions, stored procedures) from one DB (Order) to another DB (OrderHistory)
Which way can do this job?
Import and export only can do tables.
You can also create Linked server in SQL server management studio to have connection between two server which can be later exploited for your requirement.
Reference Link :
https://www.sqlshack.com/how-to-create-and-configure-a-linked-server-in-sql-server-management-studio/
August 20, 2018 at 5:18 am
Someone told me that bcp will do it.
I'll learn it.
August 20, 2018 at 5:41 am
adonetok - Monday, August 20, 2018 5:18 AMSomeone told me that bcp will do it.
I'll learn it.
The Bulk Copy Program can help you with the data but not with the schemas and the objects.
😎
August 20, 2018 at 5:57 am
Is there any reason you're not able to use the other solutions that have been posted? They are pretty simple to implement.
Thanks
August 20, 2018 at 6:49 am
adonetok - Monday, August 20, 2018 5:18 AMSomeone told me that bcp will do it.
I'll learn it.
Eirikur is correct and you're not listening to the correct people. 😉 You COULD use BCP to export sys.SQL_Modules but that will only cover type P, RF, V, TR, FN, IF, TF, and R objects in the server. It will not handle table definitions and it misses several other worlds.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply