Showing posts with label experts. Show all posts
Showing posts with label experts. Show all posts

Wednesday, March 28, 2012

how to get the status of update sucessing?

Dear Experts,

I have a stored procudure which can be successful called from application and update against tables, the question is how do I get the status which can indicate how many records were updated or no any record was updated in the action?

Thanks in advance.

Hi,

@.@.ERROR returns the error number for the last T-SQL statement executed while
@.@.ROWCOUNT returns the number of rows affected by the last SQL statement.

Wednesday, March 21, 2012

How to get the current member in a MDX expression?

Hi, all experts here,

Thank you very much for your kind attention.

I want to know how to get the current member in a MDX expression? (e.g, we want to get the current value'2006' for the time dimension, how can we accompalish this task?)

Hope my question is clear.

With best regards,

Yours sincerely,

There is a function called CurrentMember, but you need to ask for the current member for a given hierarchy or attribute.

eg

[Date].[Calendar].CurrentMember

If you are just after the name of the current member (as in '2006') then you would do something like the following

[Date].[Calendar].CurrentMember.Name|||

Thanks a lot.

Best regards,

Monday, March 12, 2012

How to get running difference with SQL?

Hi, Experts:
I have a question about getting running difference. The difference is
compared with previous week, if no data for previous week, the difference is
null. Any suggestions? Thanks much!
id week weight diff
1 1 100 0
1 2 102 -2
1 3 99 3
2 1 103 0
2 3 102 nullI think this will do what you describe. The one difference is that
the value for week 1 follows the rule specified "if no data for
previous week, the difference is null", while the data shown does not
reflect that. A CASE expression could be used to enforce that week 1
would get zero, but I chose not to complicate the query that much.
SELECT d, week, weight,
(SELECT A.weight - B.weight
FROM Whatever as B
WHERE A.d = B.d
AND A.week = B.week + 1)
FROM Whatever as A
Roy Harvey
Beacon Falls, CT
On Mon, 18 Jun 2007 08:20:00 -0700, luvgreen
<luvgreen@.discussions.microsoft.com> wrote:
>Hi, Experts:
>I have a question about getting running difference. The difference is
>compared with previous week, if no data for previous week, the difference is
>null. Any suggestions? Thanks much!
>id week weight diff
>1 1 100 0
>1 2 102 -2
>1 3 99 3
>2 1 103 0
>2 3 102 null|||Thank you so very much. It is really helpful!!
"Roy Harvey" wrote:
> I think this will do what you describe. The one difference is that
> the value for week 1 follows the rule specified "if no data for
> previous week, the difference is null", while the data shown does not
> reflect that. A CASE expression could be used to enforce that week 1
> would get zero, but I chose not to complicate the query that much.
> SELECT d, week, weight,
> (SELECT A.weight - B.weight
> FROM Whatever as B
> WHERE A.d = B.d
> AND A.week = B.week + 1)
> FROM Whatever as A
> Roy Harvey
> Beacon Falls, CT
> On Mon, 18 Jun 2007 08:20:00 -0700, luvgreen
> <luvgreen@.discussions.microsoft.com> wrote:
> >Hi, Experts:
> >
> >I have a question about getting running difference. The difference is
> >compared with previous week, if no data for previous week, the difference is
> >null. Any suggestions? Thanks much!
> >
> >id week weight diff
> >1 1 100 0
> >1 2 102 -2
> >1 3 99 3
> >2 1 103 0
> >2 3 102 null
>

Wednesday, March 7, 2012

how to get optimized join

Hi Experts,
I have following doubts on join condition
Table 1 primary key (id,sub)
Name id sub marks

xxx 61 maths 45
xxx 61 science 50

another table primary key ( id,language)

id language write
61 english yes
61 Hindi no
Output:
Xxx 61 maths 45 english yes
Xxx 61 maths 45 Hindi no
Xxx 61 science 50 english yes
Xxx 61 science 50 hindi no
how to join these tables to get
every information in 2 rows will it possible

xxx 61 maths 45 English yes
xxx 61 science 50 hindi no

please suggest me to right path
thanking u
please mail to me:nallisalmon@.yahoo.co.in


I don′t see the logic which one has to be excluded from the output results ? Is it just randomly or is there a deeper logic implemented ?

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de