I am writing a stored-procedure. But the table name is dynamic in this procedure. I want to get row number from my variable table. But where will I set @rownumber with return of select query?
Create Proc update_eMail (@tablename nvarchar(50), @columnname nvarchar(50)) AS Begin Declare @q_getrowNumber NVARCHAR(MAX) Declare @rownumber int SELECT @rownumber = Count(ID) FROM quotename(@tablename) // doesnt work END Thanks in advance