摘要:
DECLARE@SQLVARCHAR(5000)DECLARE@db1VARCHAR(100)DECLARE@db2VARCHAR(100)SET@db1='cpho_dev'SET@db2='cpho_test'SET@SQL='SELECTmaintb.TBNAMEas'+@db1+'TableName,maintb.nameas'+@db1+'colName,comtb.TBNAMEas'+... 阅读全文
摘要:
--如果表结构比较少直接用sql语句拼接即可:DECLARE@SqlStringVARCHAR(8000)SET@SqlString='';SELECT@SqlString=@SqlString+'ALTERTABLE'+s.[name]+'NOCHECKCONSTRAINTALL;'FROMsysobjectsASsWHEREs.[type]='U'SELECT@SqlStringEXEC(@S... 阅读全文