I'm trying to run a simple dynamic sql statment but am receiving the error below. Do I have to create a stored procedure for this or can I run it in an inline query?
declare @sql varchar(1000)
select @sql = 'select * from table1'
error: Could not find stored procedure 'select * table1'.