Forum Discussion

Kiru_2024's avatar
Kiru_2024
Copper Contributor
Apr 15, 2024

Must declare even if I have already declared - what am i doing wrong?

Below is the script and its throwing "Must declare the scalar variable "@sql"." error.   EXEC sp_MSforeachdb ' IF OBJECT_ID(''tempdb..##FKConstraints'') IS NOT NULL     DROP TABLE ##FKConstraints...

Resources