Link to home
Start Free TrialLog in
Avatar of blossompark
blossomparkFlag for Ireland

asked on

making back up copy of sql server tables to include data and all associated table objects

Hi,
I’ve made some changes to some SQL Server objects, tables,views, stored procedures, functions etc in my test environment which I now want to move to the production environment.
I want to make backups of the existing objects in production, eg Production_Table_1 as Production_Table_1_backUp.
I’m looking for the easiest way to make a copy of the table in its existing database, and the copy to include all associated indexes,constraints, data etc…
I looked at Transfer SQL Server Object Tasks in SSIS but it doesn’t seem to allow altering the object name.
I’m now looking at using  the “Script Table as” option in Management studio but it doesn’t seem to copy indexes.
Any guidance appreciated.
Avatar of lcohan
lcohan
Flag of Canada image

You could use COPY database or FULL database BACKUP and RESTORE for that matter:

https://docs.microsoft.com/en-us/sql/relational-databases/databases/use-the-copy-database-wizard?view=sql-server-2014
Avatar of blossompark

ASKER

thank you for that Icohan, as I am only changing a few objects I thought of backing them up individually, but this makes sense too, will look into this and get back to you
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada 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
The Copy Database wizard is not allowing me to create user tables....it creates system tables, system views etc., but no user tables or user views.
it writes to a log...but i cannot access the log file as it is on a server that i do not have access to
I have only dbo access, this does not allow me to use the copy database wizard fully I believe
in that case your options are to ask for elevated permissions or ask for someone that has that to COPY DATABASE for you or go back to and re-do the SSIS and please see here how you can select what needs to be copied from source to target for each table as it is more than just the indexes you want to bring accross - PKeys, FKeys, Constraints, defaults, ETC...

http://www.kodyaz.com/articles/transfer-sql-server-objects-task.aspx
Hi Icohan, I backed up the objects individually as this proved to be the quickest under the circumstances....thanks for your input