Snippet for INSERT INTO CursorHere WITH TABLOCK
kondrich
Posts: 80 Bronze 2
Hi,
I mentioned it in my diary study yesterday: Is it possible to create a snitppet for INSERT INTO CursorHere WITH TABLOCK ?
When defining INSERT INTO $CURSOR$ WITH TABLOCK it expands to:
rather expanding to
Since we want to use minimally logged inserts (trace flag 610 is on), we have to use WITH (TABLOCK) very often.
I mentioned it in my diary study yesterday: Is it possible to create a snitppet for INSERT INTO CursorHere WITH TABLOCK ?
When defining INSERT INTO $CURSOR$ WITH TABLOCK it expands to:
INSERT INTO dbo.TableName (ColumnName) VALUES (0 -- ColumnName - smallint ) WITH (TABLOCK)
rather expanding to
INSERT INTO dbo.TableName WITH (TABLOCK) (ColumnName) VALUES (0 -- ColumnName - smallint )
Since we want to use minimally logged inserts (trace flag 610 is on), we have to use WITH (TABLOCK) very often.
Regards, Klaus
Comments
I've just updated our beta to 6.3.0.65 which should include this and a fix for the semicolon bug you reported. You can download it from the same URL as before.
thanks for the new version. It's partially working: It seems that we have a semicolon issue here again.
If the ii snippet is defined as it gets correctly expanded to However, if the snippet is defined as (note the trailing semicolon) and I start typing ii+TAB: this leads to (The pipe indicates the cursor position) So everything is fine until now. But after choosing a table name, the generated code gets replaced by: ...the table hint and the trailing semicolon are missing after full generation of the code.