declare @n varchar(30)
declare @key varchar(20)
set @key='關鍵字'
declare cur cursor for
select a.name from syscolumns a inner join systypes b on a.id=b.id where id=object_id('表') and b.name in('varchar','char','nvarchar','nchar','sysname')
fetch next from cur into @n
while @@fetch_status=0
begin
if exists(select 1 from [表] where charindex(@key,@n)>0)
print @n +'中存在!'
fetch next from cur into @n
endclose cur
deallocate
怎樣獲取乙個表中所有欄位的資訊
先建立乙個檢視 create view fielddesc asselect o.name as table name,c.name as field name,t.name as type,c.length as length,c.isnullable as isnullable,convert ...
怎樣獲取乙個表中所有欄位的資訊
先建立乙個檢視 create view fielddesc asselect o.name as table name,c.name as field name,t.name as type,c.length as length,c.isnullable as isnullable,convert ...
怎樣獲取乙個表中所有欄位的資訊
先建立乙個檢視 create view fielddesc asselect o.name as table name,c.name as field name,t.name as type,c.length as length,c.isnullable as isnullable,convert ...