Copying Database From One SQL Server to Another -
greetings.
we running microsoft sql server 2008 on 1 machine single license. need create identical development instance of database held on server, including tables, triggers, default values, data, views, keys, constraints , indexes.
as temporary solution, downloaded , installed sql server 2008 express r2 along sql server 2008 toolkit on separate machine. used dtswizard.exe , pointed @ remote host data source , local machine target.
transfer of data @ first appeared fine tables, indexes, etc. created after little more digging, realized not transferring/setting default values of fields! many of fields have "not null" constraints , we're interfacing com api (response rck) not allow manually edit queries we're stuck how have interface database/insert entries (including use of default values circumventing not null constraints.)
as second option used "generate script" option , exported tables, constraints, indexes, default values, data, etc .sql file i'm not sure how load sql file sql server because 4.9gb - of required, no circumventing size of monster.
so questions are: - there way can make complete copy of sql database server including default values? - or there way import .sql file without copying , pasting new query?
p.s: apologize if "microsoft" lingo not perfect, i'm linux guy familiar postgresql , mysql.
why not take complete backup of database , restore new server? include including default values?
here sql should make happen (edit paths , logical file names fit needs):
-- on source server run: backup database [testdb] disk = n'c:\temp\testdb.bak' noformat, noinit, name = n'sourcedb-full database backup', skip, norewind, nounload, stats = 10 go -- on other server run restore database [destdb] disk = n'c:\temp\testdb.bak' file = 1, move n'testdb' n'c:\temp\destdb_data.mdf', move n'testdb_log' n'c:\temp\destdb_log.ldf', nounload, stats = 10 go
and need move backup file between servers if not accessible on network...
Comments
Post a Comment