Showing posts with label specific. Show all posts
Showing posts with label specific. Show all posts

Saturday, February 25, 2012

Call a Stored Procedure within an SQL statement

Hi All,
I created a stored procedure which updates a specific row whose row ID is passed.
But what I want to do now, (which is a one time requirement) is to update all rows
is it possible to call this stored procedure within an sql statement and pass each row ID to it?

(would i have to go to cursor approach -- damn will have to learn that )
thanks

Quote:

Originally Posted by Shashi Sadasivan

Hi All,
I created a stored procedure which updates a specific row whose row ID is passed.
But what I want to do now, (which is a one time requirement) is to update all rows
is it possible to call this stored procedure within an sql statement and pass each row ID to it?

(would i have to go to cursor approach -- damn will have to learn that )
thanks


You can call a function from a SQL statement and not a STORED PROCEDURE.

Restrictions on calling a Function from a SQL statement:

1. Function should not have RETURN TYPE as BOOLEAN
2. Function should not perform any side effects. (ie No DML operations)|||

Quote:

Originally Posted by Shashi Sadasivan

Hi All,
I created a stored procedure which updates a specific row whose row ID is passed.
But what I want to do now, (which is a one time requirement) is to update all rows
is it possible to call this stored procedure within an sql statement and pass each row ID to it?

(would i have to go to cursor approach -- damn will have to learn that )
thanks


if it's a one time thing, can you just write a query in query analyzer to update the field you need? what field are you updating? what kind of update?

Friday, February 10, 2012

Calculated Member to count fact table

Hi,

I'm having problems creating a calculated member to count specific rows of my fact table.

I need the number of rows matching a filter criteria. I tried it with using the filter expression but without any success.

Lets assume the following:

ID ColumnX ColumnY

1 A ABC1

2 B ABC2

3 A DEF1

DimensionX is based on ColumnX

DimensionY is based on ColumnY

Totals is a measure with a row binding lets say count(ID)

TotalsNoBinding is a measure with row binding and NO aggregation (None)

I would assume that a Calculated measure based on

Count(Filter([Measures].[TotalsNoBinding], [DimensionX].[A ]))

would result the count of "rows" affected by filtering the DimensionX by just allowing the Value A.

I guess I have a understanding problem somewhere. I hope someone can give the right hint to fix the problem. What would be the right way to implement this?

Thanks.

ErtanO

Try to use named calculation in datasource view in spite of create calculated member...

regards!

|||

PedroCGD

Thank you...that was the right hint!