-
Notifications
You must be signed in to change notification settings - Fork 317
Closed
Labels
By Design 🎨Issues due to driver feature design and will not be fixed.Issues due to driver feature design and will not be fixed.
Description
This scenario is a bit lengthy, so I'll load it into a gist: https://gist.github.com/benrr101/31628b57f1ab410090237c9018860e05
Basically what this boils down to is that if I .ExecuteReader() on a SqlCommand that has an OUTPUT clause in it, I don't get an exception from the query failing until I call .Read() on the SqlDataReader I gt back.
For instance executing:
INSERT INTO [dbo].[testtable]([small_col]) VALUES ("this value will be truncated")
SELECT * FROM [dbo].[testtable]
SqlDataReader reader = cmd.ExecuteReader(); // Doesn't throw
reader.Read() // DOES throw
But executing:
INSERT INTO [dbo].[testtable]([small_col]) OUTPUT inserted.[small_col] VALUES ("this value will be truncated")
SqlDataReader reader = cmd.ExecuteReader(); // DOES throw
reader.Read(); // Never executed
At this point I'm not sure if this is an expected behavior due to quirks in the TDS protocol or if it's a bug. Nevertheless, this is a bit of weird behavior that has already caused us a couple unexpected issue.
Metadata
Metadata
Assignees
Labels
By Design 🎨Issues due to driver feature design and will not be fixed.Issues due to driver feature design and will not be fixed.