Hi,
I need to be able to set the database name used within a stored procedure by passing a parameter at run time. I know how to pass a parameter normally but I seem to be a bit stuck on this one.
Here is an illustration of how i thought it would work.
create procedure [dbo].[sp_Lock]
@dbExt varchar(10)
Update MyDb_ + @dbExt +.dbo.myTable
set myValue = 1
go
Unfortunately, it doesn't like the syntax that i put in.
Any Ideas?
Regards,
Noel.
I need to be able to set the database name used within a stored procedure by passing a parameter at run time. I know how to pass a parameter normally but I seem to be a bit stuck on this one.
Here is an illustration of how i thought it would work.
create procedure [dbo].[sp_Lock]
@dbExt varchar(10)
Update MyDb_ + @dbExt +.dbo.myTable
set myValue = 1
go
Unfortunately, it doesn't like the syntax that i put in.
Any Ideas?
Regards,
Noel.