Hi,
i have made a runtime query inside a sp and am exceuting the query within the sp using exec(), but when creating the sp i am getting the error
The default schema does not exist.
The SP is:
CREATE PROCEDURE MySP
@tableName varchar(100)
AS
BEGIN
SET NOCOUNT ON;
declare @selectQuery varchar(MAX)
set @selectQuery = 'select * from ' + @tableName
exec(@selectQuery)
end
kindly help