Strind id=1,2
The 1,2 is my Column names
That means
1 is a column name
2 is a column name
So i want update some values to that column
I tried below code
alter PROCEDURE DynamicInsertQuery
@ColumnName VARCHAR(MAX),
@RiD VARCHAR(50)
AS
BEGIN
DECLARE @DynamicQuery NVARCHAR(MAX)
SET @DynamicQuery = 'Update tbl_route_info SET ('+ @ColumnName +') = (1) where RouteId=('+@RiD+')'
EXEC(@DynamicQuery)
end
This is the Code i tried Which is give by you
So i run thr procedure like this
DynamicInsertQuery '(1,2)','10'