Showing posts with label related. Show all posts
Showing posts with label related. Show all posts

Wednesday, March 28, 2012

Iteration within Stored Procedure

A Stored Procedure inserts a record in a base table. I want to add n records (n=1 to 5) into a related table. Another SP (tdAuthorityInsert) is already set up to insert one record into the related table.

So, two questions
1. What is the form of an iterative loop in a Stored Procedure?
2. How do you call a Stored Procedure from inside another?

Thanks, td

1. while

2. just use exec your_stored_procecure_name

|||

Thanks KH. I'm afraid, though, I am very new & your help is a bit too cryptic for me. Sorry but I require a bit more.

In the interim I had figured out the EXEC (I presume this is an abbreviation of EXECUTE) but I have trouble with the parameters. The SP goes something like this:

...AS
@.RequestID BigInt
.....
EXEC InsertReviewer @.RequestID,@.RequestID,@.RequestDate,GETDATE()

The problem is that the SP doing the calling has a parameter of @.Request. So does the called SP. I want to pass the ID through with other parameters.

The WHILE, is it used with a BEGIN/END eg
WHILE @.NumReviewers<5
BEGIN

END

Thanks very much for your patience

td

|||Is this what you trying to do ?
declare @.NumReviewers int
-- Initialize the @.NumReviewers
select @.NumReviewers = 1
WHILE @.NumReviewers <= 5
BEGIN
-- execute your SP and pass in the @.NumReviewers
exec your_sp_name @.NumReviewers
-- increment the @.NumReviewers
select @.NumReviewers = @.NumReviewers + 1
END

Monday, March 19, 2012

Issues in SSRS

I need some inputs regarding the

following points related to the SSRS reports:

1. We have a table in

the report and we want to change the display order of the columns when

downloading the report in the CSV format. What could be the possible approach

for this?

2. How to set bookmarks for a report when

downloading the report in the PDF format?

3. We have a table in the report and we

are hiding few cells of the table based on some condition. Now when a particular

cell is made invisible, a blank space exists at the location of that cell. The

requirement is that if we hide one cell, the cell below it must shift above i.e

at the location of the hidden cell.

In SSRS if we hide one row of a table,

then the row below it automatically shifts upwards, but this is not applicable

for a table cell.

Could anyone please provide vaulable

feedback on these points?

Thanks,
S Suresh

1. Not possible

2. Yes, you can create bookmarks for groups in your report by using "Document map label" feature when you edit the group.

3. Instead of having different cells in a row, merge all the cells and then have a rectangle inside that merged cell and then have multiple textboxes inside the rectangle in the same positions as cells were before. When you control the visibility of these textboxes inside a rectangle, they will move up if the visibility of the above cell is hidden.

Shyam