我有一个这样的 sql server pass-thru 查询:
*select * into myTable from openquery (yourComputer, 'select x,y,z, from yourTable')*
问题是 myTable 中的列默认不为空,我稍后会想在此表中添加一些列为空的行。
我可以绕过这个吗?
我有一个这样的 sql server pass-thru 查询:
*select * into myTable from openquery (yourComputer, 'select x,y,z, from yourTable')*
问题是 myTable 中的列默认不为空,我稍后会想在此表中添加一些列为空的行。
我可以绕过这个吗?
在插入数据之前创建 myTable,然后执行插入。
create table myTable (
x int null,
y int null,
z int null
)
go
insert into myTable (x, y, z)
select x, y, z
from openquery (yourComputer, 'select x,y,z, from yourTable')
您可以将结果插入临时表,然后更新表以将所有空值设置为'',然后将临时表中的值插入到实际表中