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
)
![](https://secure.gravatar.com/avatar/83a6b9cdec67d239075d4b075d14f929?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
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..