Hi team,
I have one query regarding dynamic database.
I put database name in one variable and i want to pass that variable in place of (elcm_mahsqa) , how to pass that variable i tried but it throws error.
Please suggest solution.
SET @dbname=@OrganizationName
select 'ELCM_'+ @dbname '@dbname'
---------------------------------------employee id -------------------------------------------
set @EmpCode=(Select distinct(empcode) as empcode from elcm_mahsqa.tna.rostering where EmpCode=@EmpCode )
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Manish KumarRank #1,622 · 956 reputationPosted Nov 15, 2017, 9:38 PM EST
krunal pande103 reputationPosted Nov 15, 2017, 11:03 PM EST
Manish KumarRank #1,622 · 956 reputationPosted Nov 16, 2017, 12:12 AM EST