I am new to writing stored procedures and somewhat confused, but from what I've researched, seems like if I want to do dynamic sql I have to use either EXEC() or sp_executesql.
Can I access a field value within the stored procedure after an EXEC()?
For instance say this is a line in my stored procedure...
EXEC('select MyFld1, MyFld2, MyFld3 FROM MyTable WHERE ID=1')
Now in the next line I want to print the values in fields MyFld1, MyFld2, MyFld3. Is this possible?