Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to copy database one server to another server?

Author  Topic 

rudba
Constraint Violating Yak Guru

415 Posts

Posted - 2010-02-11 : 12:46:24
How do we copy database from one sql server to another sql server including (table,view,stored procedure.. with data)

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-11 : 12:46:59
take a backup and restore into new server

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

rudba
Constraint Violating Yak Guru

415 Posts

Posted - 2010-02-11 : 12:49:43
Thanks for quick response. Actually, i can't do that because i have db on sql server 2008 and i have to restore on sql 2005. It does not support, any idea?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-11 : 12:53:32
then try this

http://blog.sqlauthority.com/2009/07/29/sql-server-2008-copy-database-with-data-generate-t-sql-for-inserting-data-from-one-table-to-another-table/

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-11 : 12:59:57
Might be a big script! Impressive feature (scripting data) of SQL 2008 though ... didn't know that one, thanks Visakh.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-11 : 13:07:03
quote:
Originally posted by Kristen

Might be a big script! Impressive feature (scripting data) of SQL 2008 though ... didn't know that one, thanks Visakh.


You're welcome Kristen

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

rudba
Constraint Violating Yak Guru

415 Posts

Posted - 2010-02-11 : 13:12:47
Thanks. I will use script for import data if i have big database.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-11 : 13:24:33
"I will use script for import data if i have big database"

Actually, if you have a BIG database you may need to use a different method - e.g. Script database DDL in SQL 2008, crate the database in SQL 2005 and create the DDL objects (tables, etc. but EXCLUDING foreign keys)

Transfer the data (using SSIS or BCP etc.) from SQL 2008 to SQL 2005

Create the FKeys on SQL 2005
Go to Top of Page
   

- Advertisement -