Hello,
I am new to sql server . I try this following code but this gives an error like
" Conversion failed when converting the nvarchar value 'update emp1 set gender='m' where id=' to data type int."
Please can anybody tell how should I avoid this
I have emp1 table in which the gender column is of char and id is of int type
Declare @v1 char,@v2 int,@str nvarchar(max)set @v1='m'
set @v2=1
Set @str=N'update emp1 set gender='''+@v1+''' where id='+@v2+''
exec sp_executesql @str