解決localdb中文智慧的問題

szjay發表於2018-02-07

declare @database nvarchar(100)
declare tmpCur cursor for
select DB_NAME()
open tmpCur
fetch next from tmpCur into @database
declare @sql nvarchar(500)
select @sql='alter database ['+@database+'] set single_user with rollback immediate'
exec(@sql)
select @sql= 'alter database ['+@database+'] collate Chinese_PRC_CS_AS'
exec(@sql)
select @sql= 'alter database ['+@database+'] set multi_user'
exec(@sql)
close tmpCur
deallocate tmpCur

相關文章