在SQL 的查询器里 你一次性执行
declare @Key sysname
select @Key=c.name from syscolumns a,sysconstraints b,sysobjects c where a.id=object_id('a') and a.name='a' and a.id=b.id and b.constid=c.id and c.name like 'PK%'
exec sp_fulltext_table 'dali','create','My_FullDir',@Key
如果你先执行
declare @Key sysname
select @Key=c.name from syscolumns a,sysconstraints b,sysobjects c where a.id=object_id('a') and a.name='a' and a.id=b.id and b.constid=c.id and c.name like 'PK%'
再执行
exec sp_fulltext_table 'dali','create','My_FullDir',@Key
时,报错:
select @Key=c.name from syscolumns a,sysconstraints b,sysobjects c where a.id=object_id('a') and a.name='a' and a.id=b.id and b.constid=c.id and c.name like 'PK%'
1: select @Key=c.name from syscolumns a,sysconstraints b,sysobjects c where a.id=object_id('a') and a.name='a' and a.id=b.id and b.constid=c.id and c.name like 'PK%'