|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
URGENT: Replication via T-SQLI need to transfer a database from MSDE to SQL Server. I can use T-SQL to detach a database, copy the .mdf and .ldf files to another server and re-attach them there, but I do not want to use the Import and Export Data (via Enterprise Manager) if possible. I need this to be as easy as possible, using a T-SQL script preferably. Also, this is possibly a live system so that detatching the database may not be an option. For this reason, I would like to import data. This is the situation: SQLSERVER (IP: 10.0.0.1, using mixed authentication) MSDESERVER (IP: 10.0.0.2, using sql server authentication, 'sa' with password 'xxx') MSDESERVER contains the data to be transferred to SQLSERVER I wish to go into SQL SERVER, perform T-SQL from there to IMPORT all data FROM MSDESERVER (not a problem if I copy tables, views and triggers too, but data only would be sufficient since the database structure already exists on SQL_SERVER.) Is this possible using T-SQL only? If not, what is the easiest way to transfer data? There are many ways using import wizard, with lots of options, which makes it too complex. Currently the most easy way seems to be detach the database, copy files and reattach them, but I prefer to do it 'live', and not risking losing data at the source. Lisa If you want to do this One time - May be you can just do the backup &
restore if you like to access the MSDE database through TSQL, How about Linked Server then query the MSDE database through TSQL. -regards, Sarav... Show quote "Lisa Pearlson" <no@spam.plz> wrote in message news:OrSG3EwVFHA.1044@TK2MSFTNGP10.phx.gbl... > Hi, > > I need to transfer a database from MSDE to SQL Server. > I can use T-SQL to detach a database, copy the .mdf and .ldf files to > another server and re-attach them there, but I do not want to use the > Import and Export Data (via Enterprise Manager) if possible. > I need this to be as easy as possible, using a T-SQL script preferably. > Also, this is possibly a live system so that detatching the database may > not be an option. > > For this reason, I would like to import data. > > This is the situation: > > SQLSERVER (IP: 10.0.0.1, using mixed authentication) > MSDESERVER (IP: 10.0.0.2, using sql server authentication, 'sa' with > password 'xxx') > > MSDESERVER contains the data to be transferred to SQLSERVER > > I wish to go into SQL SERVER, perform T-SQL from there to IMPORT all data > FROM MSDESERVER (not a problem if I copy tables, views and triggers too, > but data only would be sufficient since the database structure already > exists on SQL_SERVER.) > > Is this possible using T-SQL only? > If not, what is the easiest way to transfer data? There are many ways > using import wizard, with lots of options, which makes it too complex. > Currently the most easy way seems to be detach the database, copy files > and reattach them, but I prefer to do it 'live', and not risking losing > data at the source. > > Lisa > How do I link server?
Would that allow me to do stuff like INSERT INTO [newserver].newdatabase.dbo.sometable SELECT * FROM [oldserver].olddatabase.dbo.sometable ? Lisa Show quote "Sarav" <sa***@sqlservertips.com> wrote in message news:u1iwXXwVFHA.3716@TK2MSFTNGP12.phx.gbl... > If you want to do this One time - May be you can just do the backup & > restore > > if you like to access the MSDE database through TSQL, How about Linked > Server then query the MSDE database through TSQL. > > -regards, > Sarav... > > "Lisa Pearlson" <no@spam.plz> wrote in message > news:OrSG3EwVFHA.1044@TK2MSFTNGP10.phx.gbl... >> Hi, >> >> I need to transfer a database from MSDE to SQL Server. >> I can use T-SQL to detach a database, copy the .mdf and .ldf files to >> another server and re-attach them there, but I do not want to use the >> Import and Export Data (via Enterprise Manager) if possible. >> I need this to be as easy as possible, using a T-SQL script preferably. >> Also, this is possibly a live system so that detatching the database may >> not be an option. >> >> For this reason, I would like to import data. >> >> This is the situation: >> >> SQLSERVER (IP: 10.0.0.1, using mixed authentication) >> MSDESERVER (IP: 10.0.0.2, using sql server authentication, 'sa' with >> password 'xxx') >> >> MSDESERVER contains the data to be transferred to SQLSERVER >> >> I wish to go into SQL SERVER, perform T-SQL from there to IMPORT all data >> FROM MSDESERVER (not a problem if I copy tables, views and triggers too, >> but data only would be sufficient since the database structure already >> exists on SQL_SERVER.) >> >> Is this possible using T-SQL only? >> If not, what is the easiest way to transfer data? There are many ways >> using import wizard, with lots of options, which makes it too complex. >> Currently the most easy way seems to be detach the database, copy files >> and reattach them, but I prefer to do it 'live', and not risking losing >> data at the source. >> >> Lisa >> > > Please Read the BookOnline Section
>Administering SQL Server You will create the Linked server at the New server for Old server.>>> Managing Servers >>>>> Configuring Linked Servers after creating the linked server you can query the old server database from new server like Select * from [old Server].Pubs.dbo.Employee regards, Sarav... Show quote "Lisa Pearlson" <no@spam.plz> wrote in message news:uUbvoDxVFHA.3584@TK2MSFTNGP10.phx.gbl... > How do I link server? > > Would that allow me to do stuff like > > INSERT INTO [newserver].newdatabase.dbo.sometable > SELECT * FROM [oldserver].olddatabase.dbo.sometable > > ? > > Lisa > > "Sarav" <sa***@sqlservertips.com> wrote in message > news:u1iwXXwVFHA.3716@TK2MSFTNGP12.phx.gbl... >> If you want to do this One time - May be you can just do the backup & >> restore >> >> if you like to access the MSDE database through TSQL, How about Linked >> Server then query the MSDE database through TSQL. >> >> -regards, >> Sarav... >> >> "Lisa Pearlson" <no@spam.plz> wrote in message >> news:OrSG3EwVFHA.1044@TK2MSFTNGP10.phx.gbl... >>> Hi, >>> >>> I need to transfer a database from MSDE to SQL Server. >>> I can use T-SQL to detach a database, copy the .mdf and .ldf files to >>> another server and re-attach them there, but I do not want to use the >>> Import and Export Data (via Enterprise Manager) if possible. >>> I need this to be as easy as possible, using a T-SQL script preferably. >>> Also, this is possibly a live system so that detatching the database may >>> not be an option. >>> >>> For this reason, I would like to import data. >>> >>> This is the situation: >>> >>> SQLSERVER (IP: 10.0.0.1, using mixed authentication) >>> MSDESERVER (IP: 10.0.0.2, using sql server authentication, 'sa' with >>> password 'xxx') >>> >>> MSDESERVER contains the data to be transferred to SQLSERVER >>> >>> I wish to go into SQL SERVER, perform T-SQL from there to IMPORT all >>> data FROM MSDESERVER (not a problem if I copy tables, views and triggers >>> too, but data only would be sufficient since the database structure >>> already exists on SQL_SERVER.) >>> >>> Is this possible using T-SQL only? >>> If not, what is the easiest way to transfer data? There are many ways >>> using import wizard, with lots of options, which makes it too complex. >>> Currently the most easy way seems to be detach the database, copy files >>> and reattach them, but I prefer to do it 'live', and not risking losing >>> data at the source. >>> >>> Lisa >>> >> >> > > Try www.sqlscripter.com to do this.
Thomas Show quote "Lisa Pearlson" wrote: > Hi, > > I need to transfer a database from MSDE to SQL Server. > I can use T-SQL to detach a database, copy the .mdf and .ldf files to > another server and re-attach them there, but I do not want to use the Import > and Export Data (via Enterprise Manager) if possible. > I need this to be as easy as possible, using a T-SQL script preferably. > Also, this is possibly a live system so that detatching the database may not > be an option. > > For this reason, I would like to import data. > > This is the situation: > > SQLSERVER (IP: 10.0.0.1, using mixed authentication) > MSDESERVER (IP: 10.0.0.2, using sql server authentication, 'sa' with > password 'xxx') > > MSDESERVER contains the data to be transferred to SQLSERVER > > I wish to go into SQL SERVER, perform T-SQL from there to IMPORT all data > FROM MSDESERVER (not a problem if I copy tables, views and triggers too, but > data only would be sufficient since the database structure already exists on > SQL_SERVER.) > > Is this possible using T-SQL only? > If not, what is the easiest way to transfer data? There are many ways using > import wizard, with lots of options, which makes it too complex. Currently > the most easy way seems to be detach the database, copy files and reattach > them, but I prefer to do it 'live', and not risking losing data at the > source. > > Lisa > > > |
|||||||||||||||||||||||