Inter-database operation

xiaoxiao2021-03-06  90

- Create a link server EXEC SP_ADDLINKEDSERVER 'LINKNAME', '', 'SQLOLEDB', 'Remote Server Name or IP Address' Exec Sp_addlinkedsrvlogin' LinkName ',' False ', Null,' User Name, 'Password' Go

Select * from linkname. Database name. dbo. Table name

SELECT * INTO Table from linkname. Database name .dbo. Table name

GoExec sp_dropserver 'linkname', 'droplogins'select * from openrowset (' sqloledb ',' sql server name); 'username'; 'password', database name. dbo. Table name)

- Importing Example Select * INTO Table from OpenRowSet ('Sqloledb', 'SQL Server Name;' User Name; 'Password', Database Name .DBO. Table Name)

转载请注明原文地址:https://www.9cbs.com/read-105514.html

New Post(0)