Automatically create variables for use with generating full INSERT statements
Currently the behavior for inserting a full INSERT statement is that it produces something like this:
INSERT INTO dbo.ContactPictures
( InterActionPersonalContactID ,
InterActionFirmContactID ,
ImageFileStoreFilePathSegment ,
Source ,
ManuallyCreatedByUserAccountName ,
DateTimeLastUpdated
)
VALUES ( 0 , -- InterActionPersonalContactID - int
0 , -- InterActionFirmContactID - int
'' , -- ImageFileStoreFilePathSegment - varchar(256)
'' , -- Source - varchar(20)
N'' , -- ManuallyCreatedByUserAccountName - nvarchar(40)
GETDATE() -- DateTimeLastUpdated - datetime
)
Hard-coded values are rarely what's needed, though; it would be very useful if it could generate variables and use them in the statement, like this:
DECLARE @InterActionPersonalContactID INT = 0 ,
@InterActionFirmContactID INT = 0 ,
@ImageFileStoreFilePathSegment NVARCHAR(256) = '' ,
@Source VARCHAR(20) = '' ,
@ManuallyCreatedByUserAccountName NVARCHAR(40) = N'',
@DateTimeLastUpdated DATETIME = GETDATE()
INSERT INTO dbo.ContactPictures
( InterActionPersonalContactID ,
InterActionFirmContactID ,
ImageFileStoreFilePathSegment ,
Source ,
ManuallyCreatedByUserAccountName ,
DateTimeLastUpdated
)
VALUES ( @InterActionPersonalContactID ,
@InterActionFirmContactID ,
@ImageFileStoreFilePathSegment ,
@Source ,
@ManuallyCreatedByUserAccountName ,
@DateTimeLastUpdated
)
-
Anonymous commented
On the plus side, you might be able to do something with regular expression find/replace to modify the existing output to what you want..