Hi!
I need to pass the name of the DB as a parameter from a stored proc to another, but for some reason I can't get it to work.
When I run the code below, the string 'db_name' is passed, not the database name. It seems SQL server converts
to 'db_name'. Any ideas?
When I try to print
instead of passing it, I get the following error message:
"The name 'db_name' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted."
I need to pass the name of the DB as a parameter from a stored proc to another, but for some reason I can't get it to work.
When I run the code below, the string 'db_name' is passed, not the database name. It seems SQL server converts
Code:
db_name
Code:
EXEC dbo.usp_Logout db_name
When I try to print
Code:
db_name
"The name 'db_name' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted."