sql2005数据导出方法(使用存储过程导出数据为脚本)

2020-07-10 08:11:00易采站长站整理


else @name end


end


end


fetch next from syscolumns_cursor into @name,@xtype


end


close syscolumns_cursor


deallocate syscolumns_cursor


set @sql=’set nocount on select ”insert ‘+@tablename+'(‘+@column+’) values(”as ”–”,’+@columndata+’,”)” from ‘+@tablename


print ‘–‘+@sql


exec(@sql)


if @ident is not null


print ‘SET IDENTITY_INSERT ‘+@TableName+’ OFF’

相关文章 大家在看