SQL: Copy Database one table to another database in SELECT* into table 1 from table 2--Copy Table 2 If you copy only the structure without copying the content or just a column, just add the Where condition. Example: SELECT*into [imcdb]. [dbo]. [SysLog] from [Aimmanagedb]. [dbo]. [Syslog] (copy syslog tables from database aimmanagedb to database imcdb) replicate tables across serversSelect* into [SMSDB]. [dbo]. [SysLog] From OPENROWSET ('SQLOLEDB', ' Target server ';'Account Number';'Password', [Smsdb]. [dbo]. [SysLog]) (Copy the Syslog table from the database target server to the local database smsdb) eg: if the following error occurs: (SQL Server blocked the component'Ad Hoc Distributed Queries'The STATEMENT'Openrowset/opendatasource'access, because this component has been shut down as part of this server's security configuration. System administrators can enable by using sp_configure'Ad Hoc Distributed Queries'。 About enabling'Ad Hoc Distributed Queries'For more information, see the SQL Server Books Online"Perimeter Application Configurator". WORKAROUND: Enable ad Hoc distributed queries:exec sp_configure'Show advanced Options',1Reconfigure exec sp_configure'Ad Hoc Distributed Queries',1reconfigure close the ad HOC distributed queries:exec after use is complete sp_configure'Ad Hoc Distributed Queries',0Reconfigure exec sp_configure'Show advanced Options',0Reconfigure --8- -Other Import MethodsSelect* fromtable1 into table2 table2 must not exist insert into table2Select* fromTable1 table2 must exist
[SQL] Copy Database one table to another database