select @dbName="DBNAME"
select Distributorid from [180.552.528.854,21414].[@dbName].DBO.DistributorMaster where Distributorid =XXXXXX
ERROR: The OLE DB provider "SQLNCLI10" for linked server[180.552.528.854,21414] does not contain the table ""@dbName"."DBO"."DistributorMaster"". The table either does not exist or the current user does not have permissions on that table.在SQL Server鏈接連接
'聲明@dbName varchar(50)='DBNAME';'聲明本地變量 – Viki888
僅限動態SQL。 –
已經宣佈 – SANJOG