Showing posts with label sp2. Show all posts
Showing posts with label sp2. Show all posts

Wednesday, March 28, 2012

Is this SSAS bug fixed in SP2 ?

Can someone with the SP2 beta installed try the following and tell us if the formatting bug has been fixed (using the provided Adventure Works DB) ?

with member [Measures].[DP] as [Measures].[Reseller Order Quantity] / 1000000000

select [Measures].[DP] on 0,

[Reseller].[Business Type].members on 1

from [Adventure Works]

On SSAS 2005 SP1, I get scientific notation for the 2nd and 3rd rows returned by the query (as in 2.2076E-05)

This is a major issue for us as we tend to run SSAS queries from SQL Server using OPENQUERY.

For instance, the following query fails because of this bug:

select convert(money,isnull(substring("[Measures].[DP]",1,50),0))

from openquery(olapserver,'with member [Measures].[DP] as [Measures].[Reseller Order Quantity] / 1000000000

select [Measures].[DP] on 0,

[Reseller].[Business Type].members on 1

from [Adventure Works]')

This bug is not fixed in SP2 CTP 1 November.

Regards

Thomas Ivarsson

|||

FYI: Results

DP
All Resellers 0.000214378
Specialty Bike Shop 2.2076E-05
Value Added Reseller 8.0309E-05
Warehouse 0.000111993

|||

I appologize, but what is exactly the bug here ?

The results seem to be absolutely correct to me...

|||

There is no bug in AS. It is merely a formatting issue. The following should work as expected.

select convert(money,convert(real,("[Measures].[DP]")))

from openquery(olap,'with member [Measures].[DP] as [Measures].[Reseller Order Quantity] / 1000000000

select [Measures].[DP] on 0,

[Reseller].[Business Type].members on 1

from [Adventure Works]')

|||

It is a bug, there is no reason why the same measure should come back sometimes as a decimal, and sometimes as a real number. The problem seems to be that it refuses to round small numbers to 0.

Try formatting this measure using FORMAT_STRING="#,#" in the MDX query, and you'll find that it still comes back in scientific notation.

|||

The Specialty Bike Shop rows should show 0.000022076 instead of 2.2076E-05

|||

Sorry - but I disagree with you. There is a difference between cell properties VALUE and FORMATTED_VALUE. VALUE contains just, well, the value of the cell. The data type for it is VARIANT in OLEDB, and there is no formatting involved. FORMATTED_VALUE is a string which represents visual formatting of the VALUE. If you don't specify FORMAT_STRING, then the default FORMAT_STRING is used - "Standard". The formatting is actually done by OLEAUT32 function VarFormat, and it decides that if there are so many leading 0's after the decimal point, it formats using scientific notation. There is nothing wrong about it. You can specify your own FORMAT_STRING of course and dictate the rules.

So the conclusion is that there is no AS bug here - and Michael solution should work for you.

Mosha.

|||

How do you explain the following:

1) Requesting 5 digits after the decimal point returns the proper formatting:

with member [Measures].[DP] as [Measures].[Reseller Order Quantity] / 1000000000, format_string="#,#.00000"

select {[Measures].[DP]} on 0,

[Reseller].[Business Type].members on 1

from [Adventure Works]

Returns:
All Resellers .00021
Specialty Bike Shop .00002
Value Added Reseller .00008
Warehouse .00011

2) Requesting no digits after the decimal point returns wrong formatting:

with member [Measures].[DP] as [Measures].[Reseller Order Quantity] / 1000000000, format_string="#,#"

select {[Measures].[DP]} on 0,

[Reseller].[Business Type].members on 1

from [Adventure Works]

Returns:
All Resellers 0.000214378
Specialty Bike Shop 2.2076E-05
Value Added Reseller 8.0309E-05
Warehouse 0.000111993

|||

This is how formatting works - for different format strings you get different results - that's the reason why there are different format strings in the first place - so people can choose how they want the results to be formated. Note, that there is nothing special here about MSAS - any Windows application which uses standard Windows formatting functionality (starting with Visual Basic 3) - is going to behave the same.

You assumption that #,# returns "wrong" formatting is not correct. This is how #,# is designed to work. If this isn't what you want - use #,#.00000 or anything else that suits you.

|||

I'd be interested to know how you come to the conclusion that #,# should return scientific notation.

Please refer to VB Language Reference at the following link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafmtuserdefinednumericformats.asp

If I wanted scientific notation, I would specify 0.00E+00

I specified #,# in the format string, and this didn't work for 2 of the 4 returned values. Did you really look at the 4 rows returned by the query I gave as an example?

|||

Since the #,# doesn't specify what happens after the digital points - the OLEAUT32 decides to use scientific notation if there are more or equal than 4 leading zeros, and not scientific notation if there are less than 4 leading zeros. I thought I mentioned that already in one of the earlier replies. Using 0.00E+00 will force scientific notation always.

You can easily test this by using

with

member measures.x1 as 0.0001, format_string='#'

member measures.x2 as 0.00001, format_string='#'

select {x1,x2} on 0

from [Adventure Works]

HTH,

Mosha (http://www.mosha.com/msolap)

|||

I can see your point, but I don't agree with your interpretation that #,# doesn't specify what happens to the digital point.

#,# specifies that there is NO decimal point, and that all values less that 0.5 should be rounded to 0. I have tried the following in VBA (Excel 2003): MsgBox ("*" & Format(0.00000006, "#,#") & "*"), and got "**" as a result, which means the format returned an empty string.

If I try MsgBox ("*" & Format(0.00000006, "#,0") & "*"), I get "*0*". Under no circumstances does the format decide on its own to return scientific notation.

I'm not in the office right now, so I cannot try the MDX query with "#,0" which IMO should return "0" for all 4 rows.

Is this SSAS bug fixed in SP2 ?

Can someone with the SP2 beta installed try the following and tell us if the formatting bug has been fixed (using the provided Adventure Works DB) ?

with member [Measures].[DP] as [Measures].[Reseller Order Quantity] / 1000000000

select [Measures].[DP] on 0,

[Reseller].[Business Type].members on 1

from [Adventure Works]

On SSAS 2005 SP1, I get scientific notation for the 2nd and 3rd rows returned by the query (as in 2.2076E-05)

This is a major issue for us as we tend to run SSAS queries from SQL Server using OPENQUERY.

For instance, the following query fails because of this bug:

select convert(money,isnull(substring("[Measures].[DP]",1,50),0))

from openquery(olapserver,'with member [Measures].[DP] as [Measures].[Reseller Order Quantity] / 1000000000

select [Measures].[DP] on 0,

[Reseller].[Business Type].members on 1

from [Adventure Works]')

This bug is not fixed in SP2 CTP 1 November.

Regards

Thomas Ivarsson

|||

FYI: Results

DP
All Resellers 0.000214378
Specialty Bike Shop 2.2076E-05
Value Added Reseller 8.0309E-05
Warehouse 0.000111993

|||

I appologize, but what is exactly the bug here ?

The results seem to be absolutely correct to me...

|||

There is no bug in AS. It is merely a formatting issue. The following should work as expected.

select convert(money,convert(real,("[Measures].[DP]")))

from openquery(olap,'with member [Measures].[DP] as [Measures].[Reseller Order Quantity] / 1000000000

select [Measures].[DP] on 0,

[Reseller].[Business Type].members on 1

from [Adventure Works]')

|||

It is a bug, there is no reason why the same measure should come back sometimes as a decimal, and sometimes as a real number. The problem seems to be that it refuses to round small numbers to 0.

Try formatting this measure using FORMAT_STRING="#,#" in the MDX query, and you'll find that it still comes back in scientific notation.

|||

The Specialty Bike Shop rows should show 0.000022076 instead of 2.2076E-05

|||

Sorry - but I disagree with you. There is a difference between cell properties VALUE and FORMATTED_VALUE. VALUE contains just, well, the value of the cell. The data type for it is VARIANT in OLEDB, and there is no formatting involved. FORMATTED_VALUE is a string which represents visual formatting of the VALUE. If you don't specify FORMAT_STRING, then the default FORMAT_STRING is used - "Standard". The formatting is actually done by OLEAUT32 function VarFormat, and it decides that if there are so many leading 0's after the decimal point, it formats using scientific notation. There is nothing wrong about it. You can specify your own FORMAT_STRING of course and dictate the rules.

So the conclusion is that there is no AS bug here - and Michael solution should work for you.

Mosha.

|||

How do you explain the following:

1) Requesting 5 digits after the decimal point returns the proper formatting:

with member [Measures].[DP] as [Measures].[Reseller Order Quantity] / 1000000000, format_string="#,#.00000"

select {[Measures].[DP]} on 0,

[Reseller].[Business Type].members on 1

from [Adventure Works]

Returns:
All Resellers .00021
Specialty Bike Shop .00002
Value Added Reseller .00008
Warehouse .00011

2) Requesting no digits after the decimal point returns wrong formatting:

with member [Measures].[DP] as [Measures].[Reseller Order Quantity] / 1000000000, format_string="#,#"

select {[Measures].[DP]} on 0,

[Reseller].[Business Type].members on 1

from [Adventure Works]

Returns:
All Resellers 0.000214378
Specialty Bike Shop 2.2076E-05
Value Added Reseller 8.0309E-05
Warehouse 0.000111993

|||

This is how formatting works - for different format strings you get different results - that's the reason why there are different format strings in the first place - so people can choose how they want the results to be formated. Note, that there is nothing special here about MSAS - any Windows application which uses standard Windows formatting functionality (starting with Visual Basic 3) - is going to behave the same.

You assumption that #,# returns "wrong" formatting is not correct. This is how #,# is designed to work. If this isn't what you want - use #,#.00000 or anything else that suits you.

|||

I'd be interested to know how you come to the conclusion that #,# should return scientific notation.

Please refer to VB Language Reference at the following link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafmtuserdefinednumericformats.asp

If I wanted scientific notation, I would specify 0.00E+00

I specified #,# in the format string, and this didn't work for 2 of the 4 returned values. Did you really look at the 4 rows returned by the query I gave as an example?

|||

Since the #,# doesn't specify what happens after the digital points - the OLEAUT32 decides to use scientific notation if there are more or equal than 4 leading zeros, and not scientific notation if there are less than 4 leading zeros. I thought I mentioned that already in one of the earlier replies. Using 0.00E+00 will force scientific notation always.

You can easily test this by using

with

member measures.x1 as 0.0001, format_string='#'

member measures.x2 as 0.00001, format_string='#'

select {x1,x2} on 0

from [Adventure Works]

HTH,

Mosha (http://www.mosha.com/msolap)

|||

I can see your point, but I don't agree with your interpretation that #,# doesn't specify what happens to the digital point.

#,# specifies that there is NO decimal point, and that all values less that 0.5 should be rounded to 0. I have tried the following in VBA (Excel 2003): MsgBox ("*" & Format(0.00000006, "#,#") & "*"), and got "**" as a result, which means the format returned an empty string.

If I try MsgBox ("*" & Format(0.00000006, "#,0") & "*"), I get "*0*". Under no circumstances does the format decide on its own to return scientific notation.

I'm not in the office right now, so I cannot try the MDX query with "#,0" which IMO should return "0" for all 4 rows.

Monday, March 19, 2012

Is this a BUG

SQL Server 2005 SP2.
The following SQL works on SQL Server 7.0 but it doesn't work on SQL Server
2000 or 2005. The first column (cust_code) displays correct in all the
versions but the second column (related_info2 - That has all the concatenated
stuff) displays different. In 7.0, it brings all the values and if the column
has NULL, it doesn't bring anything for THAT PARTICULAR COLUMN but brings out
the rest of the columns data.
In SQL 2000 and 2005 it brings NULL for everything if one of the columns has
NULL value.
Is this a bug or it was a bug that was fixed in SQL 2000 and 2005 ?
select customer.cust_code,
customer.bus_name
+ ' '
+ customer.address3
+ ' Direct: '
+ customer.phone_direct
+ ' 800: '
+ customer.phone_800
related_info2
from customer
order by customer.cust_code
and here is the DDL:
CREATE TABLE [dbo].[customer] (
[cust_code] [int] NOT NULL ,
[bus_name] [varchar] (40) NULL ,
[address3] [varchar] (30) NULL ,
[phone_800] [varchar] (30) NULL ,
[phone_direct] [varchar] (30) NULL
) ON [PRIMARY]
GO
Thanks.
No, this is not a bug. Take a look at the CONCAT_NULL_YIELDS_NULL option in
Books Online. Probably it is set OFF on your SQL Server 7 database, or the
client API that connects sets it to off. You can check it like this:
SELECT SESSIONPROPERTY('CONCAT_NULL_YIELDS_NULL')
On SQL Server 2000 & 2005 it is ON by default, and most new client libraries
will set it to ON, which overrides the database settings.
You can easily get the same result by using COALESCE or ISNULL:
SELECT customer.cust_code,
COALESCE(customer.bus_name, '')
+ ' '
+ COALESCE(customer.address3, '')
+ ' Direct: '
+ COALESCE(customer.phone_direct, '')
+ ' 800: '
+ COALESCE(customer.phone_800, '')
AS related_info2
FROM customer
ORDER BY customer.cust_code
HTH,
Plamen Ratchev
http://www.SQLStudio.com
|||Thanks Tibor but How can I put this into a view on SQL Server 2005 ?
COALESCE doesn't work because we have to get all the NULL and NON NULL rows.
"Tibor Karaszi" wrote:

> Check out SET CONCAT_NULL_YIELDS_NULL option. This is also available as a database option (see ALTER
> DATABASE). Note that the behavior you see on 2000 and 2005 is the standard behavior so I suggest you
> adapt your code instead of tweaking SQL Server into running in a non-standard way. For instance you
> can use ISNULL for each nullable column and convert to empty string if value is NULL.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "DXC" <DXC@.discussions.microsoft.com> wrote in message
> news:C57DC90D-0BBE-452D-802B-50C7F262AB6A@.microsoft.com...
>
|||My bet.........Sorry..........COALESCE works. I just forgot to apply it
to whole fields in the select statement and not only the sub select.
Thanks again Tibor & Plamen.
"Tibor Karaszi" wrote:

> You can't (assuming you refer to the session setting) since this isn't a sticky option (like SET
> ANSI_NULLS). So, either use the database option or adjust your code to work regardless.
>
> You lost me there. Can you explain with an example?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "DXC" <DXC@.discussions.microsoft.com> wrote in message
> news:8D646949-DFA0-43FA-9AEA-B2D558AFC71C@.microsoft.com...
>

Is this a BUG

SQL Server 2005 SP2.
The following SQL works on SQL Server 7.0 but it doesn't work on SQL Server
2000 or 2005. The first column (cust_code) displays correct in all the
versions but the second column (related_info2 - That has all the concatenated
stuff) displays different. In 7.0, it brings all the values and if the column
has NULL, it doesn't bring anything for THAT PARTICULAR COLUMN but brings out
the rest of the columns data.
In SQL 2000 and 2005 it brings NULL for everything if one of the columns has
NULL value.
Is this a bug or it was a bug that was fixed in SQL 2000 and 2005 ?
select customer.cust_code,
customer.bus_name
+ ' '
+ customer.address3
+ ' Direct: '
+ customer.phone_direct
+ ' 800: '
+ customer.phone_800
related_info2
from customer
order by customer.cust_code
and here is the DDL:
CREATE TABLE [dbo].[customer] (
[cust_code] [int] NOT NULL ,
[bus_name] [varchar] (40) NULL ,
[address3] [varchar] (30) NULL ,
[phone_800] [varchar] (30) NULL ,
[phone_direct] [varchar] (30) NULL
) ON [PRIMARY]
GO
Thanks.Check out SET CONCAT_NULL_YIELDS_NULL option. This is also available as a database option (see ALTER
DATABASE). Note that the behavior you see on 2000 and 2005 is the standard behavior so I suggest you
adapt your code instead of tweaking SQL Server into running in a non-standard way. For instance you
can use ISNULL for each nullable column and convert to empty string if value is NULL.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"DXC" <DXC@.discussions.microsoft.com> wrote in message
news:C57DC90D-0BBE-452D-802B-50C7F262AB6A@.microsoft.com...
> SQL Server 2005 SP2.
> The following SQL works on SQL Server 7.0 but it doesn't work on SQL Server
> 2000 or 2005. The first column (cust_code) displays correct in all the
> versions but the second column (related_info2 - That has all the concatenated
> stuff) displays different. In 7.0, it brings all the values and if the column
> has NULL, it doesn't bring anything for THAT PARTICULAR COLUMN but brings out
> the rest of the columns data.
> In SQL 2000 and 2005 it brings NULL for everything if one of the columns has
> NULL value.
> Is this a bug or it was a bug that was fixed in SQL 2000 and 2005 ?
>
> select customer.cust_code,
> customer.bus_name
> + ' '
> + customer.address3
> + ' Direct: '
> + customer.phone_direct
> + ' 800: '
> + customer.phone_800
> related_info2
> from customer
> order by customer.cust_code
> and here is the DDL:
> CREATE TABLE [dbo].[customer] (
> [cust_code] [int] NOT NULL ,
> [bus_name] [varchar] (40) NULL ,
> [address3] [varchar] (30) NULL ,
> [phone_800] [varchar] (30) NULL ,
> [phone_direct] [varchar] (30) NULL
> ) ON [PRIMARY]
> GO
>
> Thanks.|||No, this is not a bug. Take a look at the CONCAT_NULL_YIELDS_NULL option in
Books Online. Probably it is set OFF on your SQL Server 7 database, or the
client API that connects sets it to off. You can check it like this:
SELECT SESSIONPROPERTY('CONCAT_NULL_YIELDS_NULL')
On SQL Server 2000 & 2005 it is ON by default, and most new client libraries
will set it to ON, which overrides the database settings.
You can easily get the same result by using COALESCE or ISNULL:
SELECT customer.cust_code,
COALESCE(customer.bus_name, '')
+ ' '
+ COALESCE(customer.address3, '')
+ ' Direct: '
+ COALESCE(customer.phone_direct, '')
+ ' 800: '
+ COALESCE(customer.phone_800, '')
AS related_info2
FROM customer
ORDER BY customer.cust_code
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||Thanks Tibor but How can I put this into a view on SQL Server 2005 ?
COALESCE doesn't work because we have to get all the NULL and NON NULL rows.
"Tibor Karaszi" wrote:
> Check out SET CONCAT_NULL_YIELDS_NULL option. This is also available as a database option (see ALTER
> DATABASE). Note that the behavior you see on 2000 and 2005 is the standard behavior so I suggest you
> adapt your code instead of tweaking SQL Server into running in a non-standard way. For instance you
> can use ISNULL for each nullable column and convert to empty string if value is NULL.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "DXC" <DXC@.discussions.microsoft.com> wrote in message
> news:C57DC90D-0BBE-452D-802B-50C7F262AB6A@.microsoft.com...
> > SQL Server 2005 SP2.
> >
> > The following SQL works on SQL Server 7.0 but it doesn't work on SQL Server
> > 2000 or 2005. The first column (cust_code) displays correct in all the
> > versions but the second column (related_info2 - That has all the concatenated
> > stuff) displays different. In 7.0, it brings all the values and if the column
> > has NULL, it doesn't bring anything for THAT PARTICULAR COLUMN but brings out
> > the rest of the columns data.
> >
> > In SQL 2000 and 2005 it brings NULL for everything if one of the columns has
> > NULL value.
> >
> > Is this a bug or it was a bug that was fixed in SQL 2000 and 2005 ?
> >
> >
> > select customer.cust_code,
> > customer.bus_name
> > + ' '
> > + customer.address3
> > + ' Direct: '
> > + customer.phone_direct
> > + ' 800: '
> > + customer.phone_800
> > related_info2
> > from customer
> > order by customer.cust_code
> >
> > and here is the DDL:
> >
> > CREATE TABLE [dbo].[customer] (
> > [cust_code] [int] NOT NULL ,
> > [bus_name] [varchar] (40) NULL ,
> > [address3] [varchar] (30) NULL ,
> > [phone_800] [varchar] (30) NULL ,
> > [phone_direct] [varchar] (30) NULL
> > ) ON [PRIMARY]
> > GO
> >
> >
> > Thanks.
>|||> Thanks Tibor but How can I put this into a view on SQL Server 2005 ?
You can't (assuming you refer to the session setting) since this isn't a sticky option (like SET
ANSI_NULLS). So, either use the database option or adjust your code to work regardless.
> COALESCE doesn't work because we have to get all the NULL and NON NULL rows.
You lost me there. Can you explain with an example?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"DXC" <DXC@.discussions.microsoft.com> wrote in message
news:8D646949-DFA0-43FA-9AEA-B2D558AFC71C@.microsoft.com...
> Thanks Tibor but How can I put this into a view on SQL Server 2005 ?
> COALESCE doesn't work because we have to get all the NULL and NON NULL rows.
>
> "Tibor Karaszi" wrote:
>> Check out SET CONCAT_NULL_YIELDS_NULL option. This is also available as a database option (see
>> ALTER
>> DATABASE). Note that the behavior you see on 2000 and 2005 is the standard behavior so I suggest
>> you
>> adapt your code instead of tweaking SQL Server into running in a non-standard way. For instance
>> you
>> can use ISNULL for each nullable column and convert to empty string if value is NULL.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "DXC" <DXC@.discussions.microsoft.com> wrote in message
>> news:C57DC90D-0BBE-452D-802B-50C7F262AB6A@.microsoft.com...
>> > SQL Server 2005 SP2.
>> >
>> > The following SQL works on SQL Server 7.0 but it doesn't work on SQL Server
>> > 2000 or 2005. The first column (cust_code) displays correct in all the
>> > versions but the second column (related_info2 - That has all the concatenated
>> > stuff) displays different. In 7.0, it brings all the values and if the column
>> > has NULL, it doesn't bring anything for THAT PARTICULAR COLUMN but brings out
>> > the rest of the columns data.
>> >
>> > In SQL 2000 and 2005 it brings NULL for everything if one of the columns has
>> > NULL value.
>> >
>> > Is this a bug or it was a bug that was fixed in SQL 2000 and 2005 ?
>> >
>> >
>> > select customer.cust_code,
>> > customer.bus_name
>> > + ' '
>> > + customer.address3
>> > + ' Direct: '
>> > + customer.phone_direct
>> > + ' 800: '
>> > + customer.phone_800
>> > related_info2
>> > from customer
>> > order by customer.cust_code
>> >
>> > and here is the DDL:
>> >
>> > CREATE TABLE [dbo].[customer] (
>> > [cust_code] [int] NOT NULL ,
>> > [bus_name] [varchar] (40) NULL ,
>> > [address3] [varchar] (30) NULL ,
>> > [phone_800] [varchar] (30) NULL ,
>> > [phone_direct] [varchar] (30) NULL
>> > ) ON [PRIMARY]
>> > GO
>> >
>> >
>> > Thanks.|||My bet.........Sorry..........COALESCE works. I just forgot to apply it
to whole fields in the select statement and not only the sub select.
Thanks again Tibor & Plamen.
"Tibor Karaszi" wrote:
> > Thanks Tibor but How can I put this into a view on SQL Server 2005 ?
> You can't (assuming you refer to the session setting) since this isn't a sticky option (like SET
> ANSI_NULLS). So, either use the database option or adjust your code to work regardless.
>
> > COALESCE doesn't work because we have to get all the NULL and NON NULL rows.
> You lost me there. Can you explain with an example?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "DXC" <DXC@.discussions.microsoft.com> wrote in message
> news:8D646949-DFA0-43FA-9AEA-B2D558AFC71C@.microsoft.com...
> > Thanks Tibor but How can I put this into a view on SQL Server 2005 ?
> >
> > COALESCE doesn't work because we have to get all the NULL and NON NULL rows.
> >
> >
> >
> > "Tibor Karaszi" wrote:
> >
> >> Check out SET CONCAT_NULL_YIELDS_NULL option. This is also available as a database option (see
> >> ALTER
> >> DATABASE). Note that the behavior you see on 2000 and 2005 is the standard behavior so I suggest
> >> you
> >> adapt your code instead of tweaking SQL Server into running in a non-standard way. For instance
> >> you
> >> can use ISNULL for each nullable column and convert to empty string if value is NULL.
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://sqlblog.com/blogs/tibor_karaszi
> >>
> >>
> >> "DXC" <DXC@.discussions.microsoft.com> wrote in message
> >> news:C57DC90D-0BBE-452D-802B-50C7F262AB6A@.microsoft.com...
> >> > SQL Server 2005 SP2.
> >> >
> >> > The following SQL works on SQL Server 7.0 but it doesn't work on SQL Server
> >> > 2000 or 2005. The first column (cust_code) displays correct in all the
> >> > versions but the second column (related_info2 - That has all the concatenated
> >> > stuff) displays different. In 7.0, it brings all the values and if the column
> >> > has NULL, it doesn't bring anything for THAT PARTICULAR COLUMN but brings out
> >> > the rest of the columns data.
> >> >
> >> > In SQL 2000 and 2005 it brings NULL for everything if one of the columns has
> >> > NULL value.
> >> >
> >> > Is this a bug or it was a bug that was fixed in SQL 2000 and 2005 ?
> >> >
> >> >
> >> > select customer.cust_code,
> >> > customer.bus_name
> >> > + ' '
> >> > + customer.address3
> >> > + ' Direct: '
> >> > + customer.phone_direct
> >> > + ' 800: '
> >> > + customer.phone_800
> >> > related_info2
> >> > from customer
> >> > order by customer.cust_code
> >> >
> >> > and here is the DDL:
> >> >
> >> > CREATE TABLE [dbo].[customer] (
> >> > [cust_code] [int] NOT NULL ,
> >> > [bus_name] [varchar] (40) NULL ,
> >> > [address3] [varchar] (30) NULL ,
> >> > [phone_800] [varchar] (30) NULL ,
> >> > [phone_direct] [varchar] (30) NULL
> >> > ) ON [PRIMARY]
> >> > GO
> >> >
> >> >
> >> > Thanks.
> >>
>

Friday, February 24, 2012

Is there any known issue with Service Broker on Vista

When I run the ServiceBroker Hello, World sample on SQL Server Standard SP2
or SQL Server Express on Vista, I observe that no message is ever entered in
any queue. When I run the same sample on Windows Server 2008 Enterprise, the
sample behaves as it should.
So, is there any known issue with Service Broker on Vista, or does Service
Broker have some dependency on services or O/S settings that I have missed.Answering my own question:
Vista proved not to be the significant variable in the problem. The
troubleshooting documentation led me to this query:
select * from sys.transmission_queue
... which yielded this result:
An exception occurred while enqueueing a message in the target queue. Error:
15517, State: 1. Cannot execute as the database principal because the
principal "dbo" does not exist, this type of principal cannot be
impersonated, or you do not have permission.
... which is an error fixed by executing:
EXEC sp_changedbowner 'sa'
"Craig McMurtry" wrote:
> When I run the ServiceBroker Hello, World sample on SQL Server Standard SP2
> or SQL Server Express on Vista, I observe that no message is ever entered in
> any queue. When I run the same sample on Windows Server 2008 Enterprise, the
> sample behaves as it should.
> So, is there any known issue with Service Broker on Vista, or does Service
> Broker have some dependency on services or O/S settings that I have missed.