Showing posts with label components. Show all posts
Showing posts with label components. Show all posts

Monday, March 19, 2012

CLR UDTs bigger than 8000 bytes

Hi there,
Say I wanted to create a "compound" type, purely to pass as a parameter
to a stored procedure, but one of the components was NTEXT or
NVARCHAR(MAX). Say it was something like:
- Author NVARCHAR(256)
- IP address VARCHAR(16)
- Comment NVARCHAR(MAX)
How would I go about doing this? My code works fine if the UDT package
is less than 8000 bytes, but fails if it's greater than that (which is
understandable since I had to put MaxByteSize = 8000 into the UDT
definition). If the package is too big, I get an
IndexOutOfRangeException in
System.Data.SqlClient.TdsParser.TdsExecuteRPC().
Is the 8000-byte limit a "hard" limit that I can't work around? As I
mentioned, this is purely to pass as a parameter to a stored procedure,
it'll never be used as a column in a table.
Or am I misunderstanding something and I don't even need to make this a
real UDT since it won't ever be stored as a column? Is there a way for
me to pass a regular .NET object to a CLR stored procedure?
(This example is very simplistic, I know - I could just pass three
individual parameters instead of one compound one in this case. The
actual situation is more complicated though.)
Many thanks,
GeoffGeoff (opinionatedg@.gmail.com) writes:
> Say I wanted to create a "compound" type, purely to pass as a parameter
> to a stored procedure, but one of the components was NTEXT or
> NVARCHAR(MAX). Say it was something like:
> - Author NVARCHAR(256)
> - IP address VARCHAR(16)
> - Comment NVARCHAR(MAX)
> How would I go about doing this? My code works fine if the UDT package
> is less than 8000 bytes, but fails if it's greater than that (which is
> understandable since I had to put MaxByteSize = 8000 into the UDT
> definition). If the package is too big, I get an
> IndexOutOfRangeException in
> System.Data.SqlClient.TdsParser.TdsExecuteRPC().
> Is the 8000-byte limit a "hard" limit that I can't work around?
That's right.

> Or am I misunderstanding something and I don't even need to make this a
> real UDT since it won't ever be stored as a column? Is there a way for
> me to pass a regular .NET object to a CLR stored procedure?
Check out the current thread "DataRow in a CLR Stored Procedure". There
are some suggestions on binary serialization.
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|||Hi,
thanks for that - at least I know I'm not missing something simple at
the UDT/parameter level.
I've checked out the thread "DataRow in a CLR Stored Procedure" as you
suggested - interesting stuff. It would just mean serializing the
values manually before the call, rather than the serialization
happening as part of the call... The objects themselves wouldn't then
need to be UDTs, so there'd be no limit. Cool.
Many thanks,
Geoff

Tuesday, February 14, 2012

Client Components Fail to Install - UPDATE

Me as well can not install the client components on boxes that have CLR 2.0/Office 2007 already installed. Notice that the failures have occured on boxes that doesn't have any SQL Server 2005 components installed. I do not know if it is CLR 2.0 or Office that causes the failures.

The error I'm getting initially is the same as Bogey1 and willgart: "

Upgrade failed due to the following error. The error code is:

-2147467259. Message: Unspecified error"


I have narrowed the failure down somewhat further; it occurs during installation of Business Intelligence Development Studio and it seems to happen during a process when it tries to upgrade the Microsoft Report Server (I have not installed Reporting Services - and it does not make any difference if Reporting Services is installed or not).

The workaround is obviously to choose an advanced setup and de-select BI Dev Studio from the Client Components installation node.

So far this has happened on following boxes:
1. LongHorn Server Beta 3 (LH) with CLR 3.0 and Office 2007 installed
2. A complete new install of LH Server, i.e nothing on the box that is not part of a normal LH installation (notice that CLR 2.0 is part of a LH installation).
3. Win 2K3 sp2 with CLR 3.0 and Office 2007 installed

In the installations above I have no Visual Studio bits installed what-so-ever

The installation succeeded on a complete new Win 2K3 sp2 installation; i.e. no CLR 2.0 bits and no Office 2007 bits.

Hope someone can shed some light on this.

Niels

OK, so I have now done a successful installation on a W2K3 sp2 box with Office 2007 installed - but no CLR 2.0/3.0. Remember from the initial post in this thread that the installation fails on W2K3 sp2 with CLR 2.0 and Office 2007.

It seems that the failures some of us have seen are due to having CLR 2.0/3.0 installed.

After the successful installation I installed the CLR 2.0 SDK, CLR 3.0 and Orcas and everything works just fine.

Niels
|||

Are you sure you do not have Microsoft Visual Studio installed by some application?

This error is usually due to VS installed in a non-default location.

Please confirm if you have VS installed in a non-default location, and if so, make sure that you have devenv.exe.config installed in its default location. For VS8:

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe.config

|||Hi,

Thanks for coming back to me on this. The only thing that I have installed, when the installation has failed is CLR 2.0 and the CLR 2.0 SDK. I don't know if the SDK installation installs the VS bits (but I doubt it).

Niels
|||Please double-check if you have this file installed in a non-default location. VS installs as a pre-req for some components, and you might not notice that it is installed.|||Will do. However I'm on the road for another week, and won't be able to do it until I'm back.

Thanks again!

Niels

Client Components Fail to Install - UPDATE

Me as well can not install the client components on boxes that have CLR 2.0/Office 2007 already installed. Notice that the failures have occured on boxes that doesn't have any SQL Server 2005 components installed. I do not know if it is CLR 2.0 or Office that causes the failures.

The error I'm getting initially is the same as Bogey1 and willgart: "

Upgrade failed due to the following error. The error code is:

-2147467259. Message: Unspecified error"


I have narrowed the failure down somewhat further; it occurs during installation of Business Intelligence Development Studio and it seems to happen during a process when it tries to upgrade the Microsoft Report Server (I have not installed Reporting Services - and it does not make any difference if Reporting Services is installed or not).

The workaround is obviously to choose an advanced setup and de-select BI Dev Studio from the Client Components installation node.

So far this has happened on following boxes:
1. LongHorn Server Beta 3 (LH) with CLR 3.0 and Office 2007 installed
2. A complete new install of LH Server, i.e nothing on the box that is not part of a normal LH installation (notice that CLR 2.0 is part of a LH installation).
3. Win 2K3 sp2 with CLR 3.0 and Office 2007 installed

In the installations above I have no Visual Studio bits installed what-so-ever

The installation succeeded on a complete new Win 2K3 sp2 installation; i.e. no CLR 2.0 bits and no Office 2007 bits.

Hope someone can shed some light on this.

Niels

OK, so I have now done a successful installation on a W2K3 sp2 box with Office 2007 installed - but no CLR 2.0/3.0. Remember from the initial post in this thread that the installation fails on W2K3 sp2 with CLR 2.0 and Office 2007.

It seems that the failures some of us have seen are due to having CLR 2.0/3.0 installed.

After the successful installation I installed the CLR 2.0 SDK, CLR 3.0 and Orcas and everything works just fine.

Niels
|||

Are you sure you do not have Microsoft Visual Studio installed by some application?

This error is usually due to VS installed in a non-default location.

Please confirm if you have VS installed in a non-default location, and if so, make sure that you have devenv.exe.config installed in its default location. For VS8:

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe.config

|||Hi,

Thanks for coming back to me on this. The only thing that I have installed, when the installation has failed is CLR 2.0 and the CLR 2.0 SDK. I don't know if the SDK installation installs the VS bits (but I doubt it).

Niels
|||Please double-check if you have this file installed in a non-default location. VS installs as a pre-req for some components, and you might not notice that it is installed.|||Will do. However I'm on the road for another week, and won't be able to do it until I'm back.

Thanks again!

Niels

Client Components Fail to Install

Me as well can not install the client components on boxes that have CLR 2.0/Office 2007 already installed. Notice that the failures have occured on boxes that doesn't have any SQL Server 2005 components installed. I do not know if it is CLR 2.0 or Office that causes the failures.

The error I'm getting initially is the same as Bogey1 and willgart: "

Upgrade failed due to the following error. The error code is:

-2147467259. Message: Unspecified error"


I have narrowed the failure down somewhat further; it occurs during installation of Business Intelligence Development Studio and it seems to happen during a process when it tries to upgrade the Microsoft Report Server (I have not installed Reporting Services - and it does not make any difference if Reporting Services is installed or not).

The workaround is obviously to choose an advanced setup and de-select BI Dev Studio from the Client Components installation node.

So far this has happened on following boxes:
1. LongHorn Server Beta 3 (LH) with CLR 3.0 and Office 2007 installed
2. A complete new install of LH Server, i.e nothing on the box that is not part of a normal LH installation (notice that CLR 2.0 is part of a LH installation).
3. Win 2K3 sp2 with CLR 3.0 and Office 2007 installed

In the installations above I have no Visual Studio bits installed what-so-ever

The installation succeeded on a complete new Win 2K3 sp2 installation; i.e. no CLR 2.0 bits and no Office 2007 bits.

Hope someone can shed some light on this.

Niels

OK, so I have now done a successful installation on a W2K3 sp2 box with Office 2007 installed - but no CLR 2.0/3.0. Remember from the initial post in this thread that the installation fails on W2K3 sp2 with CLR 2.0 and Office 2007.

It seems that the failures some of us have seen are due to having CLR 2.0/3.0 installed.

After the successful installation I installed the CLR 2.0 SDK, CLR 3.0 and Orcas and everything works just fine.

Niels
|||

Are you sure you do not have Microsoft Visual Studio installed by some application?

This error is usually due to VS installed in a non-default location.

Please confirm if you have VS installed in a non-default location, and if so, make sure that you have devenv.exe.config installed in its default location. For VS8:

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe.config

|||Hi,

Thanks for coming back to me on this. The only thing that I have installed, when the installation has failed is CLR 2.0 and the CLR 2.0 SDK. I don't know if the SDK installation installs the VS bits (but I doubt it).

Niels
|||Please double-check if you have this file installed in a non-default location. VS installs as a pre-req for some components, and you might not notice that it is installed.|||Will do. However I'm on the road for another week, and won't be able to do it until I'm back.

Thanks again!

Niels

Client components

I have an application that connects to a SQL 2000 database on another
machine.
We are upgrading this to work with SQL 2005 or SQL 2000.
The application uses SQLDMO objects and ADO objects (written in C++)
At the moment we include sqlredist.exe in the install package for the
client.
We have found that we also need to install the Backwards Compatability
components to let us use SQLDMO with SQL 2005.
What is the smallest (and what are they) set of components we need to
install on the client to have our application work with either SQL 2000 or
SQL 2005.
Michael Tissington
http://www.oaklodge.com
http://www.sqlview.netYou should be able to use just the installer for the
Backwards Compatibility Components - SQLServer2005_BC.msi
You can download it from:
http://www.microsoft.com/downloads/...&displaylang=en
-Sue
On Thu, 1 Jun 2006 21:04:58 -0700, "Michael Tissington"
<mtissington@.newsgroups.nospam> wrote:

>I have an application that connects to a SQL 2000 database on another
>machine.
>We are upgrading this to work with SQL 2005 or SQL 2000.
>The application uses SQLDMO objects and ADO objects (written in C++)
>At the moment we include sqlredist.exe in the install package for the
>client.
>We have found that we also need to install the Backwards Compatability
>components to let us use SQLDMO with SQL 2005.
>What is the smallest (and what are they) set of components we need to
>install on the client to have our application work with either SQL 2000 or
>SQL 2005.