Showing posts with label tables. Show all posts
Showing posts with label tables. Show all posts

Tuesday, March 27, 2012

calling stored proc. from bcp

here's what I'm trying:
create procedure querytotext
as
select * from tablename
create function querytotext()
returns tables
as
return select * from tablename
bcp 'querytotext queryout filename.txt
bcp 'select querytotext()' queryout filename.txt
None of them working. bcp is calling neither stored procedure nor function.
Is it the limitation of bcp?Hi
Using double quotes around the query will help along with specifying the
database name for the procedure
bcp "EXEC mydb..querytotext" queryout filename.txt -T-c
John
try something like:
BCP "
"Raj" wrote:
> here's what I'm trying:
> create procedure querytotext
> as
> select * from tablename
> create function querytotext()
> returns tables
> as
> return select * from tablename
> bcp 'querytotext queryout filename.txt
> bcp 'select querytotext()' queryout filename.txt
> None of them working. bcp is calling neither stored procedure nor function.
> Is it the limitation of bcp?
>
>

Thursday, March 22, 2012

Calling Functions on another database

Hey guys, I recently found out u can actaully JOIN tables that are on different dbs as long as they are on the same SQL Server by specifying [DATABASE].[DATABASEOWNER].[TABLE]. I now have a question tho. Can you access functions the same way? i have tried using the same syntax, but I get an error saying 'Invalid object name'

Any help would be great.

Thanks!You can as long as permissions are set correctly. I do it all the time. You must be missing something, because it is possible. Is the function what is showing as invalid or is there something inside the function that it thnks is invalid?

And actually, you can join tables and use objects from other servers if you have linked servers set up.|||ah thanks, you're right, i had changed the object owner using sp_changeobjectowner and forgot that the permissions get dropped. Thanks alot!sql

Tuesday, March 20, 2012

Calling another record into this record

This has got to be easier than I am making it out to be. I have a
query that calls on two tables linked by unique ids. I would like to
have the previous outing's # of laps brought into the current outing.
An example of what the view follows
SELECT TOP 100 PERCENT [Main Outing].OutingNumber, [Main
Outing].OutingID, COUNT(dbo.vwLaps.LapTime) AS [# of laps]
FROM dbo.vwOutings [Main Outing] INNER JOIN
dbo.vwLaps ON [Main Outing].OutingID =
dbo.vwLaps.OutingID
GROUP BY [Main Outing].OutingNumber, [Main Outing].OutingID
ORDER BY [Main Outing].OutingNumber DESC

returning
Outing Number Outing ID
# of laps
6{87C29BDC-A2D1-4606-A87B-D456F702BFCE}99
5{203319A9-4B2F-406A-9454-0DD3D5F86211}37
4{B6306DF5-5BF0-4456-8E06-0CD2ED8B1874}54
3{A70643F3-28C2-47CC-B623-4BD6904C2825}95
2{EB409D12-C79C-4D96-BE2A-0BD49C5BE69D}80
1{75D7793D-3239-4544-BACC-84EB564C8638}36
what I woud like is
Outing Number Outing ID
# of laps # of laps previousouting
6{87C29BDC-A2D1-4606-A87B-D456F702BFCE}99 37
5{203319A9-4B2F-406A-9454-0DD3D5F86211}37 54
4{B6306DF5-5BF0-4456-8E06-0CD2ED8B1874}54 95
3{A70643F3-28C2-47CC-B623-4BD6904C2825}95 80
2{EB409D12-C79C-4D96-BE2A-0BD49C5BE69D}80 36
1{75D7793D-3239-4544-BACC-84EB564C8638}36 0
sorry if this is a silly question I'm a little new to this thanks for
any helpOn 15 Jun 2006 05:47:43 -0700, pltaylor3@.gmail.com wrote:

>This has got to be easier than I am making it out to be. I have a
>query that calls on two tables linked by unique ids. I would like to
>have the previous outing's # of laps brought into the current outing.
>An example of what the view follows
>SELECT TOP 100 PERCENT [Main Outing].OutingNumber, [Main
>Outing].OutingID, COUNT(dbo.vwLaps.LapTime) AS [# of laps]
>FROM dbo.vwOutings [Main Outing] INNER JOIN
> dbo.vwLaps ON [Main Outing].OutingID =
>dbo.vwLaps.OutingID
>GROUP BY [Main Outing].OutingNumber, [Main Outing].OutingID
>ORDER BY [Main Outing].OutingNumber DESC
(snip)

Hi pltaylor3,

First, why do you have a "TOP 100 PERCENT" in your query? Since 100
percent equals all rows, you're actually requestin alll rows - which is
the default if you don't specify a TOP clause at all! Get rid of it.

Next, why do you choose aliases that require you to escape the names?
Are you really that fond of typing lots of [ and ] chartacters?

Third, you might also reconsider the "vw" prefixes on your views. In SQL
Server, objects should be named for what they represent, not for how
they happen to be implemented.

Last, here's an answer to your question:

SELECT mo.OutingNumber, mo.OutingID,
COUNT(l.LapTime) AS "# of laps",
(SELECT COUNT(l2.LapTime)
FROM dbo.Outings AS mo2
INNER JOIN dbo.Laps AS l2
ON mo2.OutingID = l2.OutingID
WHERE mo2.OutingNumber = mo.OutingNumber - 1) AS "# of
laps previousouting"
FROM dbo.Outings AS mo -- [Main Outing]
INNER JOIN dbo.Laps AS l
ON mo.OutingID = l.OutingID
GROUP BY mo.OutingNumber, mo.OutingID
ORDER BY mo.OutingNumber DESC

(Untested - see www.aspfaq.com/5006 if you prefer a tested reply)

--
Hugo Kornelis, SQL Server MVP|||(pltaylor3@.gmail.com) writes:
> This has got to be easier than I am making it out to be. I have a
> query that calls on two tables linked by unique ids. I would like to
> have the previous outing's # of laps brought into the current outing.
> An example of what the view follows
> SELECT TOP 100 PERCENT [Main Outing].OutingNumber, [Main
> Outing].OutingID, COUNT(dbo.vwLaps.LapTime) AS [# of laps]
> FROM dbo.vwOutings [Main Outing] INNER JOIN
> dbo.vwLaps ON [Main Outing].OutingID =
> dbo.vwLaps.OutingID
> GROUP BY [Main Outing].OutingNumber, [Main Outing].OutingID
> ORDER BY [Main Outing].OutingNumber DESC

First remove the TOP 100 PERCENT and ORDER BY from the view. They mean
nothing. In SQL 2000 it may seem that a SELECT from the view without
an ORDER BY always return rows according to the ORDER BY in the view,
but that is mere chance. In SQL 2005, this does not happen.

The only way to get sorted output from a query in SQL (no matter the
engine) is to have an ORDER BY clause in the SELECT statment that
outputs the data to the client.

> returning
> Outing Number Outing ID
> # of laps
> 6 {87C29BDC-A2D1-4606-A87B-D456F702BFCE} 99
> 5 {203319A9-4B2F-406A-9454-0DD3D5F86211} 37
> 4 {B6306DF5-5BF0-4456-8E06-0CD2ED8B1874} 54
> 3 {A70643F3-28C2-47CC-B623-4BD6904C2825} 95
> 2 {EB409D12-C79C-4D96-BE2A-0BD49C5BE69D} 80
> 1 {75D7793D-3239-4544-BACC-84EB564C8638} 36
> what I woud like is
> Outing Number Outing ID
> # of laps # of laps previousouting
> 6 {87C29BDC-A2D1-4606-A87B-D456F702BFCE} 99 37
> 5 {203319A9-4B2F-406A-9454-0DD3D5F86211} 37 54
> 4 {B6306DF5-5BF0-4456-8E06-0CD2ED8B1874} 54 95
> 3 {A70643F3-28C2-47CC-B623-4BD6904C2825} 95 80
> 2 {EB409D12-C79C-4D96-BE2A-0BD49C5BE69D} 80 36
> 1 {75D7793D-3239-4544-BACC-84EB564C8638} 36 0
> sorry if this is a silly question I'm a little new to this thanks for
> any help

SELECT MO.OutingNumber, MO.OutingID,
COUNT(L.LapTime) AS [# of laps],
COUNT(L2.LapTime) AS [# of prev laps],
FROM dbo.vwOutings MO
JOIN dbo.vwLaps L ON MO.OutingID = dbo.vwLaps.OutingID
LEFT JOIN (dbo.vwOutings MO2
JOIN dbo.vwLaps L2 ON MO2.OutingID = L2.OutingID)
ON MO.OutingNumber = MO2.OutingNumber + 1
GROUP BY MO.OutingNumber, MO.OutingID

Bur this is a complete guess about what your tables and data are like. If
it does not work out, please post:

o CREATE TABLE statements for your tables.
o INSERT statements with the sample data.

Some narrative how the tables are organised would help too.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Sunday, March 11, 2012

Calling a stored procedure and pass parameter one by one

Hi,

I need to create a batch process which calls a stored procedure.

Here's the scenario.

I have 3 tables

Theater - TheaterId, TheaterName, Revenues,locationid, stateid
State - StateId, StateName
Location - LocationId, LocationName, StateId

There is a stored procedure spoc_updateTheater that accepts the state and location id and runs a set of sql statements against the theater table. However i want this to run for all the locations in a state one by one. There are some 700 locations in 45 states. How do i pass the location and state id one by one to the stored proc. Can i call this from a commandline or run it as batch process?

vidkshi

You will have iterate through the filtered data of the first procedure and execute the procedure one by one, the is no command to do this you will have to do that manually. Would look like the following pseudo code.

TableContent = YouSelectquery

Loop throught the data and pick one row per iteration
{

Execute your procedure with the values from the picked rows.

}

You can either do this using a cursor (preferable fast forward / read ony if you do not want to change anything) or use a tamp table.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Hi,

I will appreciate if someone could tell me the sql for it :

Here's the Theater table and the data. I want to loop through every state and location in the state/location tables and pass that stateid locationid to the stored proc.

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Theater]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Theater](
[TheaterId] [int] NULL,
[TheaterName] [nchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Revenues] [bigint] NULL,
[StateId] [int] NULL,
[LocationId] [int] NULL
)
END
GO
INSERT [dbo].[Theater] ([TheaterId], [TheaterName], [Revenues], [StateId], [LocationId]) VALUES (1, N'T1 ', 10000, 1, 1)
INSERT [dbo].[Theater] ([TheaterId], [TheaterName], [Revenues], [StateId], [LocationId]) VALUES (2, N'T2 ', 2333, 1, 1)
INSERT [dbo].[Theater] ([TheaterId], [TheaterName], [Revenues], [StateId], [LocationId]) VALUES (3, N'T3 ', 234234, 1, 1)
INSERT [dbo].[Theater] ([TheaterId], [TheaterName], [Revenues], [StateId], [LocationId]) VALUES (4, N'T4 ', 43454, 1, 2)
INSERT [dbo].[Theater] ([TheaterId], [TheaterName], [Revenues], [StateId], [LocationId]) VALUES (5, N'T5 ', 4454, 1, 2)
INSERT [dbo].[Theater] ([TheaterId], [TheaterName], [Revenues], [StateId], [LocationId]) VALUES (6, N'T6 ', 11132, 2, 1)
INSERT [dbo].[Theater] ([TheaterId], [TheaterName], [Revenues], [StateId], [LocationId]) VALUES (7, N'T7 ', 345, 2, 1)
INSERT [dbo].[Theater] ([TheaterId], [TheaterName], [Revenues], [StateId], [LocationId]) VALUES (8, N'T8 ', 675445, 2, 2)
INSERT [dbo].[Theater] ([TheaterId], [TheaterName], [Revenues], [StateId], [LocationId]) VALUES (9, N'T9 ', 344556, 3, 1)
INSERT [dbo].[Theater] ([TheaterId], [TheaterName], [Revenues], [StateId], [LocationId]) VALUES (10, N'T10 ', 23234, 3, 1)

vidkshi|||

What about:

Code Snippet

CREATE PROCEDURE spUpdateTheater

/*

Written by Jens K. Suessmeyer (c) http://www.sqlserver2005.de

*/

AS

BEGIN

SET NOCOUNT ON

DECLARE @.TheaterData Table

(

COUNTER INT IDENTITY(1,1),

Theaterid INT NULL,

StateId INT NULL

)

DECLARE @.ROWCOUNT INT

DECLARE @.I INT

SET @.I = 1

DECLARE @.Theaterid INT

DECLARE @.StateId INT

INSERT INTO @.TheaterData

(

Theaterid,

StateId

)

SELECT DISTINCT

TheaterId,

Stateid

FROM Theather

SET @.ROWCOUNT = @.@.ROWCOUNT

WHILE @.I <= @.ROWCOUNT

BEGIN

SELECT

@.Theaterid = TheaterId,

@.StateId = Stateid

FROM @.TheaterData

WHERE COUNTER = @.ROWCOUNT

EXEC spExecuteYourUpdateProcedure @.Theaterid,@.StateId

SET @.I = @.I +1

END

END

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Hi,

Thanks for the code. I was wondering why you added the theater id and stateid in the temp table whereas it had to be stateid and locationid. Anyways i changd your query to look like this. I also tried running your stored proc as is but with no results.

Code Snippet

ALTER PROCEDURE [dbo].[spUpdateTheater]
/*

Written by Jens K. Suessmeyer (c) http://www.sqlserver2005.de

*/

AS

BEGIN

SET NOCOUNT ON

DECLARE @.TheaterData Table

(

COUNTER INT IDENTITY(1,1),

Locationid INT NULL,

StateId INT NULL

)

DECLARE @.ROWCOUNT INT

DECLARE @.I INT

SET @.I = 1

DECLARE @.Locationid INT

DECLARE @.StateId INT

INSERT INTO @.TheaterData

(

Locationid,

StateId

)

SELECT DISTINCT

LocationId,

Stateid

FROM Theater

select * from @.TheaterData

SET @.ROWCOUNT = @.@.ROWCOUNT

WHILE @.I <= @.ROWCOUNT

BEGIN

SELECT

@.Locationid = LocationId,

@.StateId = Stateid

FROM @.TheaterData

WHERE COUNTER = @.ROWCOUNT

EXEC spoc_Theater @.StateId, @.Locationid

SET @.I = @.I +1

END

END

My store proc spoc_updatetheater looks like this

Code Snippet

ALTER proc [dbo].[spoc_Theater]
@.stateid int,
@.locid int
as
update theater
set revenues = 20000
where stateid = @.stateid and locationid = @.locid
and revenues > 10000

I tried running it however I see there is no change in the Theater table after the query executes.

Any reasons?

Vids

|||

Yes, you are right and in addition you should change the

Code Snippet

WHERE COUNTER = @.ROWCOUNT

to

Code Snippet

WHERE COUNTER = @.I

Jens K. Suessmeyer

http://www.sqlserver2005.de
|||

Cool. thanks.

you also mentioned that the same query could be written using a cursor. What advantage will i get.

In this query we are creating a temporary table, filling data and looping through it. I expect around 5000 different combinations of state and location id in this temporary table. Will it be ok from a performance point to use the temporary table?

Cant i just use the location table as it will contain a distinct location and state combination. So instead of the temp table, i just loop through the location table and execute the proc for each combination of location and state. How will we do this using a cursor and how will it improve performance?

Vidkshi.

|||

I guess you won′t recognize the difference with 5000 rows. You can sure switch over to the locations tables.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||I don't have an answer to your question but you might want to consider removing the stateid from your Theater table as it violates 3rd normal form.

Theater - TheaterId, TheaterName, Revenues,locationid, stateid
State - StateId, StateName
Location - LocationId, LocationName, StateId

Calling a stored proc/UDF with results from another

Hi all - I'm sure this is a silly, obvious question, but I'm having some
trouble..
Let's say I have three tables: Events, People and EventsPeople.
EventsPeople is a join-table that represents the people associated with each
event.
I have a GetPerson stored procedure that takes a personId as a parameter and
returns the record for that person. I'm trying to reuse this logic from a
GetPeopleInEvent stored procedure, and I'm not sure how to do this w/o a
cursor:
I'm trying to do this:
select * from people
where personId in
(select personId
from eventspeople
where eventId = @.eventId)
But I want to get rid of the 'select * from people* part and replace it with
something like this:
select *
from Func_Person_GetPerson(personId)
where personId in
(select personId
from eventspeople
where eventId = @.eventId)
where Func_Person_GetPerson is a user-defined function. This, of course,
doesn't work - the parameter 'personId' isn't defined in the FROM clause.
Any ideas on the best way to do this?
Thanks,
PhilWhy not
SELECT p.[Name] FROM People p
INNER JOIN EventsPeople e ON e.PersonID = p.PersonId
WHERE e.eventID = @.eventId
assuming you have a [Name] column in People that stores the full name of the
person. Whatever statements you use in your sp to retreive the name for a
given PersonID, put them in the above to get the name directly in one query,
instead of using a udf.
Also think about using joins instead of sub-queries and the IN clause; you
will likely see much better performance in your queries.
"PMarino" wrote:

> Hi all - I'm sure this is a silly, obvious question, but I'm having some
> trouble..
> Let's say I have three tables: Events, People and EventsPeople.
> EventsPeople is a join-table that represents the people associated with ea
ch
> event.
> I have a GetPerson stored procedure that takes a personId as a parameter a
nd
> returns the record for that person. I'm trying to reuse this logic from a
> GetPeopleInEvent stored procedure, and I'm not sure how to do this w/o a
> cursor:
> I'm trying to do this:
> select * from people
> where personId in
> (select personId
> from eventspeople
> where eventId = @.eventId)
> But I want to get rid of the 'select * from people* part and replace it wi
th
> something like this:
>
> select *
> from Func_Person_GetPerson(personId)
> where personId in
> (select personId
> from eventspeople
> where eventId = @.eventId)
> where Func_Person_GetPerson is a user-defined function. This, of course,
> doesn't work - the parameter 'personId' isn't defined in the FROM clause.
> Any ideas on the best way to do this?
>
> Thanks,
> Phil
>|||I like it the way you didi it before Whats wrong with this for you ?
Like you mentioned a table function based on a column in the resultset
won=B4t work.
HTH, Jens Suessmeyer.|||As usual, I didn't give ALL of the information ;-)
I actually have several tables with join tables to People. Plus, the People
table has additional attributes - Names, PhoneNumbers, etc. I was trying to
centralize the 'GetPerson' logic, but it doesn't look like I'll be able to d
o
that easily.
"Jens" wrote:

> I like it the way you didi it before Whats wrong with this for you ?
> Like you mentioned a table function based on a column in the resultset
> won′t work.
> HTH, Jens Suessmeyer.
>

Wednesday, March 7, 2012

call stored procedure and populate sql ce tables

I'm coding in a black hole that has a moving target in it.

Ok, I now need to call an stored procedure and with the results from the stored procedure I need to populate my tables on my handheld.

Any ideas on how I can do this? I was using inline sql "select col1, col2, from table1" and doing my rda pull from that, but now I need to call stored procedures to do this and one sp takes a parameter. How can I accomplish this on handheld ?

Pull without tracking and use "exec sp_name <param1value>, <param2value>"

Saturday, February 25, 2012

call a Oracle stored proc in SQL SERVER

We have set up Oracle database as a linked server in SQL Server.
We are able to access Oracle tables fine.

I am trying to call a Oracle stored procedure in SQL Server as follows:
declare @.p1 varchar(1000)
set @.p1 = 'HHH'
exec GENRET..OPS$GENRET.BOB_TEST_PROC @.p1

This is the message:
Server 'GENRET' is not configured for RPC.

Please help.
Thanks in advance
vv (vanishri16@.yahoo.com) writes:
> We have set up Oracle database as a linked server in SQL Server.
> We are able to access Oracle tables fine.
> I am trying to call a Oracle stored procedure in SQL Server as follows:
> declare @.p1 varchar(1000)
> set @.p1 = 'HHH'
> exec GENRET..OPS$GENRET.BOB_TEST_PROC @.p1
> This is the message:
> Server 'GENRET' is not configured for RPC.

exec sp_serveroption GENRET, 'rpc', true
exec sp_serveroption GENRET, 'rpc out', true

may be a start.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Calendar Table

>> Hey Celko, didn't you once say you were going to write some stuff on
auxiliary tables? Haven't seen that yet... :) <<
I am banging away on the third edition of SQL FOR SMARTIES right now,
with a new and improved auxiliary tables chapter in it.
Minor design points:
1) do not use flags for each date type, but invent a single encoding
for holidays, workdays, etc. Leave room in the code for expansion, say
you have 100's for holidays, 110's for civil holdiays, 120's for
religious holidays, etc.
2) I prefer a BETWEEN predicate over comparisons (cal_date BETWEEN
order_complete_date AND order_ship_date), becuase it reads better for
someone maintaining the code.
But it also means I have to have constraints on the columns to adjust
the time part of the DATETIME columns to midnight today or a
microsecond before the next day.On 22 Jan 2005 11:48:16 -0800, --CELKO-- wrote:

>auxiliary tables? Haven't seen that yet... :) <<
>I am banging away on the third edition of SQL FOR SMARTIES right now,
>with a new and improved auxiliary tables chapter in it.
>Minor design points:
>1) do not use flags for each date type, but invent a single encoding
>for holidays, workdays, etc. Leave room in the code for expansion, say
>you have 100's for holidays, 110's for civil holdiays, 120's for
>religious holidays, etc.
Hi Joe,
This doesn't sound like a design I'd be too happy with.
First, the difference between civil holidays and religious holidays is
often not important at all. People shouldn't clutter their databases with
unimportant information.
Second, if this distinction is important, it is still a seperate attribute
(holiday_type). Trying to encode this distinct attribute into a numeric
range is a vioaltion of 1NF.
Third, using a meaningless, unverifiable numeric code for holidays is not
needed at all. At this point, I'm tempted to ask if you also believe that
God put a 17-letter hebrew number to everything in Creation. What's wrong
with calling St.Patrick's Day St. Patrick's Day, New Years Day New Years
Day and Christmas Christmas?

>2) I prefer a BETWEEN predicate over comparisons (cal_date BETWEEN
>order_complete_date AND order_ship_date), becuase it reads better for
>someone maintaining the code.
>But it also means I have to have constraints on the columns to adjust
>the time part of the DATETIME columns to midnight today or a
>microsecond before the next day.
But since the precision of date and time datatypes are not specified in
SQL-92 (at least not that I'm aware of), the microsecond before the next
day might get rounded up - and then your BETWEEN won't work. You'd have to
adjust the contents of the time table whenever you port your code.
Would you really throw away portability for "better reading" (which is
very subjective to boot)?
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||On 22 Jan 2005 14:01:55 -0800, --CELKO-- wrote:

> While
> in most cases, civil versus religious is not really needed unless you
> are being sued for discrimination, I can imagine wanting to know if a
> work-day called off for bad weather.
I can imagine running a db for a diverse organization, where some
departments get all holidays, others only get civil. Or where when an
employee takes off day X, you credit it to a holiday category if it is a
religious holiday even if it is not a standard company holiday (a variation
on your discrimination idea I guess). Anyway, I suppose the point could be
argued, but without business requirements there's not much point in
arguing.

Friday, February 24, 2012

Calendar dimension with multiple Fiscal calendars

I am building a data warehouse using the dimensional model -- i.e. fact and
dimensional tables in a star schema.
For my Calendar dimension, I want to include Fiscal periods, but the data
warehouse has data for different clients that have different fiscal calendars.
How do I handle that ?
If I understand well, you have:
Customer A - 15/10/2006 - CY 2006 FY 2007
Customer A - 30/09/2006 - CY 2006 FY 2006
Customer B - 15/10/2006 - CY 2006 FY 2006
Customer B - 15/10/2006 - CY 2006 FY 2006
You want to see FY 2006 data where FY is the one specific for each
customer.
If this is the case, I think the right model is to have one Fiscal
Calendar dimension (with FY Year, FY MonthNumber, FY QuarterNumber)
that is linked to the fact table.
Of course this model doesn't support you if you want to change the FY
of a Customer without changing the data already loaded into the fact
table.
Marco Russo
http://www.sqlbi.eu
http://www.sqljunkies.com/weblog/sqlbi
Craig HB wrote:
> I am building a data warehouse using the dimensional model -- i.e. fact and
> dimensional tables in a star schema.
> For my Calendar dimension, I want to include Fiscal periods, but the data
> warehouse has data for different clients that have different fiscal calendars.
> How do I handle that ?

Calendar dimension with multiple Fiscal calendars

I am building a data warehouse using the dimensional model -- i.e. fact and
dimensional tables in a star schema.
For my Calendar dimension, I want to include Fiscal periods, but the data
warehouse has data for different clients that have different fiscal calendar
s.
How do I handle that ?If I understand well, you have:
Customer A - 15/10/2006 - CY 2006 FY 2007
Customer A - 30/09/2006 - CY 2006 FY 2006
Customer B - 15/10/2006 - CY 2006 FY 2006
Customer B - 15/10/2006 - CY 2006 FY 2006
You want to see FY 2006 data where FY is the one specific for each
customer.
If this is the case, I think the right model is to have one Fiscal
Calendar dimension (with FY Year, FY MonthNumber, FY QuarterNumber)
that is linked to the fact table.
Of course this model doesn't support you if you want to change the FY
of a Customer without changing the data already loaded into the fact
table.
Marco Russo
http://www.sqlbi.eu
http://www.sqljunkies.com/weblog/sqlbi
Craig HB wrote:
> I am building a data warehouse using the dimensional model -- i.e. fact an
d
> dimensional tables in a star schema.
> For my Calendar dimension, I want to include Fiscal periods, but the data
> warehouse has data for different clients that have different fiscal calend
ars.
> How do I handle that ?

Calculations involving fields from different tables

Is it possible to perform a calculation with fields from different tables on
the same report? If so, what syntax is used to reference each field?
DavidYou need to reference the scope in the field. so, like
First(Fields!FieldName.Value, "DatasetName") or Sum(Fields!
FieldName.Value, "DataSetName")
>--Original Message--
>Is it possible to perform a calculation with fields from
different tables on
>the same report? If so, what syntax is used to reference
each field?
>David
>.
>

Calculations across semi-related fact tables

Using the AdventureWorks database as an example:

If I create a calculated measure that is the sum of total sales across InternetSales and ResellerSales, how do I ensure that when I am browsing the cube, that my total sales value is always accurate even when I filter the cube on a dimension that applies to one fact table, but not the other.

For example, if I am browsing the cube by Sales Territory and I apply a filter on a specific Reseller Type (for instance Warehouse), then I would expect that for Sales Territories that did not have ResellerSales with a Reseller Type of Warehouse, the value displayed for Total Sales would be blank.

However, because the non-empty behavior for the calculation is the combination of InternetSales and Reseller Sales, the InternetSales value will always be displayed (even though it does not make sense based on the filter).

Is there a way to change this behavior?

I ran the following query against an unmodified version of the Adventure Works DW database:

Code Snippet

with member [Measures].[x] as

[Measures].[Reseller Sales Amount] +

[Measures].[Internet Sales Amount]

select

{

[Measures].[Reseller Sales Amount],

[Measures].[Internet Sales Amount],

[Measures].[x]

} on 0,

Geography.Country.Members on 1

from [Adventure Works];

At the All Geographies member of the Country attribute hierarchy, Internet Sales Amount had a value of $29M. Against individual countries, this same $29M figure was repeated as the Internet Sales measure group has no relationship with this dimension. If you think about how SSAS handles cube space definition, this makes sense even though it is counter-intuitive to most users.

Then, the question is how is the calculated member [x] handled? The $29M is added to whatever value for Reseller Sales Amount is returned.

I then went into the cube designer in BIDS for the Adventure Works cube, selected the Internet Sales measure group, and then pulled up its properties. I set IgnoreUnrelatedDimensions to False and reprocessed the cube. When I executed the query again, I got the same $29M for the All Geographies member, but NULL for its children. The calculated member [x] reflected $29M + Reseller Sales Amount for the All Geographies member and just Reseller Sales Amount for the other members.

Bryan

Thursday, February 16, 2012

Calculating values in multiple tables within a UDF in SQL server

Hi,
I'm using scalar UDFs in SQL server to return computed values. I've been trying to use the same udfs to perform the same computations but from different tables, but I'm not sure how. Can someone please help?

Here's an example of a counter that I'm using to return the number of days.

CREATE FUNCTION [dbo].[MarketPulse_fn_Counter] (@.date smalldatetime, @.date2 smalldatetime, @.osid int)

RETURNS int AS

BEGIN

return (select count(*) from MarketPulse_0ndqc
where stockosid = @.osid and createdate <= @.date and createdate >=@.date2 )

END

How can I use this same UDF to do the same computation but to SELECT from another table and return that value?You would have to use dynamic SQL, which off the top of my head I am not sure is even allowed in a UDF (perhaps with some limitations), but I am sure it is not a good idea...|||If you are only choosing between a few tables you could pass through another parameter which indicates which table you want to query and then use it to choose which statement will run.
e.g.
if @.parm = 1 then
select ... from tableA
else if @.parm = 2 then
select ... from tableB
...
Or you could use a case statement.

Personally I am rather fond of dynamic SQL. Since I don't have my BOL on this machine I have no idea whether its use is possible in UDFs either.|||I don't know of any way to use dynamic SQL via Transact-SQL within a UDF. You can't use EXECUTE ('dynamic sql') and you can't execute sp_executesql either.

-PatP|||Hi,
I'm using scalar UDFs in SQL server to return computed values. I've been trying to use the same udfs to perform the same computations but from different tables, but I'm not sure how. Can someone please help?

Here's an example of a counter that I'm using to return the number of days.

CREATE FUNCTION [dbo].[MarketPulse_fn_Counter] (@.date smalldatetime, @.date2 smalldatetime, @.osid int)

RETURNS int AS

BEGIN

return (select count(*) from MarketPulse_0ndqc
where stockosid = @.osid and createdate <= @.date and createdate >=@.date2 )

END

How can I use this same UDF to do the same computation but to SELECT from another table and return that value?

You know, your example is NOT returning a computed value. It is just returning an aggregation. A subtle point, maybe, but are you sure the UDFs are really appropriate for this task?

Most, (though not all) of the scalar UDFs I have written do not query underlying tables except possibly for configuration values.

Calculating the size of a table in a db

If I have a database with a list of tables is there a way to calculate the size of each table individually and
then calculate the size all the tables. If you have 1 table with say 10 rows and 3 columns and the width of the
columns are of variable length you could do something like

( column1width + column2width + column3width ) * No.of Rows = Tablesize

So my question is can I reference the column width of different columns in a
table using sql ?

Another issue is that some of the columns are different datatypes so I should be taking that
into consideration as well.

From searching the internet so far I have seen little on SQL showing how to
reference column width in a table.read about sp_spaceused in Books online|||Yes sp_spaceused is the way to go else see Estimating the Size of a Table (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_02_92k3.asp) in Books online|||If you have 1 table with say 10 rows and 3 columns and the width of the
columns are of variable length you could do something like

( column1width + column2width + column3width ) * No.of Rows = Tablesize

In addition to the above comments (and it is clear if you read one of the links) this is wrong. For variable length columns the size if dependent on their contents.

So my question is can I reference the column width of different columns in a
table using sql ?
have a look at INFORMATION_SCHEMA.COLUMNS|||Ya sp_spaceused is good but is there a way I can get a breakdown of how much space is being taken up by each table in the database.

So my Database object is called DBStore and it contains tables
Table1
Table2
Table3 etc... It would be great if I could see what stats on each table...

This is the query that I have used myself but I'm not sure if it works because some of the tables that have 0 rows are saying that there is data in them.
See what you guys think anyway ? Look forward to your feedback ?

select a.name as "NAME",a.xtype as "XTYPE", sum(b.length) * count(*) as "TABLE SIZE"
from sysobjects a, syscolumns b, systypes c
where a.id=b.id -- Table ID = Column ID
and b.xtype = c.xtype
and a.name like '%'
and a.xtype = 'U'
group by a.name,a.xtype
order by "TABLE SIZE";|||select the database then use view-> Taskpad in sql enterprise manager. Then it will list out the space occuoied by each table in your database.

Calculating table size

I have a BIG database with 8 tables growing rapidly. I would like to estimate the size of a row in disk space so I can predict how big my bd will grow in time. I know the math to calculate this but I'm look for a tool to automate this task. A tool that takes into accout calculating index size aside from table size.

I would really apreciate any help on this.

regards

? Since you already have the tables, with rows of real data, I think you can do better than an estimation tool. Take the current table size: EXEC sp_spaceused 'yourTable' ... then get the number of rows: SELECT COUNT(*) FROM yourTable ... and divide. This will give you a much more realistic estimate than any tool can. -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <Jorge González@.discussions.microsoft.com> wrote in message news:acc81bad-c554-4d2b-8289-fb1482786568@.discussions.microsoft.com... I have a BIG database with 8 tables growing rapidly. I would like to estimate the size of a row in disk space so I can predict how big my bd will grow in time. I know the math to calculate this but I'm look for a tool to automate this task. A tool that takes into accout calculating index size aside from table size. I would really apreciate any help on this. regards|||

The Disk Usage report in SQL Server Management Studio shows you the current size of your database breaking down the statistics by table, row size, index, partitions, etc.

I'm putting together a blog series on Management Studio reports. In the first post, I put together a 2 minute demo of how to view the reports and export them to Microsoft Excel 2007.

http://blogs.msdn.com/sqlrem/archive/2006/05/16/SSMS_Reports_1.aspx

-Paul

|||? Hi Paul, I'll check out your webcast, but I'd just like to give a bit of feedback on the reports themselves. Although I really love the look and feel and depth of content of these reports, I find that they're too heavy to run on a busy production server -- especially one with a lot of databases and/or a lot of tables. Would it be possible to modify the reports for a future release such that the drill-down data is "lazy loaded" on demand? This would make the reports a lot more useable for enterprise scenarios. -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <Paul Mestemaker - MSFT@.discussions.microsoft..com> wrote in message news:7fb4862e-7192-496e-b484-e1547a88728d@.discussions.microsoft.com... The Disk Usage report in SQL Server Management Studio shows you the current size of your database breaking down the statistics by table, row size, index, partitions, etc. I'm putting together a blog series on Management Studio reports. In the first post, I put together a 2 minute demo of how to view the reports and export them to Microsoft Excel 2007. http://blogs.msdn.com/sqlrem/archive/2006/05/16/SSMS_Reports_1.aspx -Paul|||

I apologize for the delay in response, I have not setup the alerts properly.

We are somewhat limited in how we can load data into the ReportViewer control in Management Studio. There are two ways the control supports an interactive experience.

Drill-in
This is what we do today. We load in all of the data we need to render the report and show/hide information giving a simulated interactive experience.
|||

Hi Jorge,

You can try the following script on SQL 2000 / 2005

CREATE TABLE #SpaceUsed (name sysname,rows bigint,reserved sysname,data sysname,index_size sysname,unused sysname)

DECLARE @.Counter int
DECLARE @.Max int
DECLARE @.Table sysname

SELECT name, IDENTITY(int,1,1) ROWID
INTO #TableCollection
FROM sysobjects
WHERE xtype = 'U'
ORDER BY lower(name)

SET @.Counter = 1
SET @.Max = (SELECT Max(ROWID) FROM #TableCollection)

WHILE (@.Counter <= @.Max)
BEGIN
SET @.Table = (SELECT name FROM #TableCollection WHERE ROWID = @.Counter)
INSERT INTO #SpaceUsed
EXECUTE sp_spaceused @.Table
SET @.Counter = @.Counter + 1
END

SELECT * FROM #SpaceUsed

DROP TABLE #TableCollection
DROP TABLE #SpaceUsed

Regards

Calculating table size

I have a BIG database with 8 tables growing rapidly. I would like to estimate the size of a row in disk space so I can predict how big my bd will grow in time. I know the math to calculate this but I'm look for a tool to automate this task. A tool that takes into accout calculating index size aside from table size.

I would really apreciate any help on this.

regards

? Since you already have the tables, with rows of real data, I think you can do better than an estimation tool. Take the current table size: EXEC sp_spaceused 'yourTable' ... then get the number of rows: SELECT COUNT(*) FROM yourTable ... and divide. This will give you a much more realistic estimate than any tool can. -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <Jorge González@.discussions.microsoft.com> wrote in message news:acc81bad-c554-4d2b-8289-fb1482786568@.discussions.microsoft.com... I have a BIG database with 8 tables growing rapidly. I would like to estimate the size of a row in disk space so I can predict how big my bd will grow in time. I know the math to calculate this but I'm look for a tool to automate this task. A tool that takes into accout calculating index size aside from table size. I would really apreciate any help on this. regards|||

The Disk Usage report in SQL Server Management Studio shows you the current size of your database breaking down the statistics by table, row size, index, partitions, etc.

I'm putting together a blog series on Management Studio reports. In the first post, I put together a 2 minute demo of how to view the reports and export them to Microsoft Excel 2007.

http://blogs.msdn.com/sqlrem/archive/2006/05/16/SSMS_Reports_1.aspx

-Paul

|||? Hi Paul, I'll check out your webcast, but I'd just like to give a bit of feedback on the reports themselves. Although I really love the look and feel and depth of content of these reports, I find that they're too heavy to run on a busy production server -- especially one with a lot of databases and/or a lot of tables. Would it be possible to modify the reports for a future release such that the drill-down data is "lazy loaded" on demand? This would make the reports a lot more useable for enterprise scenarios. -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <Paul Mestemaker - MSFT@.discussions.microsoft..com> wrote in message news:7fb4862e-7192-496e-b484-e1547a88728d@.discussions.microsoft.com... The Disk Usage report in SQL Server Management Studio shows you the current size of your database breaking down the statistics by table, row size, index, partitions, etc. I'm putting together a blog series on Management Studio reports. In the first post, I put together a 2 minute demo of how to view the reports and export them to Microsoft Excel 2007. http://blogs.msdn.com/sqlrem/archive/2006/05/16/SSMS_Reports_1.aspx -Paul|||

I apologize for the delay in response, I have not setup the alerts properly.

We are somewhat limited in how we can load data into the ReportViewer control in Management Studio. There are two ways the control supports an interactive experience.

Drill-in
This is what we do today. We load in all of the data we need to render the report and show/hide information giving a simulated interactive experience.
|||

Hi Jorge,

You can try the following script on SQL 2000 / 2005

CREATE TABLE #SpaceUsed (name sysname,rows bigint,reserved sysname,data sysname,index_size sysname,unused sysname)

DECLARE @.Counter int
DECLARE @.Max int
DECLARE @.Table sysname

SELECT name, IDENTITY(int,1,1) ROWID
INTO #TableCollection
FROM sysobjects
WHERE xtype = 'U'
ORDER BY lower(name)

SET @.Counter = 1
SET @.Max = (SELECT Max(ROWID) FROM #TableCollection)

WHILE (@.Counter <= @.Max)
BEGIN
SET @.Table = (SELECT name FROM #TableCollection WHERE ROWID = @.Counter)
INSERT INTO #SpaceUsed
EXECUTE sp_spaceused @.Table
SET @.Counter = @.Counter + 1
END

SELECT * FROM #SpaceUsed

DROP TABLE #TableCollection
DROP TABLE #SpaceUsed

Regards

Tuesday, February 14, 2012

Calculating problem in tables

Hi,
in my report I have two tables, that look like this
--table1
x y z (=y-x) where x is a database field, y is a hard number
en z is the result of y-x
--table2
x y z (=y-x) where x is a database field, y is a hard number
en z is the result of y-x
--
I want to sum the x, y and z values in another table.
the sum of the database field (x) isn't a problem, but
the sum of y and z doesn't work,
I've tried this: (textbox1.Value, "table1")+(textbox2.Value, "table2")
but it's not possible to do this with textboxes.
Can anyone help me with this problem?Dirkjan van Groeningen wrote:
> I've tried this: (textbox1.Value, "table1")+(textbox2.Value, "table2")
> but it's not possible to do this with textboxes.
> Can anyone help me with this problem?
I dont know...have you tried an expression like this?
=Fields!textbox1.Value + Fields!textbox2.value
regards
Frank
www.xax.de|||Hi Frank,
I've tried it, even with the expression , "table1" behind the textboxes to
set the dataset scope. Got the following error
The value expression for the textbox â'textbox11â' refers to the field
â'textbox9â'. Report item expressions can only refer to fields within the
current data set scope or, if inside an aggregate, the specified data set
scope.
"Frank Matthiesen" wrote:
> Dirkjan van Groeningen wrote:
> > I've tried this: (textbox1.Value, "table1")+(textbox2.Value, "table2")
> > but it's not possible to do this with textboxes.
> >
> > Can anyone help me with this problem?
> I dont know...have you tried an expression like this?
> =Fields!textbox1.Value + Fields!textbox2.value
> regards
> Frank
> www.xax.de
>
>|||Try:
=ReportItems!textbox1.Value + ReportItems!textbox2.value
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Frank Matthiesen" <fm@.xax.de> wrote in message
news:34i2d5F4aqquuU1@.individual.net...
> Dirkjan van Groeningen wrote:
>> I've tried this: (textbox1.Value, "table1")+(textbox2.Value, "table2")
>> but it's not possible to do this with textboxes.
>> Can anyone help me with this problem?
> I dont know...have you tried an expression like this?
> =Fields!textbox1.Value + Fields!textbox2.value
> regards
> Frank
> www.xax.de
>

Calculating last non empty of measures that are not included in a month

Hi!

I have two tables.

One is measures like this

Product Measure Date

Prod A 10 12, Jan 2006

Prod A 15 20, Jan 2006

Prod A 11 5, Mar 2006

The other is time dimension

When I create a cube, I would like to see by months last value of measure.

So in Feb I should get 15.

My question is - should I create a query and run it on server to

1. Find which months are not icluded in measuers

2. Then find last value for each product

3. Write into new table measures, where February will have last non empty value from January?

Or can I do it cube in some way?

The best way to solve this in AS2005 is to define measure aggregation function as LastNonEmpty - it will do exactly what you need.

Sunday, February 12, 2012

Calculating between 2 tables in one report

Goodmorning,

In one report I have 2 tables. Both tables are related to a different data set. Now I want to create a calculating between a field of the table 1 and a field of table 2.

Does anyone know how to?

Thx anyway!

I have the same problem.

My tables(matrices) look like this:

Revenue Report(matrix)

Jan Feb Mar .........

Account 1 $100 $200

Account 2 $50 $300

Subtotal $150 $500

Expense Report (matrix)

Jan Feb Mar .........

Account 1 $100 $100

Account 2 $0 $300

Subtotal $100 $400

Grand Total $50 $100

I need the Grand Total for each month (subtract Expense subtotal from Revenue subtotal)

|||

Both of you can use this AMAZING trick! Very powerful.

Simply store the totals of your first table in a dictionary, do the same for your second table. Then, to get the grand total simply retrieve the values and add them up.

Here is a link to a post that will explain you what I mean by 'dictionary':

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1129743&SiteID=1

|||

Thx Choquette for your answer!

I've used my free weekend for devolping a different solution. Its only usefull for my specific situation. In short: I've created a new dataset, summing the totals of that new dataset en used it in my calculation.

If I have the time I would absolutely try your suggestion. Thx again!

Friday, February 10, 2012

Calculating a dataset depending on a parameter in a report

Dear all
I have a SSRS report getting data from a cube. It has 3 tables and 3
different datasets linked to these tables. One table shows all members of one
dimension. Therefore this dataset requires most of the processing time.
I want to give the user a possibility inside this report to choose if he
wants to see all the members or not. Well one easy way would be to make 2
Reports. Another way more elegant way would be to define a report parameter
which will hold a part of a mdx querry that will be used in this dataset:
- [Suppliers].[Key].[All]
- [Suppliers].[Key].members
Inside the dataset I use the STRTOSET function with this parameter.
My problem is now that the first mdx querry let the column Key disappear
inside the dataset and therefore I get a error message while displaying the
report one table is referring an inexistent field.
Do you have an idea to solve this problem or do you see another approach?
Regards,
MarcHello Marc,
My understanding is that your customer wants to have an option to show the
Key field in the Report or not. And you wants to use a parameter in the
dataset MDX query to control the dataset. If I misunderstood your concern,
please feel free to let me know.
Well, since your dataset definition have been modified by the parameter,
you will lost the Key field in the dataset. That of course will cause an
error.
One workaround is using the subreport in the report and include 2 subreport
and then use the parameter to control which one to show up.
Also, I think the drilldown feature is another workaround for your
situation.
Hiding Report Items
http://msdn2.microsoft.com/en-us/library/ms157454.aspx
Hope this will be helpful!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hi Wei
Thanks for your answer. Can you explain me your workarounds more in detail?
My problem with one dataset showing all members is that it takes too long to
execute. So I have to give the user control if he wants either more
information but wait or less information and have quick report execution.
Your first workaround using a subreport sounds fine. But I don't know how I
can give a parameter value to the subreport (no function button there).
Hiding report items will not help because the dataset will be filled even
though the report item is hidden.
How does the drilldown feature work?
Thanks for your help,
Regards,
Marc|||Hello Marc,
For the Subreport, you could use the parameter to control its visability
property.
The drilldown feature works like a toggle item.
You could accomplish this by the article I provided in the previous post.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hello Wei
Thanks for your answer. Just hiding a report items does not solve my problem
because a filling of a dataset causes a long execution time. This happens
when a report item is visible or not.
To solve this issue I think I need a way to control which mdx is used to
fill a dataset or which dataset gets executed, both depending on a parameter.
Is there a way to achieve this?
Regards, Marc|||Hello Marc,
Unfortunatly, you could not use the parameter to control which dataset the
report item use.
This is because the layout will refer the fields in the dataset. If the
fields are not match, the layout could not render correctly.
My suggestion is to use the cache to have a better performance of the
report.
Report Caching in Reporting Services
http://msdn2.microsoft.com/en-us/library/ms155927.aspx
Also, if you are developing a ASP.NET web application, you could use the
Report Viewer Control to refer different report in your Web Page.
Hope this information will be helpful!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hi Wei
Thanks for your answer. I solved this problem like you said with a
parameter. This parameter determines if a report item is visible or not.
In the dataset bound to this report item I defined members which get
calculated when the table is shown or just show 0 when the report item is
hidden (case â?¦ when â?¦ thenâ?¦ end).
But I still think this is complicated to achieve and it would be nice to
have a feature that does determine if a dataset gets calculated or not.
And it would be also nice if reporting services would show the all member as
a separate column - right now it gets hidden.
Kind regards,
Marc|||Hello Marc,
Thank you for your reply.
You could send your feedback directly to the product team via the following
web site:
http://connect.microsoft.com/SQLServer
Hope this will be helpful!
Sincerely,
Wei Lu
Microsoft Online Community Support