How to get Database name of a specific Database in a stored procedure.
To get the current database name use select db_name()
.
DB_NAME(Transact-SQL)
or
select name from sys.sysdatabases
where dbid=db_id()
or
select DB_NAME(db_id())
How to get Database name of a specific Database in a stored procedure.
To get the current database name use select db_name()
.
DB_NAME(Transact-SQL)
or
select name from sys.sysdatabases
where dbid=db_id()
or
select DB_NAME(db_id())
精彩评论