Last post May 31, 2015 12:43 PM by Rion Williams
May 31, 2015 10:41 AM|mike4u|LINK
sql server 2012
I have taken backup of a table in script file. Now i want to restore it in another db. so how to do it.
May 31, 2015 12:31 PM|Rion Williams|LINK
If you scripted out the table whenever you backed it up, you should be able to execute your existing script targeting your new database to create the table (I believe that this would be creating a script using something like "SCRIPT AS CREATE" within SQL
Server Management Studio. I believe the instructions should be similar to the following
found here :
Click your way through the remaining screens and you're done. After doing this, you would then use the drop-down within SQL Server Management Studio to select the context / database that you wanted to execute the CREATE script against. Then create a new
query, copy in your script, execute it and that should create your table.
It's important to distinguish a script from a backup because if you have a backup of a database you would need to restore the database itself and then copy the table over after the restore was completed.
May 31, 2015 12:37 PM|mike4u|LINK
rion i already did this.I have the script now.
now i want to add this table in another database. so how to do it.
thats what i am asking.
May 31, 2015 12:43 PM|Rion Williams|LINK
Are you using SQL Server Management Studio?
If so, you should see a drop-down box along the toolbar, which defaults at "master". This drop down is used to determine the database that any queries are executed against, so what you would want to do is :
You should see some type of output indicating if the query was executed successfully, and if so, you can refresh your databases area (Right-click > Refresh) to see the changes take effect.