January 12, 2011 at 3:35 pm
Hello all,
How do i run the result of query automatically?
I have the following script. It will produce some script to execute.
I do not want to copy and paste the result to run.
Query
select 'exec ReportServer.dbo.AddEvent @EventType=''TimedSubscription'', @EventData=''' + cast(Subscriptions.SubscriptionID as varchar(500)) + '''' as id
FROM ReportSchedule
INNER JOIN Schedule ON ReportSchedule.ScheduleID = Schedule.ScheduleID
INNER JOIN Subscriptions ON ReportSchedule.SubscriptionID = Subscriptions.SubscriptionID
INNER JOIN [Catalog] ON ReportSchedule.ReportID = [Catalog].ItemID AND Subscriptions.Report_OID = [Catalog].ItemID
WHERESubscriptions.DeliveryExtension = 'Report Server Email'
and Subscriptions.laststatus like '%fail%'
Result
exec ReportServer.dbo.AddEvent @EventType='TimedSubscription', @EventData='E4093F79-BCF5-4F57-A95E-EA42217AFAB2'
exec ReportServer.dbo.AddEvent @EventType='TimedSubscription', @EventData='E627693B-6676-4D29-93DD-2A26ADB25CCD'
Above result needs to be run automatically.
January 12, 2011 at 4:07 pm
DECLARE @sql varchar(1000);
set @sql = '';
select @sql = @sql + 'exec ReportServer.dbo.AddEvent @EventType=''TimedSubscription'', @EventData=''' + cast(Subscriptions.SubscriptionID as varchar(500)) + ''';' + CHAR(13)
FROM ReportSchedule
INNER JOIN Schedule ON ReportSchedule.ScheduleID = Schedule.ScheduleID
INNER JOIN Subscriptions ON ReportSchedule.SubscriptionID = Subscriptions.SubscriptionID
INNER JOIN [Catalog] ON ReportSchedule.ReportID = [Catalog].ItemID AND Subscriptions.Report_OID = [Catalog].ItemID
WHERESubscriptions.DeliveryExtension = 'Report Server Email'
and Subscriptions.laststatus like '%fail%';
EXEC(@sql);
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
January 12, 2011 at 4:26 pm
Thanks mister magoo.
So helpful people in this forum 🙂 🙂 🙂
January 12, 2011 at 4:29 pm
You're welcome 😀
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
January 12, 2011 at 4:29 pm
Actually we're only after the points. I hear the winner gets to choose from an xbox and a mountain bike.
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply