SQL Server What do ellipsis mean in a SQL statement made through Dapper?

ocebsuys  于 2023-05-16  发布在  其他
关注(0)|答案(1)|浏览(118)

I am reading through some code and came across the following lines:

await connection.ExecuteAsync("CREATE TABLE #TempTable (Col1 NVARCHAR(20), Col2 NVARCHAR(20))", transaction: transaction);
await connection.BulkInsertAsync("INSERT INTO #TempTable VALUES (@Col1,@Col2) ...", transaction: transaction);

If I try pasting the above statements into SSMS, I get a message Incorrect syntax near '.'. ; however, it seems to work just fine here. I'd like to figure out what this is doing to know whether or not it's safe to remove.

lf5gs5x2

lf5gs5x21#

I figured it out. BulkInsertAsync actually comes from the Faithlife.Utility.Dapper library, not directly from Dapper. According to their documentation, you must include an ellipsis after an insert statement's values.

相关问题