I'm getting a bizzare error when I execute makewebtask. If I execute the bolded commented out @SQL I get the following failure:
Server: Msg 16805, Level 11, State 1, Procedure sp_makewebtask, Line 131
SQL Web Assistant: Could not execute the SQL statement.
But if I use the select statement instead of the stored procedure, it executes perfectly.
A little history, I'm a SA, so thats not the issue. I used the PRINT key word to make sure the stored procedure I'm executing inside @Query actually works, and it does. We also just recently migrated from SQL 2000 to 2005. The stored procedure was created in 2000. Has anyone seen anything like this before?
Working on this bit of code below:
DECLARE @muusid varchar(50)
declare @Reptitle varchar(500)
declare @SQL varchar(1000)
set @muusid = '#CAELS1'
set @SQL = 'select top 10 * from bpcssql.dbo.itemmasternew_bpcs'
--set @SQL = 'execute icg.dbo.SP_MM_ITEMSTATUS ' + '''' + @muusid + ''''
set @Reptitle = 'Mass Maintenance Status Report for ' + ltrim(rtrim(@muusid))
@outputfile = 'y:\ftp\HtmlReports\MM_QUE_#CAELS1.htm'
,@query = @SQL
,@webpagetitle = 'MASS MAINTENANCE'
,@resultstitle = @Reptitle
,@dbname = 'ICG'