Showing posts with label parameters. Show all posts
Showing posts with label parameters. Show all posts

Thursday, March 29, 2012

ExecSQL Task Truncates Ouput Parameter

I am successfully passing several parameters into a SP using the ExecSQL Task. I have a single parameter that is an OUTPUT parameter in the SP.

I always recieve the first character of the OUTPUT string. I have tried chaning the data type of the parameter mapping [AnsiString, String, etc.] and I have tried changing the data type of the OUTPUT parameter [varchar, char, nvarchar, nchar]

In each case, only the frist character of the output value is returned and subsequently passed to the next SSIS component / task.

Any ideas why this value is truncated?It is a String.

One of the previous replies indicated that there is a max lenght on the variable, but I do not see where to set this length. Any further information on the issue is appreciated.

John|||

jloper wrote:

One of the previous replies indicated that there is a max lenght on the variable, but I do not see where to set this length. Any further information on the issue is appreciated.

John

Ignore that, I was wrong. Sorry!

Note to self: Check out your answers before posting them!

-Jamie

EXEC stored procedure

I have a stored procedure that creates temp tables. It has two parameters,
@.tablename and @.type. I execute it with the following command.
EXEC _sp_CreateTempTable 'TableA', 'T'
With these parameters, this will create a temp table named ##TMP_TableA
based on the original table TableA.
The problem is when I run this on one of our servers it works and when I run
it on another I get the following error.
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ','.
Help!
Dave
Can you post the proc?
Hope this helps.
Dan Guzman
SQL Server MVP
"DaveF" <dave@.aol.com> wrote in message news:5Ingh.8974$495.126@.trnddc06...
>I have a stored procedure that creates temp tables. It has two parameters,
>@.tablename and @.type. I execute it with the following command.
> EXEC _sp_CreateTempTable 'TableA', 'T'
> With these parameters, this will create a temp table named ##TMP_TableA
> based on the original table TableA.
> The problem is when I run this on one of our servers it works and when I
> run it on another I get the following error.
> Msg 102, Level 15, State 1, Line 1
> Incorrect syntax near ','.
> Help!
> Dave
>
|||Unfortunately not. It is proprietary information.
Do you think the error is coming from within the executed proc?
Dave
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:edQytE$HHHA.420@.TK2MSFTNGP06.phx.gbl...
> Can you post the proc?
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "DaveF" <dave@.aol.com> wrote in message
> news:5Ingh.8974$495.126@.trnddc06...
>
|||> Do you think the error is coming from within the executed proc?
Yes. I suspect the proc is executing a dynamic SQL statement (since you are
passing the table name parameter) and that's where the error is.
Hope this helps.
Dan Guzman
SQL Server MVP
"DaveF" <dave@.aol.com> wrote in message news:6Ungh.9006$495.7049@.trnddc06...
> Unfortunately not. It is proprietary information.
> Do you think the error is coming from within the executed proc?
> Dave
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:edQytE$HHHA.420@.TK2MSFTNGP06.phx.gbl...
>
|||I have a solution for you but unfortunately can't post it because it's
proprietary.
Just kidding. Try this and see if it works any better:
EXEC _sp_CreateTempTable @.tablename = 'TableA', @.type = 'T'
Make sure the SP is the same version (accepts the same # of parameters) on
both servers.
"DaveF" <dave@.aol.com> wrote in message news:5Ingh.8974$495.126@.trnddc06...
>I have a stored procedure that creates temp tables. It has two parameters,
>@.tablename and @.type. I execute it with the following command.
> EXEC _sp_CreateTempTable 'TableA', 'T'
> With these parameters, this will create a temp table named ##TMP_TableA
> based on the original table TableA.
> The problem is when I run this on one of our servers it works and when I
> run it on another I get the following error.
> Msg 102, Level 15, State 1, Line 1
> Incorrect syntax near ','.
> Help!
> Dave
>
|||Thanks for the idea but that didn't work.
I decided that since it worked on one machine and not the other that I would
compare Management Studio options and sure enough I found a difference. I
made the change and the error went away. Don't ask me why this particular
change fixed it because I don't know why.
Options-->Query Execution-->SQL Server-->Advanced
check SET CONCAT_NULL_YIELDS_NULL
Dave
"Mike C#" <xyz@.xyz.com> wrote in message
news:%23loaRX$HHHA.1468@.TK2MSFTNGP04.phx.gbl...
>I have a solution for you but unfortunately can't post it because it's
>proprietary.
> Just kidding. Try this and see if it works any better:
> EXEC _sp_CreateTempTable @.tablename = 'TableA', @.type = 'T'
> Make sure the SP is the same version (accepts the same # of parameters) on
> both servers.
> "DaveF" <dave@.aol.com> wrote in message
> news:5Ingh.8974$495.126@.trnddc06...
>
|||"DaveF" <dave@.aol.com> wrote in message news:i2Hgh.51$hy6.13@.trnddc05...
> Thanks for the idea but that didn't work.
> I decided that since it worked on one machine and not the other that I
> would compare Management Studio options and sure enough I found a
> difference. I made the change and the error went away. Don't ask me why
> this particular change fixed it because I don't know why.
> Options-->Query Execution-->SQL Server-->Advanced
> check SET CONCAT_NULL_YIELDS_NULL
Sounds like there's a NULL value being concatenated into a string somewhere
in your SP, most likely in some dynamic SQL you're trying to execute. That
setting controls null concatenation in strings. When it's set to ON,
concatenating NULL to a string returns NULL. When it's set to OFF, when a
NULL is concatenated to a string it's treated like '' - an empty string.
Here's an example that shows the difference:
DECLARE @.table VARCHAR(255)
SELECT @.table = 'syscomments'
DECLARE @.sql VARCHAR(255)
SELECT @.sql = 'SELECT TOP 10 * FROM ' + @.table
SELECT 'Table: syscomments', @.sql
SET CONCAT_NULL_YIELDS_NULL ON
SELECT @.table = NULL
SELECT @.sql = 'SELECT TOP 10 * FROM ' + @.table
SELECT 'Table: NULL, CONCAT_NULL_YIELDS_NULL ON', @.sql
SET CONCAT_NULL_YIELDS_NULL OFF
SELECT @.table = NULL
SELECT @.sql = 'SELECT TOP 10 * FROM ' + @.table
SELECT 'Table: NULL, CONCAT_NULL_YIELDS_NULL ON', @.sql
GO
SET CONCAT_NULL_YIELDS_NULL ON
When CONCAT_NULL_YIELDS_NULL is ON, appending NULL to a string returns NULL.
SQL Server will EXEC a NULL dynamic SQL string without complaint. When
CONCAT_NULL_YIELDS_NULL is OFF, the table name in this SELECT query is
appended as an empty string which will cause an error when SQL Server tries
to execute it.
Based on what you said, it sounds like one of the dynamic SQL statements
you're trying to execute has a NULL value appended to it somewhere, and
that's causing your error when that setting is OFF. It also means that that
particular dynamic SQL statement you think is being executed is not being
executed. Might want to check all your dynamic SQL statements that should
be executing (SELECT or PRINT them out right before the EXEC statement).
sql

EXEC stored procedure

I have a stored procedure that creates temp tables. It has two parameters,
@.tablename and @.type. I execute it with the following command.
EXEC _sp_CreateTempTable 'TableA', 'T'
With these parameters, this will create a temp table named ##TMP_TableA
based on the original table TableA.
The problem is when I run this on one of our servers it works and when I run
it on another I get the following error.
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ','.
Help!
DaveCan you post the proc?
Hope this helps.
Dan Guzman
SQL Server MVP
"DaveF" <dave@.aol.com> wrote in message news:5Ingh.8974$495.126@.trnddc06...
>I have a stored procedure that creates temp tables. It has two parameters,
>@.tablename and @.type. I execute it with the following command.
> EXEC _sp_CreateTempTable 'TableA', 'T'
> With these parameters, this will create a temp table named ##TMP_TableA
> based on the original table TableA.
> The problem is when I run this on one of our servers it works and when I
> run it on another I get the following error.
> Msg 102, Level 15, State 1, Line 1
> Incorrect syntax near ','.
> Help!
> Dave
>|||Unfortunately not. It is proprietary information.
Do you think the error is coming from within the executed proc?
Dave
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:edQytE$HHHA.420@.TK2MSFTNGP06.phx.gbl...
> Can you post the proc?
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "DaveF" <dave@.aol.com> wrote in message
> news:5Ingh.8974$495.126@.trnddc06...
>|||> Do you think the error is coming from within the executed proc?
Yes. I suspect the proc is executing a dynamic SQL statement (since you are
passing the table name parameter) and that's where the error is.
Hope this helps.
Dan Guzman
SQL Server MVP
"DaveF" <dave@.aol.com> wrote in message news:6Ungh.9006$495.7049@.trnddc06...
> Unfortunately not. It is proprietary information.
> Do you think the error is coming from within the executed proc?
> Dave
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:edQytE$HHHA.420@.TK2MSFTNGP06.phx.gbl...
>|||Thanks for the idea but that didn't work.
I decided that since it worked on one machine and not the other that I would
compare Management Studio options and sure enough I found a difference. I
made the change and the error went away. Don't ask me why this particular
change fixed it because I don't know why.
Options-->Query Execution-->SQL Server-->Advanced
check SET CONCAT_NULL_YIELDS_NULL
Dave
"Mike C#" <xyz@.xyz.com> wrote in message
news:%23loaRX$HHHA.1468@.TK2MSFTNGP04.phx.gbl...
>I have a solution for you but unfortunately can't post it because it's
>proprietary.
> Just kidding. Try this and see if it works any better:
> EXEC _sp_CreateTempTable @.tablename = 'TableA', @.type = 'T'
> Make sure the SP is the same version (accepts the same # of parameters) on
> both servers.
> "DaveF" <dave@.aol.com> wrote in message
> news:5Ingh.8974$495.126@.trnddc06...
>|||"DaveF" <dave@.aol.com> wrote in message news:i2Hgh.51$hy6.13@.trnddc05...
> Thanks for the idea but that didn't work.
> I decided that since it worked on one machine and not the other that I
> would compare Management Studio options and sure enough I found a
> difference. I made the change and the error went away. Don't ask me why
> this particular change fixed it because I don't know why.
> Options-->Query Execution-->SQL Server-->Advanced
> check SET CONCAT_NULL_YIELDS_NULL
Sounds like there's a NULL value being concatenated into a string somewhere
in your SP, most likely in some dynamic SQL you're trying to execute. That
setting controls null concatenation in strings. When it's set to ON,
concatenating NULL to a string returns NULL. When it's set to OFF, when a
NULL is concatenated to a string it's treated like '' - an empty string.
Here's an example that shows the difference:
DECLARE @.table VARCHAR(255)
SELECT @.table = 'syscomments'
DECLARE @.sql VARCHAR(255)
SELECT @.sql = 'SELECT TOP 10 * FROM ' + @.table
SELECT 'Table: syscomments', @.sql
SET CONCAT_NULL_YIELDS_NULL ON
SELECT @.table = NULL
SELECT @.sql = 'SELECT TOP 10 * FROM ' + @.table
SELECT 'Table: NULL, CONCAT_NULL_YIELDS_NULL ON', @.sql
SET CONCAT_NULL_YIELDS_NULL OFF
SELECT @.table = NULL
SELECT @.sql = 'SELECT TOP 10 * FROM ' + @.table
SELECT 'Table: NULL, CONCAT_NULL_YIELDS_NULL ON', @.sql
GO
SET CONCAT_NULL_YIELDS_NULL ON
When CONCAT_NULL_YIELDS_NULL is ON, appending NULL to a string returns NULL.
SQL Server will EXEC a NULL dynamic SQL string without complaint. When
CONCAT_NULL_YIELDS_NULL is OFF, the table name in this SELECT query is
appended as an empty string which will cause an error when SQL Server tries
to execute it.
Based on what you said, it sounds like one of the dynamic SQL statements
you're trying to execute has a NULL value appended to it somewhere, and
that's causing your error when that setting is OFF. It also means that that
particular dynamic SQL statement you think is being executed is not being
executed. Might want to check all your dynamic SQL statements that should
be executing (SELECT or PRINT them out right before the EXEC statement).

EXEC stored procedure

I have a stored procedure that creates temp tables. It has two parameters,
@.tablename and @.type. I execute it with the following command.
EXEC _sp_CreateTempTable 'TableA', 'T'
With these parameters, this will create a temp table named ##TMP_TableA
based on the original table TableA.
The problem is when I run this on one of our servers it works and when I run
it on another I get the following error.
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ','.
Help!
DaveCan you post the proc?
--
Hope this helps.
Dan Guzman
SQL Server MVP
"DaveF" <dave@.aol.com> wrote in message news:5Ingh.8974$495.126@.trnddc06...
>I have a stored procedure that creates temp tables. It has two parameters,
>@.tablename and @.type. I execute it with the following command.
> EXEC _sp_CreateTempTable 'TableA', 'T'
> With these parameters, this will create a temp table named ##TMP_TableA
> based on the original table TableA.
> The problem is when I run this on one of our servers it works and when I
> run it on another I get the following error.
> Msg 102, Level 15, State 1, Line 1
> Incorrect syntax near ','.
> Help!
> Dave
>|||Unfortunately not. It is proprietary information.
Do you think the error is coming from within the executed proc?
Dave
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:edQytE$HHHA.420@.TK2MSFTNGP06.phx.gbl...
> Can you post the proc?
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "DaveF" <dave@.aol.com> wrote in message
> news:5Ingh.8974$495.126@.trnddc06...
>>I have a stored procedure that creates temp tables. It has two
>>parameters, @.tablename and @.type. I execute it with the following command.
>> EXEC _sp_CreateTempTable 'TableA', 'T'
>> With these parameters, this will create a temp table named ##TMP_TableA
>> based on the original table TableA.
>> The problem is when I run this on one of our servers it works and when I
>> run it on another I get the following error.
>> Msg 102, Level 15, State 1, Line 1
>> Incorrect syntax near ','.
>> Help!
>> Dave
>|||> Do you think the error is coming from within the executed proc?
Yes. I suspect the proc is executing a dynamic SQL statement (since you are
passing the table name parameter) and that's where the error is.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"DaveF" <dave@.aol.com> wrote in message news:6Ungh.9006$495.7049@.trnddc06...
> Unfortunately not. It is proprietary information.
> Do you think the error is coming from within the executed proc?
> Dave
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:edQytE$HHHA.420@.TK2MSFTNGP06.phx.gbl...
>> Can you post the proc?
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "DaveF" <dave@.aol.com> wrote in message
>> news:5Ingh.8974$495.126@.trnddc06...
>>I have a stored procedure that creates temp tables. It has two
>>parameters, @.tablename and @.type. I execute it with the following
>>command.
>> EXEC _sp_CreateTempTable 'TableA', 'T'
>> With these parameters, this will create a temp table named ##TMP_TableA
>> based on the original table TableA.
>> The problem is when I run this on one of our servers it works and when I
>> run it on another I get the following error.
>> Msg 102, Level 15, State 1, Line 1
>> Incorrect syntax near ','.
>> Help!
>> Dave
>>
>|||I have a solution for you but unfortunately can't post it because it's
proprietary.
Just kidding. Try this and see if it works any better:
EXEC _sp_CreateTempTable @.tablename = 'TableA', @.type = 'T'
Make sure the SP is the same version (accepts the same # of parameters) on
both servers.
"DaveF" <dave@.aol.com> wrote in message news:5Ingh.8974$495.126@.trnddc06...
>I have a stored procedure that creates temp tables. It has two parameters,
>@.tablename and @.type. I execute it with the following command.
> EXEC _sp_CreateTempTable 'TableA', 'T'
> With these parameters, this will create a temp table named ##TMP_TableA
> based on the original table TableA.
> The problem is when I run this on one of our servers it works and when I
> run it on another I get the following error.
> Msg 102, Level 15, State 1, Line 1
> Incorrect syntax near ','.
> Help!
> Dave
>|||Thanks for the idea but that didn't work.
I decided that since it worked on one machine and not the other that I would
compare Management Studio options and sure enough I found a difference. I
made the change and the error went away. Don't ask me why this particular
change fixed it because I don't know why.
Options-->Query Execution-->SQL Server-->Advanced
check SET CONCAT_NULL_YIELDS_NULL
Dave
"Mike C#" <xyz@.xyz.com> wrote in message
news:%23loaRX$HHHA.1468@.TK2MSFTNGP04.phx.gbl...
>I have a solution for you but unfortunately can't post it because it's
>proprietary.
> Just kidding. Try this and see if it works any better:
> EXEC _sp_CreateTempTable @.tablename = 'TableA', @.type = 'T'
> Make sure the SP is the same version (accepts the same # of parameters) on
> both servers.
> "DaveF" <dave@.aol.com> wrote in message
> news:5Ingh.8974$495.126@.trnddc06...
>>I have a stored procedure that creates temp tables. It has two
>>parameters, @.tablename and @.type. I execute it with the following command.
>> EXEC _sp_CreateTempTable 'TableA', 'T'
>> With these parameters, this will create a temp table named ##TMP_TableA
>> based on the original table TableA.
>> The problem is when I run this on one of our servers it works and when I
>> run it on another I get the following error.
>> Msg 102, Level 15, State 1, Line 1
>> Incorrect syntax near ','.
>> Help!
>> Dave
>|||"DaveF" <dave@.aol.com> wrote in message news:i2Hgh.51$hy6.13@.trnddc05...
> Thanks for the idea but that didn't work.
> I decided that since it worked on one machine and not the other that I
> would compare Management Studio options and sure enough I found a
> difference. I made the change and the error went away. Don't ask me why
> this particular change fixed it because I don't know why.
> Options-->Query Execution-->SQL Server-->Advanced
> check SET CONCAT_NULL_YIELDS_NULL
Sounds like there's a NULL value being concatenated into a string somewhere
in your SP, most likely in some dynamic SQL you're trying to execute. That
setting controls null concatenation in strings. When it's set to ON,
concatenating NULL to a string returns NULL. When it's set to OFF, when a
NULL is concatenated to a string it's treated like '' - an empty string.
Here's an example that shows the difference:
DECLARE @.table VARCHAR(255)
SELECT @.table = 'syscomments'
DECLARE @.sql VARCHAR(255)
SELECT @.sql = 'SELECT TOP 10 * FROM ' + @.table
SELECT 'Table: syscomments', @.sql
SET CONCAT_NULL_YIELDS_NULL ON
SELECT @.table = NULL
SELECT @.sql = 'SELECT TOP 10 * FROM ' + @.table
SELECT 'Table: NULL, CONCAT_NULL_YIELDS_NULL ON', @.sql
SET CONCAT_NULL_YIELDS_NULL OFF
SELECT @.table = NULL
SELECT @.sql = 'SELECT TOP 10 * FROM ' + @.table
SELECT 'Table: NULL, CONCAT_NULL_YIELDS_NULL ON', @.sql
GO
SET CONCAT_NULL_YIELDS_NULL ON
When CONCAT_NULL_YIELDS_NULL is ON, appending NULL to a string returns NULL.
SQL Server will EXEC a NULL dynamic SQL string without complaint. When
CONCAT_NULL_YIELDS_NULL is OFF, the table name in this SELECT query is
appended as an empty string which will cause an error when SQL Server tries
to execute it.
Based on what you said, it sounds like one of the dynamic SQL statements
you're trying to execute has a NULL value appended to it somewhere, and
that's causing your error when that setting is OFF. It also means that that
particular dynamic SQL statement you think is being executed is not being
executed. Might want to check all your dynamic SQL statements that should
be executing (SELECT or PRINT them out right before the EXEC statement).

Tuesday, March 27, 2012

Exec SQL Task (stored procedures)

Hi,

Can anyone tell me how to pass parameters from one exec sql task to other ?... (I used stored proc in 1st exec sql task) and passed input parameter (default value set using a variable A) and stored the output parameter value in another variable B.

In the 2nd exec sql task , I passed the output param ( value of B) and doing insert into table xyz...

I get errors (in passing int and string values) . I tried using ole-db as well as ado.net.

Kindly give sample example.

Thanks,

The approach you are using sounds right to me. Could you post the details (including connection manager type) of the 2 execute sql task and the error you get?.

Exec replacement

I have a large query that needs to run .
This query has a lot of dinamic parameters ( i.e. wich are send from
the aplicattion ie (1,2,3)).
There are NO select rights granted on the table for the application
role so i need to run a stored proc.
If I put exec in the stored proc i get a error message saying I do not
have the rights. How should I go around and replace exec. I need a
efficient solution.
Thank you,Perhasps you need to create a UDF . Or grant SELECT/UPDATE/INSERT/DELETE
permissions on underlying tables
<petcu.bogdan@.gmail.com> wrote in message
news:1127908009.777329.306010@.g14g2000cwa.googlegroups.com...
>I have a large query that needs to run .
> This query has a lot of dinamic parameters ( i.e. wich are send from
> the aplicattion ie (1,2,3)).
> There are NO select rights granted on the table for the application
> role so i need to run a stored proc.
> If I put exec in the stored proc i get a error message saying I do not
> have the rights. How should I go around and replace exec. I need a
> efficient solution.
> Thank you,
>|||On 28 Sep 2005 04:46:49 -0700, petcu.bogdan@.gmail.com wrote:

>I have a large query that needs to run .
>This query has a lot of dinamic parameters ( i.e. wich are send from
>the aplicattion ie (1,2,3)).
>There are NO select rights granted on the table for the application
>role so i need to run a stored proc.
>If I put exec in the stored proc i get a error message saying I do not
>have the rights. How should I go around and replace exec. I need a
>efficient solution.
>Thank you,
Hi petcu,
Check out the site below. It explains why you can't use dynamic SQL with
your security setup, and also gives alternatives for all common uses for
dynamic SQL.
http://www.sommarskog.se/dynamic_sql.html
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

Friday, March 23, 2012

exe to export reports to pdf

Hi,
We have a need to create something like a win app that would be scheduled to
run on the web/reporting server, query the db, pass some parameters to
reports and auto-generate them in pdf format (to be stored in db or on the
same box) to make them available for the website visitors.
Have anybody done something like this before or seen an example of? We tried
to do something similar when reporting services when it just came out but
were unable to implement. Would really appreciate any advice on how to
tackle this!Thanks! Are you using data-driven subscription feature for this? Is it only
available with Enterprise SQL edition?
"Wickherm" <Wickherm@.discussions.microsoft.com> wrote in message
news:3CF580B4-0CD1-4C37-8099-2B65FBF846B2@.microsoft.com...
> We use the subscriptons in RS to schedule reports to save to a file share.
> The parameters in the reports call outside dll's to get the values.
> "ilona" wrote:
>> Hi,
>> We have a need to create something like a win app that would be scheduled
>> to
>> run on the web/reporting server, query the db, pass some parameters to
>> reports and auto-generate them in pdf format (to be stored in db or on
>> the
>> same box) to make them available for the website visitors.
>> Have anybody done something like this before or seen an example of? We
>> tried
>> to do something similar when reporting services when it just came out but
>> were unable to implement. Would really appreciate any advice on how to
>> tackle this!
>>

Wednesday, March 21, 2012

Excluding empty parameters

I would like to exclude any parameter that is empty from the SELECTcommand? How do I do this? This is part of a storedprocedure.
SELECT PersonID FROM Persons WHERE
(FirstName = @.firstname) AND
(LastName = @.lastname) AND
(SSN = @.ssn) AND
(AddressID = @.addressid) AND
(DOB = @.dob) AND
(Middle = @.middle)
THanks
One way to do that is to pass a NULL value for the parameters to be excluded, and then structure your query like this:
SELECT PersonID FROM Persons WHERE
(FirstName = ISNULL(@.firstname,FirstName)) AND
(LastName = ISNULL(@.lastname,LastName)) AND
(SSN = ISNULL(@.ssn,ssn)) AND
(AddressID = ISNULL(@.addressid,AddressID)) AND
(DOB = ISNULL(@.dob,DOB)) AND
(Middle = ISNULL(@.middle,Middle))

|||Thank you Teri - As always you answer me SQL questions!

Friday, February 24, 2012

EXCEL: parameters and stored procedures

Hi,
I'm trying to run a sproc that was created on SQL server and has two date
parameters. I can run the sproc easily enough with fixed values but it
doesn't work with parameters as the sproc can't be displayed graphically?!?!
I have seen that the suggested solution is to create a view but as this
query uses group by, using the where clause in a view to specify the
parameteres will not give the correct result set.
This is part of the SQL from the sproc.....
SELECT SG.SchemeName as SchemeName,
'Fail' as Type,
COUNT(CASE WHEN Q.Createdby = 'WEBUSER' THEN 1 END) as Web,
COALESCE(SUM(CASE WHEN Q.Createdby = 'WEBUSER') THEN Q.GrossPremium END),0)
as Value
FROMQuote Q
INNER JOIN SchemeGroup SG
ON Q.SchemeGroupID = SG.ID
INNER JOIN SubScheme SS
ON Q.ID = SS.QuoteID
WHERE lql.dbo.isPolicy(Q.ID) = 0
AND Q.CreatedAt BETWEEN @.SDATE AND @.FDATE
GROUP BY SG.SchemeName
ORDER BY SG.SchemeName,Type desc
Any help or ideas would be appreciated.
Thanks,
Ruz
Ruz
CREATE PROC myProc
@.SDate DATETIME,
@.FDate DATETIME
AS
--Your code here
If not sure I understand you
What does it mean?
> doesn't work with parameters as the sproc can't be displayed
graphically?!?!
"Ruz" <Ruz@.discussions.microsoft.com> wrote in message
news:704B8274-534E-4C83-906B-867245C0ED8E@.microsoft.com...
> Hi,
> I'm trying to run a sproc that was created on SQL server and has two date
> parameters. I can run the sproc easily enough with fixed values but it
> doesn't work with parameters as the sproc can't be displayed
graphically?!?!
> I have seen that the suggested solution is to create a view but as this
> query uses group by, using the where clause in a view to specify the
> parameteres will not give the correct result set.
> This is part of the SQL from the sproc.....
> SELECT SG.SchemeName as SchemeName,
> 'Fail' as Type,
> COUNT(CASE WHEN Q.Createdby = 'WEBUSER' THEN 1 END) as Web,
> COALESCE(SUM(CASE WHEN Q.Createdby = 'WEBUSER') THEN Q.GrossPremium
END),0)
> as Value
> FROM Quote Q
> INNER JOIN SchemeGroup SG
> ON Q.SchemeGroupID = SG.ID
> INNER JOIN SubScheme SS
> ON Q.ID = SS.QuoteID
> WHERE lql.dbo.isPolicy(Q.ID) = 0
> AND Q.CreatedAt BETWEEN @.SDATE AND @.FDATE
> GROUP BY SG.SchemeName
> ORDER BY SG.SchemeName,Type desc
> Any help or ideas would be appreciated.
> Thanks,
> Ruz
>
|||Hi Uri,
I think I might have mislead you slightly. My sproc works fine there is no
problem with that. The problem is when I am trying to call it from Microsoft
Query within Excel. The users had requested a spreadsheet where they can
update the data from the live database, this works fine with view and indeed
my sproc when fixed values are used but not when i try to add parameters and
this is (from the error message) because Microsoft query can't display this
graphically.
If I put this in the SQL window in Excel it will work:
exec RAC_ProcName '1 mar 2005','30 Mar 2005'
(Excel states that parameter should be represented by ?)
So it should work if it do this:
exec RAC_ProcName ?,?
But I get the error message:
"parameters are not allowed in queries that cannot be displayed graphically"
Cheers,
"Uri Dimant" wrote:

> Ruz
> CREATE PROC myProc
> @.SDate DATETIME,
> @.FDate DATETIME
> AS
> --Your code here
>
> If not sure I understand you
> What does it mean?
> graphically?!?!
>
> "Ruz" <Ruz@.discussions.microsoft.com> wrote in message
> news:704B8274-534E-4C83-906B-867245C0ED8E@.microsoft.com...
> graphically?!?!
> END),0)
>
>
|||Ruz
I have no experience of how to call it from EXCEL but looking at the error
message it seems that you cannot do that.
I used to get the data from Excel
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\MyExcel.xls";
User ID=Admin;Password=;Extended properties=Excel 8.0')...Book1$
"Ruz" <Ruz@.discussions.microsoft.com> wrote in message
news:02B7C405-5361-4137-8690-5B5EFC116B75@.microsoft.com...
> Hi Uri,
> I think I might have mislead you slightly. My sproc works fine there is no
> problem with that. The problem is when I am trying to call it from
Microsoft
> Query within Excel. The users had requested a spreadsheet where they can
> update the data from the live database, this works fine with view and
indeed
> my sproc when fixed values are used but not when i try to add parameters
and
> this is (from the error message) because Microsoft query can't display
this
> graphically.
> If I put this in the SQL window in Excel it will work:
> exec RAC_ProcName '1 mar 2005','30 Mar 2005'
> (Excel states that parameter should be represented by ?)
> So it should work if it do this:
> exec RAC_ProcName ?,?
> But I get the error message:
> "parameters are not allowed in queries that cannot be displayed
graphically"[vbcol=seagreen]
>
> Cheers,
> "Uri Dimant" wrote:
date[vbcol=seagreen]
this[vbcol=seagreen]

EXCEL: parameters and stored procedures

Hi,
I'm trying to run a sproc that was created on SQL server and has two date
parameters. I can run the sproc easily enough with fixed values but it
doesn't work with parameters as the sproc can't be displayed graphically?!?!
I have seen that the suggested solution is to create a view but as this
query uses group by, using the where clause in a view to specify the
parameteres will not give the correct result set.
This is part of the SQL from the sproc.....
SELECT SG.SchemeName as SchemeName,
'Fail' as Type,
COUNT(CASE WHEN Q.Createdby = 'WEBUSER' THEN 1 END) as Web,
COALESCE(SUM(CASE WHEN Q.Createdby = 'WEBUSER') THEN Q.GrossPremium END),0)
as Value
FROM Quote Q
INNER JOIN SchemeGroup SG
ON Q.SchemeGroupID = SG.ID
INNER JOIN SubScheme SS
ON Q.ID = SS.QuoteID
WHERE lql.dbo.isPolicy(Q.ID) = 0
AND Q.CreatedAt BETWEEN @.SDATE AND @.FDATE
GROUP BY SG.SchemeName
ORDER BY SG.SchemeName,Type desc
Any help or ideas would be appreciated.
Thanks,
RuzRuz
CREATE PROC myProc
@.SDate DATETIME,
@.FDate DATETIME
AS
--Your code here
If not sure I understand you
What does it mean?
> doesn't work with parameters as the sproc can't be displayed
graphically?!?!
"Ruz" <Ruz@.discussions.microsoft.com> wrote in message
news:704B8274-534E-4C83-906B-867245C0ED8E@.microsoft.com...
> Hi,
> I'm trying to run a sproc that was created on SQL server and has two date
> parameters. I can run the sproc easily enough with fixed values but it
> doesn't work with parameters as the sproc can't be displayed
graphically?!?!
> I have seen that the suggested solution is to create a view but as this
> query uses group by, using the where clause in a view to specify the
> parameteres will not give the correct result set.
> This is part of the SQL from the sproc.....
> SELECT SG.SchemeName as SchemeName,
> 'Fail' as Type,
> COUNT(CASE WHEN Q.Createdby = 'WEBUSER' THEN 1 END) as Web,
> COALESCE(SUM(CASE WHEN Q.Createdby = 'WEBUSER') THEN Q.GrossPremium
END),0)
> as Value
> FROM Quote Q
> INNER JOIN SchemeGroup SG
> ON Q.SchemeGroupID = SG.ID
> INNER JOIN SubScheme SS
> ON Q.ID = SS.QuoteID
> WHERE lql.dbo.isPolicy(Q.ID) = 0
> AND Q.CreatedAt BETWEEN @.SDATE AND @.FDATE
> GROUP BY SG.SchemeName
> ORDER BY SG.SchemeName,Type desc
> Any help or ideas would be appreciated.
> Thanks,
> Ruz
>|||Hi Uri,
I think I might have mislead you slightly. My sproc works fine there is no
problem with that. The problem is when I am trying to call it from Microsoft
Query within Excel. The users had requested a spreadsheet where they can
update the data from the live database, this works fine with view and indeed
my sproc when fixed values are used but not when i try to add parameters and
this is (from the error message) because Microsoft query can't display this
graphically.
If I put this in the SQL window in Excel it will work:
exec RAC_ProcName '1 mar 2005','30 Mar 2005'
(Excel states that parameter should be represented by ?)
So it should work if it do this:
exec RAC_ProcName ?,?
But I get the error message:
"parameters are not allowed in queries that cannot be displayed graphically"
Cheers,
"Uri Dimant" wrote:

> Ruz
> CREATE PROC myProc
> @.SDate DATETIME,
> @.FDate DATETIME
> AS
> --Your code here
>
> If not sure I understand you
> What does it mean?
> graphically?!?!
>
> "Ruz" <Ruz@.discussions.microsoft.com> wrote in message
> news:704B8274-534E-4C83-906B-867245C0ED8E@.microsoft.com...
> graphically?!?!
> END),0)
>
>|||Ruz
I have no experience of how to call it from EXCEL but looking at the error
message it seems that you cannot do that.
I used to get the data from Excel
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\MyExcel.xls";
User ID=Admin;Password=;Extended properties=Excel 8.0')...Book1$
"Ruz" <Ruz@.discussions.microsoft.com> wrote in message
news:02B7C405-5361-4137-8690-5B5EFC116B75@.microsoft.com...
> Hi Uri,
> I think I might have mislead you slightly. My sproc works fine there is no
> problem with that. The problem is when I am trying to call it from
Microsoft
> Query within Excel. The users had requested a spreadsheet where they can
> update the data from the live database, this works fine with view and
indeed
> my sproc when fixed values are used but not when i try to add parameters
and
> this is (from the error message) because Microsoft query can't display
this
> graphically.
> If I put this in the SQL window in Excel it will work:
> exec RAC_ProcName '1 mar 2005','30 Mar 2005'
> (Excel states that parameter should be represented by ?)
> So it should work if it do this:
> exec RAC_ProcName ?,?
> But I get the error message:
> "parameters are not allowed in queries that cannot be displayed
graphically"[vbcol=seagreen]
>
> Cheers,
> "Uri Dimant" wrote:
>
date[vbcol=seagreen]
this[vbcol=seagreen]

EXCEL: parameters and stored procedures

Hi,
I'm trying to run a sproc that was created on SQL server and has two date
parameters. I can run the sproc easily enough with fixed values but it
doesn't work with parameters as the sproc can't be displayed graphically?!?!
I have seen that the suggested solution is to create a view but as this
query uses group by, using the where clause in a view to specify the
parameteres will not give the correct result set.
This is part of the SQL from the sproc.....
SELECT SG.SchemeName as SchemeName,
'Fail' as Type,
COUNT(CASE WHEN Q.Createdby = 'WEBUSER' THEN 1 END) as Web,
COALESCE(SUM(CASE WHEN Q.Createdby = 'WEBUSER') THEN Q.GrossPremium END),0)
as Value
FROM Quote Q
INNER JOIN SchemeGroup SG
ON Q.SchemeGroupID = SG.ID
INNER JOIN SubScheme SS
ON Q.ID = SS.QuoteID
WHERE lql.dbo.isPolicy(Q.ID) = 0
AND Q.CreatedAt BETWEEN @.SDATE AND @.FDATE
GROUP BY SG.SchemeName
ORDER BY SG.SchemeName,Type desc
Any help or ideas would be appreciated.
Thanks,
RuzRuz
CREATE PROC myProc
@.SDate DATETIME,
@.FDate DATETIME
AS
--Your code here
If not sure I understand you
What does it mean?
> doesn't work with parameters as the sproc can't be displayed
graphically?!?!
"Ruz" <Ruz@.discussions.microsoft.com> wrote in message
news:704B8274-534E-4C83-906B-867245C0ED8E@.microsoft.com...
> Hi,
> I'm trying to run a sproc that was created on SQL server and has two date
> parameters. I can run the sproc easily enough with fixed values but it
> doesn't work with parameters as the sproc can't be displayed
graphically?!?!
> I have seen that the suggested solution is to create a view but as this
> query uses group by, using the where clause in a view to specify the
> parameteres will not give the correct result set.
> This is part of the SQL from the sproc.....
> SELECT SG.SchemeName as SchemeName,
> 'Fail' as Type,
> COUNT(CASE WHEN Q.Createdby = 'WEBUSER' THEN 1 END) as Web,
> COALESCE(SUM(CASE WHEN Q.Createdby = 'WEBUSER') THEN Q.GrossPremium
END),0)
> as Value
> FROM Quote Q
> INNER JOIN SchemeGroup SG
> ON Q.SchemeGroupID = SG.ID
> INNER JOIN SubScheme SS
> ON Q.ID = SS.QuoteID
> WHERE lql.dbo.isPolicy(Q.ID) = 0
> AND Q.CreatedAt BETWEEN @.SDATE AND @.FDATE
> GROUP BY SG.SchemeName
> ORDER BY SG.SchemeName,Type desc
> Any help or ideas would be appreciated.
> Thanks,
> Ruz
>|||Hi Uri,
I think I might have mislead you slightly. My sproc works fine there is no
problem with that. The problem is when I am trying to call it from Microsoft
Query within Excel. The users had requested a spreadsheet where they can
update the data from the live database, this works fine with view and indeed
my sproc when fixed values are used but not when i try to add parameters and
this is (from the error message) because Microsoft query can't display this
graphically.
If I put this in the SQL window in Excel it will work:
exec RAC_ProcName '1 mar 2005','30 Mar 2005'
(Excel states that parameter should be represented by ?)
So it should work if it do this:
exec RAC_ProcName ?,?
But I get the error message:
"parameters are not allowed in queries that cannot be displayed graphically"
Cheers,
"Uri Dimant" wrote:
> Ruz
> CREATE PROC myProc
> @.SDate DATETIME,
> @.FDate DATETIME
> AS
> --Your code here
>
> If not sure I understand you
> What does it mean?
> > doesn't work with parameters as the sproc can't be displayed
> graphically?!?!
>
> "Ruz" <Ruz@.discussions.microsoft.com> wrote in message
> news:704B8274-534E-4C83-906B-867245C0ED8E@.microsoft.com...
> > Hi,
> >
> > I'm trying to run a sproc that was created on SQL server and has two date
> > parameters. I can run the sproc easily enough with fixed values but it
> > doesn't work with parameters as the sproc can't be displayed
> graphically?!?!
> >
> > I have seen that the suggested solution is to create a view but as this
> > query uses group by, using the where clause in a view to specify the
> > parameteres will not give the correct result set.
> >
> > This is part of the SQL from the sproc.....
> >
> > SELECT SG.SchemeName as SchemeName,
> > 'Fail' as Type,
> > COUNT(CASE WHEN Q.Createdby = 'WEBUSER' THEN 1 END) as Web,
> > COALESCE(SUM(CASE WHEN Q.Createdby = 'WEBUSER') THEN Q.GrossPremium
> END),0)
> > as Value
> > FROM Quote Q
> > INNER JOIN SchemeGroup SG
> > ON Q.SchemeGroupID = SG.ID
> > INNER JOIN SubScheme SS
> > ON Q.ID = SS.QuoteID
> > WHERE lql.dbo.isPolicy(Q.ID) = 0
> > AND Q.CreatedAt BETWEEN @.SDATE AND @.FDATE
> > GROUP BY SG.SchemeName
> > ORDER BY SG.SchemeName,Type desc
> >
> > Any help or ideas would be appreciated.
> >
> > Thanks,
> >
> > Ruz
> >
>
>|||Ruz
I have no experience of how to call it from EXCEL but looking at the error
message it seems that you cannot do that.
I used to get the data from Excel
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\MyExcel.xls";
User ID=Admin;Password=;Extended properties=Excel 8.0')...Book1$
"Ruz" <Ruz@.discussions.microsoft.com> wrote in message
news:02B7C405-5361-4137-8690-5B5EFC116B75@.microsoft.com...
> Hi Uri,
> I think I might have mislead you slightly. My sproc works fine there is no
> problem with that. The problem is when I am trying to call it from
Microsoft
> Query within Excel. The users had requested a spreadsheet where they can
> update the data from the live database, this works fine with view and
indeed
> my sproc when fixed values are used but not when i try to add parameters
and
> this is (from the error message) because Microsoft query can't display
this
> graphically.
> If I put this in the SQL window in Excel it will work:
> exec RAC_ProcName '1 mar 2005','30 Mar 2005'
> (Excel states that parameter should be represented by ?)
> So it should work if it do this:
> exec RAC_ProcName ?,?
> But I get the error message:
> "parameters are not allowed in queries that cannot be displayed
graphically"
>
> Cheers,
> "Uri Dimant" wrote:
> > Ruz
> > CREATE PROC myProc
> > @.SDate DATETIME,
> > @.FDate DATETIME
> > AS
> > --Your code here
> >
> >
> > If not sure I understand you
> > What does it mean?
> > > doesn't work with parameters as the sproc can't be displayed
> > graphically?!?!
> >
> >
> >
> > "Ruz" <Ruz@.discussions.microsoft.com> wrote in message
> > news:704B8274-534E-4C83-906B-867245C0ED8E@.microsoft.com...
> > > Hi,
> > >
> > > I'm trying to run a sproc that was created on SQL server and has two
date
> > > parameters. I can run the sproc easily enough with fixed values but it
> > > doesn't work with parameters as the sproc can't be displayed
> > graphically?!?!
> > >
> > > I have seen that the suggested solution is to create a view but as
this
> > > query uses group by, using the where clause in a view to specify the
> > > parameteres will not give the correct result set.
> > >
> > > This is part of the SQL from the sproc.....
> > >
> > > SELECT SG.SchemeName as SchemeName,
> > > 'Fail' as Type,
> > > COUNT(CASE WHEN Q.Createdby = 'WEBUSER' THEN 1 END) as Web,
> > > COALESCE(SUM(CASE WHEN Q.Createdby = 'WEBUSER') THEN Q.GrossPremium
> > END),0)
> > > as Value
> > > FROM Quote Q
> > > INNER JOIN SchemeGroup SG
> > > ON Q.SchemeGroupID = SG.ID
> > > INNER JOIN SubScheme SS
> > > ON Q.ID = SS.QuoteID
> > > WHERE lql.dbo.isPolicy(Q.ID) = 0
> > > AND Q.CreatedAt BETWEEN @.SDATE AND @.FDATE
> > > GROUP BY SG.SchemeName
> > > ORDER BY SG.SchemeName,Type desc
> > >
> > > Any help or ideas would be appreciated.
> > >
> > > Thanks,
> > >
> > > Ruz
> > >
> >
> >
> >

Friday, February 17, 2012

Excel rendering crash with parameters. Ok as HTML.

Hi,
I am trying to render report I have with a matrix on it using the web
service.
It works fine if I render to excel format with no parameters provided
to the report.
It also works fine if I use the exact same code and just change the
render format to "HTML4.0" instead of "EXCEL".
As the error only happens with Excel specified and parameters provided
could this be a bug?
I had a search in this group and didn't find anyone else reporting
this so I may well be doing something silly.
Any advice would be apreciated, code and the error message returned in
the SoapException.Detail.Text follow. Please let me know if you need
any more details about what I'm doing
Thanks
Code:
string strReportName = "/MyReport";
string Hist = null;
XL3Addin.ReportService.DataSourceCredentials[] Creds = new
XL3Addin.ReportService.DataSourceCredentials[0];
string ShowHide = "";
string Enc = "";
string Mime = "";
string[] Streams;
XL3Addin.ReportService.ParameterValue[] ParamsOut;
XL3Addin.ReportService.Warning[] Warns;
//get the parameters out of a datagrid I have
XL3Addin.ReportService.ParameterValue[] ParamsIn = new
XL3Addin.ReportService.ParameterValue[this.ParamterTable.Rows.Count];
for(int i=0; i<this.ParamterTable.Rows.Count; i++)
{
ParamsIn[i] = new XL3Addin.ReportService.ParameterValue();
ParamsIn[i].Name = this.ParamterTable.Rows[i].ItemArray[0].ToString();
ParamsIn[i].Value = this.ParamterTable.Rows[i].ItemArray[2].ToString();
ParamsIn[i].Label = this.ParamterTable.Rows[i].ItemArray[1].ToString();
}
byte[] rep = rs.Render(strReportName, RenderFormat, Hist, DeviceInfo,
ParamsIn, Creds, ShowHide, out Enc, out Mime, out ParamsOut, out
Warns, out Streams);
Works if:
string RenderFormat = "EXCEL";
string DeviceInfo = "<DeviceInfo><OmitDocumentMap>False</OmitDocumentMap><OmitFormulas>False</OmitFormulas><RemoveSpace>0.125in</RemoveSpace></DeviceInfo>";
Is changed to:
string RenderFormat = "HTML4.0";
string DeviceInfo = null;
Error Message :
rrRenderingError
400
Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException
was thrown.
http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings.resources.Strings&EvtID=rrRenderingError&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=8.00
Microsoft SQL Server Reporting Services
8.00.878.00
127
OsIndependent
1033
Microsoft.ReportingServices.Processing
Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException
was thrown.
Microsoft.ReportingServices.ExcelRendering
Exception of type
Microsoft.ReportingServices.ReportRendering.ReportRenderingException
was thrown.
Microsoft.ReportingServices.ExcelRendering
Object reference not set to an instance of an object.Hmm, no takers yet ;)
Will it help if i post my rdl definition?
It is an OLAP grid with drill down and filters.
Am an trying to render with parameters of "CA" and "Drink" for Param0
and Param1 respectively.
The HTML file is produced, but still .Render() with Excel as the type
crashes.
I hope posting this XML doesn't mess the board around too much.
Any help gratefully received
Thanks
Colin
<?xml version="1.0"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition"
xmlns:rd="<GridSpacing">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"><GridSpacing
xmlns="0.25cm</GridSpacing><RightMargin>1in</RightMargin><Body><ReportItems><Matrix">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">0.25cm</GridSpacing><RightMargin>1in</RightMargin><Body><ReportItems><Matrix
Name="Martix0"><Corner><ReportItems><Textbox
Name="TextBox0"><Style><BorderStyle><Default>Solid</Default><Top>None</Top><Left>None</Left></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><FontSize>26pt</FontSize><Color>DarkBlue</Color></Style><Value>Test
with filters</Value><CanGrow>true</CanGrow><ZIndex>0</ZIndex></Textbox></ReportItems></Corner><Style></Style><MatrixRows><MatrixRow><MatrixCells><MatrixCell><ReportItems><Textbox
Name="TextBox1"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><BackgroundColor>AliceBlue</BackgroundColor><TextAlign>Right</TextAlign><Format>C0</Format></Style><Value>=Sum(Fields!Measure0.Value)</Value><CanGrow>true</CanGrow><ZIndex
1</ZIndex></Textbox></ReportItems></MatrixCell></MatrixCells><Height>0.25in</Height></MatrixRow></MatrixRows><MatrixColumns><MatrixColumn><Width>0.875in</Width></MatrixColumn></MatrixColumns><DataSetName>DataQuery</DataSetName><ColumnGroupings><ColumnGrouping><DynamicColumns><Grouping
Name="ColGrp0"><GroupExpressions><GroupExpression>=Fields!ColLvl0.Value</GroupExpression></GroupExpressions></Grouping><ReportItems><Textbox
Name="ColTxtBox0"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><Color>White</Color><BackgroundColor>SteelBlue</BackgroundColor><TextAlign>Center</TextAlign></Style><Value>=Fields!ColLvl0.Value</Value><CanGrow>true</CanGrow><ZIndex>2
/ZIndex></Textbox></ReportItems></DynamicColumns><Height>0.25in</Height></ColumnGrouping><ColumnGrouping><DynamicColumns><Grouping
Name="ColGrp1"><GroupExpressions><GroupExpression>=Fields!ColLvl1.Value</GroupExpression></GroupExpressions></Grouping><Visibility><ToggleItem>ColTxtBox0</ToggleItem><Hidden>true</Hidden></Visibility><ReportItems><Textbox
Name="ColTxtBox1"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><Color>White</Color><BackgroundColor>SteelBlue</BackgroundColor><TextAlign>Center</TextAlign></Style><Value>=Fields!ColLvl1.Value</Value><CanGrow>true</CanGrow><ZIndex>3
/ZIndex></Textbox></ReportItems></DynamicColumns><Height>0.25in</Height></ColumnGrouping><ColumnGrouping><DynamicColumns><Grouping
Name="ColGrp2"><GroupExpressions><GroupExpression>=Fields!ColLvl2.Value</GroupExpression></GroupExpressions></Grouping><Visibility><ToggleItem>ColTxtBox1</ToggleItem><Hidden>true</Hidden></Visibility><ReportItems><Textbox
Name="ColTxtBox2"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><Color>White</Color><BackgroundColor>SteelBlue</BackgroundColor><TextAlign>Center</TextAlign></Style><Value>=Fields!ColLvl2.Value</Value><CanGrow>true</CanGrow><ZIndex>4
/ZIndex></Textbox></ReportItems></DynamicColumns><Height>0.25in</Height></ColumnGrouping><ColumnGrouping><DynamicColumns><Grouping
Name="ColGrp3"><GroupExpressions><GroupExpression>=Fields!ColLvl3.Value</GroupExpression></GroupExpressions></Grouping><Visibility><ToggleItem>ColTxtBox2</ToggleItem><Hidden>true</Hidden></Visibility><ReportItems><Textbox
Name="ColTxtBox3"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><Color>White</Color><BackgroundColor>SteelBlue</BackgroundColor><TextAlign>Center</TextAlign></Style><Value>=Fields!ColLvl3.Value</Value><CanGrow>true</CanGrow><ZIndex>5
/ZIndex></Textbox></ReportItems></DynamicColumns><Height>0.25in</Height></ColumnGrouping><ColumnGrouping><DynamicColumns><Grouping
Name="ColGrp4"><GroupExpressions><GroupExpression>=Fields!ColLvl4.Value</GroupExpression></GroupExpressions></Grouping><Visibility><ToggleItem>ColTxtBox3</ToggleItem><Hidden>true</Hidden></Visibility><ReportItems><Textbox
Name="ColTxtBox4"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><Color>White</Color><BackgroundColor>SteelBlue</BackgroundColor><TextAlign>Center</TextAlign></Style><Value>=Fields!ColLvl4.Value</Value><CanGrow>true</CanGrow><ZIndex>6
/ZIndex></Textbox></ReportItems></DynamicColumns><Height>0.25in</Height></ColumnGrouping><ColumnGrouping><Height>0.25in</Height><StaticColumns><StaticColumn><ReportItems><Textbox
Name="TextBox7"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><Color>White</Color><BackgroundColor>SteelBlue</BackgroundColor><TextAlign>Center</TextAlign></Style><Value>Unit
Sales</Value><CanGrow>true</CanGrow><ZIndex>7</ZIndex></Textbox></ReportItems></StaticColumn></StaticColumns></ColumnGrouping></ColumnGroupings><Filters><Filter><FilterExpression>=Fields!RowLvl1.Value</FilterExpression><Operator>Equal</Operator><FilterValues><FilterValue>=Parameters!Param0.Value</FilterValue></FilterValues></Filter><Filter><FilterExpression>=Fields!ColLvl0.Value</FilterExpression>
Operator>Equal</Operator><FilterValues><FilterValue>=Parameters!Param1.Value</FilterValue></FilterValues></Filter></Filters><RowGroupings><RowGrouping><DynamicRows><Grouping
Name="RowGrp0"><GroupExpressions><GroupExpression>=Fields!RowLvl0.Value</GroupExpression></GroupExpressions></Grouping><ReportItems><Textbox
Name="RowTxtBox0"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><Color>White</Color><BackgroundColor>SteelBlue</BackgroundColor><TextAlign>Left</TextAlign></Style><Value>=Fields!RowLvl0.Value</Value><CanGrow>true</CanGrow><ZIndex>8</
Index></Textbox></ReportItems><Subtotal><ReportItems><Textbox
Name="TextBox9"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><Color>SkyBlue</Color><BackgroundColor>SteelBlue</BackgroundColor><TextAlign>Left</TextAlign></Style><Value>Subtotal</Value><CanGrow>true</CanGrow><ZIndex>9</ZIndex></Text
ox></ReportItems></Subtotal></DynamicRows><Width>0.875in</Width></RowGrouping><RowGrouping><DynamicRows><Grouping
Name="RowGrp1"><GroupExpressions><GroupExpression>=Fields!RowLvl1.Value</GroupExpression></GroupExpressions></Grouping><Visibility><ToggleItem>RowTxtBox0</ToggleItem><Hidden>true</Hidden></Visibility><ReportItems><Textbox
Name="RowTxtBox1"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><Color>White</Color><BackgroundColor>SteelBlue</BackgroundColor><TextAlign>Left</TextAlign></Style><Value>=Fields!RowLvl1.Value</Value><CanGrow>true</CanGrow><ZIndex>10<
ZIndex></Textbox></ReportItems><Subtotal><ReportItems><Textbox
Name="TextBox11"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><Color>SkyBlue</Color><BackgroundColor>SteelBlue</BackgroundColor><TextAlign>Left</TextAlign></Style><Value>Subtotal</Value><CanGrow>true</CanGrow><ZIndex>11</ZIndex></Te
tbox></ReportItems></Subtotal></DynamicRows><Width>0.875in</Width></RowGrouping><RowGrouping><DynamicRows><Grouping
Name="RowGrp2"><GroupExpressions><GroupExpression>=Fields!RowLvl2.Value</GroupExpression></GroupExpressions></Grouping><Visibility><ToggleItem>RowTxtBox1</ToggleItem><Hidden>true</Hidden></Visibility><ReportItems><Textbox
Name="RowTxtBox2"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><Color>White</Color><BackgroundColor>SteelBlue</BackgroundColor><TextAlign>Left</TextAlign></Style><Value>=Fields!RowLvl2.Value</Value><CanGrow>true</CanGrow><ZIndex>12<
ZIndex></Textbox></ReportItems><Subtotal><ReportItems><Textbox
Name="TextBox13"><Style><BorderStyle><Default>Solid</Default></BorderStyle><PaddingTop>2pt</PaddingTop><PaddingBottom>2pt</PaddingBottom><PaddingLeft>2pt</PaddingLeft><PaddingRight>2pt</PaddingRight><FontFamily>Tahoma</FontFamily><Color>SkyBlue</Color><BackgroundColor>SteelBlue</BackgroundColor><TextAlign>Left</TextAlign></Style><Value>Subtotal</Value><CanGrow>true</CanGrow><ZIndex>13</ZIndex></Te
tbox></ReportItems></Subtotal></DynamicRows><Width>0.875in</Width></RowGrouping></RowGroupings></Matrix></ReportItems><Style></Style><Height>1.25in</Height><ColumnSpacing>1cm</ColumnSpacing></Body><TopMargin>1in</TopMargin><DataSources><DataSource
Name="DataSource1"><DataSourceID
xmlns="B7BD158F-94EE-41E4-BA21-CDC54DBA3983</DataSourceID><ConnectionProperties><DataProvider>OLEDB</DataProvider><ConnectString>Provider=MSOLAP.2;Client">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">B7BD158F-94EE-41E4-BA21-CDC54DBA3983</DataSourceID><ConnectionProperties><DataProvider>OLEDB</DataProvider><ConnectString>Provider=MSOLAP.2;Client
Cache Size=25;Data Source=iis-covertonxp;Initial Catalog=FoodMart
2000;Auto Synch Period=10000</ConnectString><IntegratedSecurity>true</IntegratedSecurity></ConnectionProperties></DataSource></DataSources><Width>7.125in</Width><DataSets><DataSet
Name="DataQuery"><Fields><Field
Name="ColLvl0"><DataField>[Product].[Product
Family].[MEMBER_CAPTION]</DataField><TypeName
xmlns="System.String</TypeName></Field><Field">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.String</TypeName></Field><Field
Name="ColLvl1"><DataField>[Product].[Product
Department].[MEMBER_CAPTION]</DataField><TypeName
xmlns="System.String</TypeName></Field><Field">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.String</TypeName></Field><Field
Name="ColLvl2"><DataField>[Product].[Product
Category].[MEMBER_CAPTION]</DataField><TypeName
xmlns="System.String</TypeName></Field><Field">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.String</TypeName></Field><Field
Name="ColLvl3"><DataField>[Product].[Product
Subcategory].[MEMBER_CAPTION]</DataField><TypeName
xmlns="System.String</TypeName></Field><Field">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.String</TypeName></Field><Field
Name="ColLvl4"><DataField>[Product].[Brand
Name].[MEMBER_CAPTION]</DataField><TypeName
xmlns="System.String</TypeName></Field><Field">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.String</TypeName></Field><Field
Name="RowLvl0"><DataField>[Customers].[Country].[MEMBER_CAPTION]</DataField><TypeName
xmlns="System.String</TypeName></Field><Field">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.String</TypeName></Field><Field
Name="RowLvl1"><DataField>[Customers].[State
Province].[MEMBER_CAPTION]</DataField><TypeName
xmlns="System.String</TypeName></Field><Field">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.String</TypeName></Field><Field
Name="RowLvl2"><DataField>[Customers].[City].[MEMBER_CAPTION]</DataField><TypeName
xmlns="System.String</TypeName></Field><Field">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.String</TypeName></Field><Field
Name="Measure0"><DataField>[Measures].[Unit
Sales]</DataField><TypeName
xmlns="System.Object</TypeName></Field></Fields><Query><DataSourceName>DataSource1</DataSourceName><CommandText>">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.Object</TypeName></Field></Fields><Query><DataSourceName>DataSource1</DataSourceName><CommandText>
SELECT
{[Measures].[Unit Sales]} on columns ,
{[Customers].[City].members} on rows ,
{[Product].[Brand Name].members} on pages
FROM
[Sales]
CELL PROPERTIES
VALUE, FORMATTED_VALUE, FORMAT_STRING, FORE_COLOR, BACK_COLOR,
FONT_FLAGS</CommandText></Query></DataSet><DataSet
Name="ParameterQuery0"><Fields><Field
Name="ParaLevelField0"><DataField>[Customers].[State
Province].[MEMBER_CAPTION]</DataField><TypeName
xmlns="System.String</TypeName></Field><Field">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.String</TypeName></Field><Field
Name="ParamNullField0"><DataField>[Measures].[NullColumn]</DataField><TypeName
xmlns="System.Object</TypeName></Field></Fields><Query><DataSourceName>DataSource1</DataSourceName><CommandText>WITH">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.Object</TypeName></Field></Fields><Query><DataSourceName>DataSource1</DataSourceName><CommandText>WITH
MEMBER Measures.NullColumn AS 'Null' SELECT {Measures.NullColumn} ON
COLUMNS, { [Customers].[State Province].Members } ON ROWS From
Sales</CommandText></Query></DataSet><DataSet
Name="ParameterQuery1"><Fields><Field
Name="ParaLevelField1"><DataField>[Product].[Product
Family].[MEMBER_CAPTION]</DataField><TypeName
xmlns="System.String</TypeName></Field><Field">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.String</TypeName></Field><Field
Name="ParamNullField1"><DataField>[Measures].[NullColumn]</DataField><TypeName
xmlns="System.Object</TypeName></Field></Fields><Query><DataSourceName>DataSource1</DataSourceName><CommandText>WITH">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">System.Object</TypeName></Field></Fields><Query><DataSourceName>DataSource1</DataSourceName><CommandText>WITH
MEMBER Measures.NullColumn AS 'Null' SELECT {Measures.NullColumn} ON
COLUMNS, { [Product].[Product Family].Members } ON ROWS From
Sales</CommandText></Query></DataSet></DataSets><LeftMargin>1in</LeftMargin><SnapToGrid
xmlns="true</SnapToGrid><PageHeight>12in</PageHeight><DrawGrid">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">true</SnapToGrid><PageHeight>12in</PageHeight><DrawGrid
xmlns="true</DrawGrid><PageWidth>8in</PageWidth><ReportID">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">true</DrawGrid><PageWidth>8in</PageWidth><ReportID
xmlns="7B383EFA-88B0-41CB-987B-3F766C0F4776</ReportID><BottomMargin>1in</BottomMargin><ReportParameters><ReportParameter">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">7B383EFA-88B0-41CB-987B-3F766C0F4776</ReportID><BottomMargin>1in</BottomMargin><ReportParameters><ReportParameter
Name="Param0"><DataType>String</DataType><DefaultValue><DataSetReference><DataSetName>ParameterQuery0</DataSetName><ValueField>ParaLevelField0</ValueField></DataSetReference></DefaultValue><Prompt>State
Province</Prompt><ValidValues><DataSetReference><DataSetName>ParameterQuery0</DataSetName><ValueField>ParaLevelField0</ValueField><LabelField>ParaLevelField0</LabelField></DataSetReference></ValidValues></ReportParameter><ReportParameter
Name="Param1"><DataType>String</DataType><DefaultValue><DataSetReference><DataSetName>ParameterQuery1</DataSetName><ValueField>ParaLevelField1</ValueField></DataSetReference></DefaultValue><Prompt>Product
Family</Prompt><ValidValues><DataSetReference><DataSetName>ParameterQuery1</DataSetName><ValueField>ParaLevelField1</ValueField><LabelField>ParaLevelField1</LabelField></DataSetReference></ValidValues></ReportParameter></ReportParameters></Report>