I need to run update script on current database (ALTER DATABASE...), but can\'t use implicit its name. Is possible to use some function to get current db name and u
ALTER DATABASE...
You need to use something like
declare @dbname varchar(100) set @dbname=quotename(db_name()) exec('alter database '+@dbname+' ...');
or.. even simpler
set @sql='alter database '+quotename(db_name())+' ...'; exec(@sql)