I want to port data from one server\'s database to another server\'s database. The databases are both on a different mssql 2005 server. Replication is probably not an option sin
You can use Open Data Source Like this :
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE
GO
SELECT *
FROM OPENDATASOURCE('SQLOLEDB',
'Data Source=<Ip Of Your Server>;
User ID=<SQL User Name>;Password=<SQL password>').<DataBase name>.<SchemaName>.<Table Or View Name>
Go
You could go the linked server route.
you just can't use the select * into you have to do an insert into select.
I would avoid replication if you don't have experience with it as it can be difficult to fix if it breaks and can be prone to other problems if not properly managed.
Keep it simple especially if the databases are small.
Well I don't agree with your comment on replication. You can start a replication by creating a database from scratch, and you can control either the updates will be done by updating the available client database or simply recreating the database.
Automated replication will ease your work by automatically managing keys and relations.
I think the easiest thing to do is to start a snapshot replication through MSSQL Server Studio, get the T-SQL corresponding scripts (ie the corresponding T-SQL instructions for both publication and subscriptions), and record these scripts as part of a job in the Jobs list of the SQL Agent or as a replication job in the replications folder.
I think what you want to do is create a linked server as per this msdn article. You would then select using a 4 part object name eg:
Select * From ServerName.DbName.SchemaName.TableName
Can you use the Data Transformation Services to do the job? This provides all sorts of bolt-together tools for doing this kind of thing.
You can download the SQL Server 2005 feature pack from Microsoft's website here
CREATE VIEW newR1
AS
SELECT * from OPENQUERY ([INSTANCE_NAME], 'select * from DbName.SchemaName.TableName')