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.
blossomparkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lcohanDatabase AnalystCommented:
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
0
blossomparkAuthor Commented:
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
0
lcohanDatabase AnalystCommented:
Unfortunately since first major rewrite of SQL (version 2000) that (very usefull) piece of functionality to selectively backup objects was taken away which means in current versions to date these options are the two easiest/quickest available that I can think off even though they most likely would get lots of unchanged(and not needed to be saved in this particular case) objects.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

blossomparkAuthor Commented:
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
0
blossomparkAuthor Commented:
I have only dbo access, this does not allow me to use the copy database wizard fully I believe
0
lcohanDatabase AnalystCommented:
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
0
blossomparkAuthor Commented:
Hi Icohan, I backed up the objects individually as this proved to be the quickest under the circumstances....thanks for your input
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.