如何通过其 Database.Owner.Name 完整目录名称更改全文目录?
declare @db_name sysname;
declare db cursor for
select name from sys.Databases where name like 'myprefix%'
open db
fetch next from db into @db_name
while @@fetch_status = 0
begin
set @sql = 'ALTER FULLTEXT CATALOG [' + @db_name + '].dbo.IndexedContent REBUILD'
exec sp_executesql @sql
fetch next from db into @db_name
end
close db;
deallocate db;
但 SQL Server 抱怨
Incorrect syntax near '.'
http://msdn.microsoft.com/en-us/library/ms176095.aspx上的文档没有明确指定catalog_name 是否可以完全限定。