Is there any implicit performance difference between these two? Notice the first time the params are all strings, but the fields are actually typed (INT, VARCHAR and BIT). The second time, the param is typed correctly. I am trying to quantify if there is anything gained from setting the types from my .NET code explicitly, or if using a generic method for the parameters will work just as well. Thoughts?
DECLARE @Num VARCHAR(MAX) = '1'
DECLARE @String VARCHAR(MAX) = 'THIS IS A TEST'
DECLARE @Bool VARCHAR(MAX) = 'true'
--STRONG TYPES
DECLARE @Num INT = 1
DECLARE @String VARCHAR(MAX) = 'THIS IS A TEST'
DECLARE @Bool BIT = 1
DECLARE @Table Table
(
NumField INT PRIMARY KEY,
StringField VARCHAR(100),
BoolField BIT
)
INSERT INTO @Table
SELECT @Num, @String, @Bool
SELECT * FROM @Table