Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Programming > Databases > General SQL Server Support

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-13-2008, 11:45 AM
Yashgt
 
Posts: n/a
SQL 2000: Transport-level error on SELECT statement

I am facing a wierd problem with SQL Server standard edition SP2.

I have a statement like
SELECT A,B,C, ....,
dbo.TEST_GETATTENDEEDETAILS(CI.SI_ID) AS SI_ATTENDEENAME,
X,Y,Z
from .....

The function emits a CSV string. When I run the above command, I get
an error that says:

A transport-level error has occurred when receiving results from the
server. (provider: Shared Memory Provider, error: 0 - The system
cannot open the file.)

The client loses contact with the DB server. From the logs I can see
that SQL server gets autostared.
If I comment out the function call, the statement runs fine. If I
uncomment the function call then, it works fine and gives the expected
result.

What could be the reason?

Thanks,
Yash
Reply With Quote
  #2 (permalink)  
Old 08-13-2008, 01:00 PM
Tibor Karaszi
 
Posts: n/a
Re: SQL 2000: Transport-level error on SELECT statement

Most probably you have some bug or issue inside that function. You need to talk to whoever provided
that function so that they can rectify this bug.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"Yashgt" <yashgt@gmail.com> wrote in message
news:dedaa8ab-62be-4cae-a215-a9a2c79e5b22@n38g2000prl.googlegroups.com...
>I am facing a wierd problem with SQL Server standard edition SP2.
>
> I have a statement like
> SELECT A,B,C, ....,
> dbo.TEST_GETATTENDEEDETAILS(CI.SI_ID) AS SI_ATTENDEENAME,
> X,Y,Z
> from .....
>
> The function emits a CSV string. When I run the above command, I get
> an error that says:
>
> A transport-level error has occurred when receiving results from the
> server. (provider: Shared Memory Provider, error: 0 - The system
> cannot open the file.)
>
> The client loses contact with the DB server. From the logs I can see
> that SQL server gets autostared.
> If I comment out the function call, the statement runs fine. If I
> uncomment the function call then, it works fine and gives the expected
> result.
>
> What could be the reason?
>
> Thanks,
> Yash



Reply With Quote
  #3 (permalink)  
Old 08-13-2008, 10:20 PM
Erland Sommarskog
 
Posts: n/a
Re: SQL 2000: Transport-level error on SELECT statement

Yashgt (yashgt@gmail.com) writes:
> I am facing a wierd problem with SQL Server standard edition SP2.
>
> I have a statement like
> SELECT A,B,C, ....,
> dbo.TEST_GETATTENDEEDETAILS(CI.SI_ID) AS SI_ATTENDEENAME,
> X,Y,Z
> from .....
>
> The function emits a CSV string. When I run the above command, I get
> an error that says:
>
> A transport-level error has occurred when receiving results from the
> server. (provider: Shared Memory Provider, error: 0 - The system
> cannot open the file.)
>
> The client loses contact with the DB server. From the logs I can see
> that SQL server gets autostared.
> If I comment out the function call, the statement runs fine. If I
> uncomment the function call then, it works fine and gives the expected
> result.


Examine the SQL Server log for crash dumps. The most likely reason is
that the function provokes a bug in SQL Server.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #4 (permalink)  
Old 08-13-2008, 10:48 PM
--CELKO--
 
Posts: n/a
Re: SQL 2000: Transport-level error on SELECT statement

>> The function emits a CSV string. <<

Since you are not going to follow even First Normal Form, why use SQL
at all? Columns are suppose to be scalar values and not list
structures. Get rid of the non-1NF code and write SQL instead of a
weird dialect.
Reply With Quote
  #5 (permalink)  
Old 08-14-2008, 08:05 AM
Erland Sommarskog
 
Posts: n/a
Re: SQL 2000: Transport-level error on SELECT statement

--CELKO-- (jcelko212@earthlink.net) writes:
>>> The function emits a CSV string. <<

>
> Since you are not going to follow even First Normal Form, why use SQL
> at all? Columns are suppose to be scalar values and not list
> structures. Get rid of the non-1NF code and write SQL instead of a
> weird dialect.


Yeah Joe, tell the people who want a comma-separated list on their
reports that they are violating first normal form. They will probably
tell you it is the most normal form of presentation they can think of...



--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Reply With Quote
  #6 (permalink)  
Old 08-14-2008, 10:10 AM
Yashgt
 
Posts: n/a
Re: SQL 2000: Transport-level error on SELECT statement


The ERRORLOG only has messages of the server starting up. There is no
messgae of the crash.

Here is the code of the function:
REATE FUNCTION TEST_GETATTENDEEDETAILS ( @CLAIMITEMID INT )
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @RETURNSTRING VARCHAR(8000)
SET @RETURNSTRING = ''

IF @CLAIMITEMID IS NOT NULL
BEGIN
SELECT @RETURNSTRING =
@RETURNSTRING + ',' +
isnull(SI_NAME,'') +',' + isnull(SI_JOBTITLE,'') +',' +
isnull(SI_NOTES,'')
FROM SI_ATTENDEE (NOLOCK)
WHERE SI_CLAIMITEMID = @CLAIMITEMID -- This lookup is an index seek
END

RETURN @RETURNSTRING

END
GO

I know for sure that the CSV will never exceed 8000 characters. We are
creating a CSV because that is the way it will be shown in a report.

Thanks,
Yash

Erland Sommarskog wrote:
> --CELKO-- (jcelko212@earthlink.net) writes:
> >>> The function emits a CSV string. <<

> >
> > Since you are not going to follow even First Normal Form, why use SQL
> > at all? Columns are suppose to be scalar values and not list
> > structures. Get rid of the non-1NF code and write SQL instead of a
> > weird dialect.

>
> Yeah Joe, tell the people who want a comma-separated list on their
> reports that they are violating first normal form. They will probably
> tell you it is the most normal form of presentation they can think of...
>
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pro...ads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #7 (permalink)  
Old 08-14-2008, 10:45 PM
Erland Sommarskog
 
Posts: n/a
Re: SQL 2000: Transport-level error on SELECT statement

Yashgt (yashgt@gmail.com) writes:
> The ERRORLOG only has messages of the server starting up. There is no
> messgae of the crash.


Strange. That would indicate that something goes wrong in SQL Client.
What happens if you run the statement from SQLCMD or OSQL?

And since the error talks about shared memory, what happens when
you connect from a different machine

> Here is the code of the function:
> REATE FUNCTION TEST_GETATTENDEEDETAILS ( @CLAIMITEMID INT )
> RETURNS VARCHAR(8000)
> AS
> BEGIN
> DECLARE @RETURNSTRING VARCHAR(8000)
> SET @RETURNSTRING = ''
>
> IF @CLAIMITEMID IS NOT NULL
> BEGIN
> SELECT @RETURNSTRING =
> @RETURNSTRING + ',' +
> isnull(SI_NAME,'') +',' + isnull(SI_JOBTITLE,'') +',' +
> isnull(SI_NOTES,'')
> FROM SI_ATTENDEE (NOLOCK)
> WHERE SI_CLAIMITEMID = @CLAIMITEMID -- This lookup is an index seek
> END
>
> RETURN @RETURNSTRING


Beware that this function relies on undefined behaviour, and the result
from the function (when it works) may not be what you expect it to be.
See http://support.microsoft.com/default.aspx?scid=287515. Note
particular the first sentence under CAUSE.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #8 (permalink)  
Old 08-17-2008, 10:04 AM
Ed Murphy
 
Posts: n/a
Re: SQL 2000: Transport-level error on SELECT statement

Erland Sommarskog wrote:

> --CELKO-- (jcelko212@earthlink.net) writes:
>>>> The function emits a CSV string. <<

>> Since you are not going to follow even First Normal Form, why use SQL
>> at all? Columns are suppose to be scalar values and not list
>> structures. Get rid of the non-1NF code and write SQL instead of a
>> weird dialect.

>
> Yeah Joe, tell the people who want a comma-separated list on their
> reports that they are violating first normal form. They will probably
> tell you it is the most normal form of presentation they can think of...


The proper answer is "let the reporting layer combine multiple values
into a comma-separated list".
Reply With Quote
  #9 (permalink)  
Old 08-20-2008, 05:07 AM
Yash
 
Posts: n/a
Re: SQL 2000: Transport-level error on SELECT statement

Everything works fine after installing SP4.
Reply With Quote
  #10 (permalink)  
Old 08-20-2008, 08:10 AM
Erland Sommarskog
 
Posts: n/a
Re: SQL 2000: Transport-level error on SELECT statement

Yash (yashgt@gmail.com) writes:
> Everything works fine after installing SP4.


Great to hear that it worked out. Thanks for reporting back!

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Programming > Databases > General SQL Server Support


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:43 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Child Trust Funds | Bleach 149 . Bleach 150 | Loans | Loans | Credit Card



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114