I have a database project for SQL Server 2016. In the project properties, SQLCMD Variables tab:
Variable: $(SOURCE)
Value: MyDB
All I want to do for now is PRINT that variable.
CREATE PROCEDURE [dbo].[usp_Test]
AS
SET NOCOUNT ON;
PRINT [$(SOURCE)]
RETURN 0
The project builds, I do a schema compare, then attempt to update and I get this error:
The name "MyDB" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
Is there a way I can print the SQLCMD variables I've set up when running a stored procedure?
I havent done much with this, but i have the following in one of my scripts and it works fine:
:setvar path "Variable"
PRINT '$(path)'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With