Put variables in VALUES clause when expanding INSERT statement
You type in an insert statement. " Insert into dbo.Party" and then press tab. The below code is generated
INSERT INTO Party
(
PartyTypeId,
TenantId
)
VALUES
(
0 /* PartyTypeId - INT NOT NULL /,
0 / TenantId - BIGINT */
)
Because most of the inserts, updates etc are mostly used inside stored procedures, and the values come from variables, I would like it to show :
INSERT INTO Party
(
PartyTypeId,
TenantId
)
VALUES
(
@PartyId /* INT NOT NULL /,
@TenantId / BIGINT */
)
An updated statement will do the following snippet :
UPDATE Party
SET
PartyTypeId = @PartyTypeId,
TenantId = @TenantId
WHERE Id = @Id
An Add stored procedure based on a specific Table will show the following
Create Procedure PartyAdd
@PartyId INT,
@TenantId BIGINT = NULL
@Id INT OUT
AS
An Update Stored Procedure will show the following.
Create Procedure PartyUpdate
@Id INT,
@PartyTypeId INT,
@TenantId BIGINT = NULL
As