--查询nvarchar(max)的表和字段 select 'insert into #tempTabelInfo select '''+d.name+''', '''+a.name+''', max(len('+a.name+')) as '+d.name+'的'+a.name+' from '+d.name+' with(nolock) ' , d.name as tabelname,a.name,b.name FROM syscolumns a, systypes b,sysobject…