Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 SQL Script troubles with VS 2008 & Report Services

Author  Topic 

sbeckel26
Starting Member

1 Post

Posted - 2009-05-26 : 17:20:53
Hello,

I am creating an SQL report in VS 2008 that calls for one of my datasets to use multiple loops to craft the data I am looking for. However, on just implementing a simple TSQL WHILE loop, I am finding VS 2008 simply ignoring the loop and processing my request only once. I broke the syntax down to just the following (removing the database specific data):

DECLARE @counter int
SET @counter = 0
WHILE @counter < 24
BEGIN
SELECT @counter AS Num
set @counter = @counter + 1
END

This statement works great when run from SQL Express 2008 but only produces a single row when run within the VS 2008 report designer.

Has anyone run into this before? If so, what is the solution here that I am missing?

Thanks

iesoccer
Starting Member

3 Posts

Posted - 2009-05-28 : 11:33:07
If everything works at the SQL Server level, i would suggest creating a stored procedure to do this and add that to the data set in the report.
Go to Top of Page
   

- Advertisement -