voglio per raggiungere questo obiettivo:T-SQL: posso usare una variabile come un riferimento a un database
update @sourceDatabase.dbo.PredictedPrices
e quindi impostare @sourceDatabase
come variabile.
Ma non sono autorizzato?
Incorrect syntax near '.'.
C'è un altro modo?
non ha funzionato per questo: ESEGUI sp_executesql N'update @ sourceDatabase.dbo.PredictedPrices set MINPRICE = MINPRICE' – Michel
stesso errore: sintassi errata vicino a "." – Michel
@Michel - È necessario concatenare la stringa. Vedi la mia risposta per un esempio. –