|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How To Move A Database TableI want to SELECT data from one database table and INSERT it to another
table on a second SQL Server in C# ADO.NET. Where can I find information on how to do this? JLuv wrote:
> I want to SELECT data from one database table and INSERT it to another Create a linked server on Server A that points to Server B, then execute > table on a second SQL Server in C# ADO.NET. Where can I find > information on how to do this? > the following on Server A: SELECT * INTO ServerB.dbname.dbo.tablename FROM dbname.dbo.tablename Tracy McKibben wrote:
> JLuv wrote: Thanks for the linked server idea. It worked like a charm. I didn't use> > I want to SELECT data from one database table and INSERT it to another > > table on a second SQL Server in C# ADO.NET. Where can I find > > information on how to do this? > > > > Create a linked server on Server A that points to Server B, then execute > the following on Server A: > > SELECT * > INTO ServerB.dbname.dbo.tablename > FROM dbname.dbo.tablename that example as is, I had to use OPENQUERY() like this... INSERT INTO databaseA.dbo.myTable (firstName, lastName) SELECT firstName, lastName FROM OPENQUERY(SERVERB, 'SELECT firstName, lastName FROM databaseB.dbo.directory') |
|||||||||||||||||||||||