显示标签为“explicit”的博文。显示所有博文
显示标签为“explicit”的博文。显示所有博文

2012年3月27日星期二

float and money Data conversion between ado com and ado dotnet not the same with sqlserve

I am running the same query through the traditional ado com interface and
through dotnet ado. The query is a FOR XML EXPLICIT and in ado com I am
using the streaming capability to retrieve the xml and in dotnet the
ExecuteXmlreader command.
The result for ado com is :
<results><motor.cycle id="177496" ver="1" sum.insured="100000"
model="25089700" cover.type.id="0" make="546" capacity="1000" .....
The result for ado .net and in sql analyzer is :
<motor.cycle id="177496" ver="1" sum.insured="100000.0000" model="25089700"
cover.type.id="0" make="546" capacity="1.000000000000000e+003".....
It is clear that the money fields(sum..insured) and float fields(capacity)
gets converted(implicitly by SQL?) in different ways.
Does anyone know why it is not the same and how to get it the same?
This is most likely an artefact of the XML serialization of the typed values
being done differently by the two providers (for some providers and FOR XML
queries, we are sending binary data over that then gets converted to strings
in the providers).
The ADO.Net serialization is consistent with the server-side serialization:
select cast(1000 as float) as x for XML raw, type
select Cast((select cast(1000 as float) as x for XML raw, type) as
nvarchar(max))
Note that management studio also uses ADO.Net.
If this is problematic, please let me know. Note that I am not sure however,
that we can change it now...
Best regards
Michael
"Eben" <eben@.fspsolutions.com> wrote in message
news:eGKV5vF5FHA.1956@.TK2MSFTNGP09.phx.gbl...
>I am running the same query through the traditional ado com interface and
>through dotnet ado. The query is a FOR XML EXPLICIT and in ado com I am
>using the streaming capability to retrieve the xml and in dotnet the
>ExecuteXmlreader command.
> The result for ado com is :
> <results><motor.cycle id="177496" ver="1" sum.insured="100000"
> model="25089700" cover.type.id="0" make="546" capacity="1000" .....
> The result for ado .net and in sql analyzer is :
> <motor.cycle id="177496" ver="1" sum.insured="100000.0000"
> model="25089700" cover.type.id="0" make="546"
> capacity="1.000000000000000e+003".....
> It is clear that the money fields(sum..insured) and float fields(capacity)
> gets converted(implicitly by SQL?) in different ways.
>
> Does anyone know why it is not the same and how to get it the same?
>

float and money Data conversion between ado com and ado dotnet not the same with sql

I am running the same query through the traditional ado com interface and
through dotnet ado. The query is a FOR XML EXPLICIT and in ado com I am
using the streaming capability to retrieve the xml and in dotnet the
ExecuteXmlreader command.
The result for ado com is :
<results><motor.cycle id="177496" ver="1" sum.insured="100000"
model="25089700" cover.type.id="0" make="546" capacity="1000" .....
The result for ado .net and in sql analyzer is :
<motor.cycle id="177496" ver="1" sum.insured="100000.0000" model="25089700"
cover.type.id="0" make="546" capacity="1.000000000000000e+003".....
It is clear that the money fields(sum..insured) and float fields(capacity)
gets converted(implicitly by SQL?) in different ways.
Does anyone know why it is not the same and how to get it the same?This is most likely an artefact of the XML serialization of the typed values
being done differently by the two providers (for some providers and FOR XML
queries, we are sending binary data over that then gets converted to strings
in the providers).
The ADO.Net serialization is consistent with the server-side serialization:
select cast(1000 as float) as x for XML raw, type
select Cast((select cast(1000 as float) as x for XML raw, type) as
nvarchar(max))
Note that management studio also uses ADO.Net.
If this is problematic, please let me know. Note that I am not sure however,
that we can change it now...
Best regards
Michael
"Eben" <eben@.fspsolutions.com> wrote in message
news:eGKV5vF5FHA.1956@.TK2MSFTNGP09.phx.gbl...
>I am running the same query through the traditional ado com interface and
>through dotnet ado. The query is a FOR XML EXPLICIT and in ado com I am
>using the streaming capability to retrieve the xml and in dotnet the
>ExecuteXmlreader command.
> The result for ado com is :
> <results><motor.cycle id="177496" ver="1" sum.insured="100000"
> model="25089700" cover.type.id="0" make="546" capacity="1000" .....
> The result for ado .net and in sql analyzer is :
> <motor.cycle id="177496" ver="1" sum.insured="100000.0000"
> model="25089700" cover.type.id="0" make="546"
> capacity="1.000000000000000e+003".....
> It is clear that the money fields(sum..insured) and float fields(capacity)
> gets converted(implicitly by SQL?) in different ways.
>
> Does anyone know why it is not the same and how to get it the same?
>

2012年3月26日星期一

FlatFile connection and security

My DTS package, deployed and run from the file system, works just fine for me, but fails when someone else runs it. The only explicit error from the dtexec command is:

Error: 2005-06-24 12:35:03.33
Code: 0xC0016016
Source:
Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.
End Error

This error just started when we tried to point to a file on a network server instead of a file local to the machine running the package. The other person definitely has access rights to that network server, but the package fails anyway.

One possible solution might be to specify a username/password for the file, but I don't see how to include that in the connection string. Alternatively, this may be a more general security issue with the whole package. I first turned to BOL for some explanations and answers, but wasn't able to find anything specific to my problem.

Any help or suggestions will be greatly appreciated. Thanks!
Phil
This is because the default protection level is to encrypt with a user key. That means only a user on his/her machine can open the package.

You probably want to use Package Password here instead.|||

I am getting a similar error on a DTS package created by me and migrated by me and executed by me via Dtexec. Shouldn't ssql 2000 ownership carry over to 2005? The package is not a flat file. And, by the way, where does the "DTS Property" come in?

thanks

Ted

Microsoft (R) SQL Server Execute Package Utility
Version 9.00.1399.06 for 32-bit
Copyright (C) Microsoft Corp 1984-2005. All rights reserved.
NULL
Started: 9:24:56 AM
Error: 2006-02-08 09:24:56.50
Code: 0xC0016016
Source:
Description: Failed to decrypt protected XML node "DTS:Property" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that
the correct key is available.
End Error
Error: 2006-02-08 09:24:56.51
Code: 0xC0016016
Source:
Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that
the correct key is available.
End Error

|||

SSIS is a completely new product so I don't think it follows that DTS behaviour should make it into SSIS. Furthermore, there's been a very high profile tightening up of security within Microsoft products and the behaviour you're seeing here is probably as a result of that.

The reason you see references to "DTS" in various places is for legacy reasons. Alot of the product had already been built before the name change came about.

-Jamie

sql

FlatFile connection and security

My DTS package, deployed and run from the file system, works just fine for me, but fails when someone else runs it. The only explicit error from the dtexec command is:

Error: 2005-06-24 12:35:03.33
Code: 0xC0016016
Source:
Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.
End Error

This error just started when we tried to point to a file on a network server instead of a file local to the machine running the package. The other person definitely has access rights to that network server, but the package fails anyway.

One possible solution might be to specify a username/password for the file, but I don't see how to include that in the connection string. Alternatively, this may be a more general security issue with the whole package. I first turned to BOL for some explanations and answers, but wasn't able to find anything specific to my problem.

Any help or suggestions will be greatly appreciated. Thanks!
PhilThis is because the default protection level is to encrypt with a user key. That means only a user on his/her machine can open the package.

You probably want to use Package Password here instead.|||

I am getting a similar error on a DTS package created by me and migrated by me and executed by me via Dtexec. Shouldn't ssql 2000 ownership carry over to 2005? The package is not a flat file. And, by the way, where does the "DTS Property" come in?

thanks

Ted

Microsoft (R) SQL Server Execute Package Utility
Version 9.00.1399.06 for 32-bit
Copyright (C) Microsoft Corp 1984-2005. All rights reserved.
NULL
Started: 9:24:56 AM
Error: 2006-02-08 09:24:56.50
Code: 0xC0016016
Source:
Description: Failed to decrypt protected XML node "DTS:Property" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that
the correct key is available.
End Error
Error: 2006-02-08 09:24:56.51
Code: 0xC0016016
Source:
Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that
the correct key is available.
End Error

|||

SSIS is a completely new product so I don't think it follows that DTS behaviour should make it into SSIS. Furthermore, there's been a very high profile tightening up of security within Microsoft products and the behaviour you're seeing here is probably as a result of that.

The reason you see references to "DTS" in various places is for legacy reasons. Alot of the product had already been built before the name change came about.

-Jamie