Saturday, 17 November 2018
MS SQL - Fix Error - Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.
Watch this example on YouTube
Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.
To fix it replace
Declare @SomeText varchar(max) = '1,2,3'
Declare @SQL varchar(max) = 'Select Count (*) from TableTest Where ID in (' + @SomeText + ')'
Exec sp_executesql @SQL
with
Declare @SomeText varchar(max) = '1,2,3'
Declare @SQL nvarchar(max) = 'Select Count (*) from TableTest Where ID in (' + @SomeText + ')'
Exec sp_executesql @SQL
Subscribe to:
Post Comments (Atom)
DECLARE @input VARCHAR(256) = 'LIFE HAS NO LIMITATIONS EXCEPT THE ONCE YOU MAKE'
ReplyDeleteSELECT STRING_AGG(UPPER(LEFT(Value,1)) + RIGHT(Value,DATALENGTH(Value) - 1),' ')
FROM string_split(LOWER(@input),' ');
CAN ANY BODY GIVE A SOLUTION
ERROR
Msg 536, Level 16, State 2, Line 33
Invalid length parameter passed to the RIGHT function.
when the text has single space its allowing , when goes with double space getting error
ReplyDeletethe parameterized query '(@status nvarchar(7),@namear nvarchar(26),@nameen nvarchar(28),@' expects the parameter '@rejectionletterar', which was not supplied.
ReplyDeleteHow can I fix this