473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

SQL 2005 testing

I've begun some testing with the June beta of SQL 2005. One problem
I've hit is with scalar-valued functions. The error I often get when
executing functions is "Select statements included within a function
cannot return data to a client.". These same functions are working
fine under SQL 2000.

Has anybody seen this behavior or know what the deal is?

Jul 23 '05 #1
7 2212
ca**********@gmail.com wrote:
I've begun some testing with the June beta of SQL 2005. One problem
I've hit is with scalar-valued functions. The error I often get when
executing functions is "Select statements included within a function
cannot return data to a client.". These same functions are working
fine under SQL 2000.

Has anybody seen this behavior or know what the deal is?

Doesn't a SELECT inside of a routine return a result set to the caller?
What would be the effect of doing this inside, say, a function in a
WHERE clause. You may want to assign the result of that select to a
local variable...

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Jul 23 '05 #2
Serge,
Yes, I do assign the results of the select to a local variable. These
functions are simple and I'm not having trouble with how to use
functions. The problem is they work with SQL 2000 but produce errors
with SQL 2005. Here is an example of one of the functions.

create function dbo.vfVendorName(@SubscriberID int, @ApplicationNum
int)
returns varchar(100)
as
BEGIN
declare @rtn varchar(100)
select @rtn=Vendorname from vAppVendor
where SubscriberID=@SubscriberID and ApplicationNum=@ApplicationNum
return @rtn
end

Works fine when called from SQL 2000 but gives "Select statements
included within a function cannot return data to a client." when run
from SQL 2005.

Jul 23 '05 #3
Inside a function you are not permitted to execute a SELECT statement that
returns data to the client. Could you post an example of a function that
returns this error in SQL2005 but not in SQL2000.

--
David Portas
SQL Server MVP
--

<ca**********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I've begun some testing with the June beta of SQL 2005. One problem
I've hit is with scalar-valued functions. The error I often get when
executing functions is "Select statements included within a function
cannot return data to a client.". These same functions are working
fine under SQL 2000.

Has anybody seen this behavior or know what the deal is?

Jul 23 '05 #4
ca**********@gmail.com (ca**********@gmail.com) writes:
Yes, I do assign the results of the select to a local variable. These
functions are simple and I'm not having trouble with how to use
functions. The problem is they work with SQL 2000 but produce errors
with SQL 2005. Here is an example of one of the functions.

create function dbo.vfVendorName(@SubscriberID int, @ApplicationNum
int)
returns varchar(100)
as
BEGIN
declare @rtn varchar(100)
select @rtn=Vendorname from vAppVendor
where SubscriberID=@SubscriberID and ApplicationNum=@ApplicationNum
return @rtn
end

Works fine when called from SQL 2000 but gives "Select statements
included within a function cannot return data to a client." when run
from SQL 2005.


I rewrote your function as:

create function dbo.blafs(@OrderID int, @EmployeeID int)
returns varchar(100)
as
BEGIN
declare @rtn nvarchar(100)
select @rtn = CustomerID from Northwind..Orders
where OrderID = @OrderID and EmployeeID = @EmployeeID
return @rtn
end
go
SELECT dbo.blafs (10988, 3)
go

Since I only changed table and column names to a database that I have
available, this function should yield the same result as yours. However,
I seem to recall that I have seen a similar problem discussed in the
beta newsgroups, so there might be an issue somewhere.

Anyway, this is not the place where you should discuss SQL 2005.
Please see http://go.microsoft.com/fwlink/?linkid=31765 for access
information to the beta newsgroups for SQL 2005. This is because
these groups are frequented by more SQL Server developers than
this newsgroup.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #5
ca**********@gmail.com (ca**********@gmail.com) writes:
Yes, I do assign the results of the select to a local variable. These
functions are simple and I'm not having trouble with how to use
functions. The problem is they work with SQL 2000 but produce errors
with SQL 2005. Here is an example of one of the functions.

create function dbo.vfVendorName(@SubscriberID int, @ApplicationNum
int)
returns varchar(100)
as
BEGIN
declare @rtn varchar(100)
select @rtn=Vendorname from vAppVendor
where SubscriberID=@SubscriberID and ApplicationNum=@ApplicationNum
return @rtn
end

Works fine when called from SQL 2000 but gives "Select statements
included within a function cannot return data to a client." when run
from SQL 2005.


I rewrote your function as:

create function dbo.blafs(@OrderID int, @EmployeeID int)
returns varchar(100)
as
BEGIN
declare @rtn nvarchar(100)
select @rtn = CustomerID from Northwind..Orders
where OrderID = @OrderID and EmployeeID = @EmployeeID
return @rtn
end
go
SELECT dbo.blafs (10988, 3)
go

Since I only changed table and column names to a database that I have
available, this function should yield the same result as yours. However,
I seem to recall that I have seen a similar problem discussed in the
beta newsgroups, so there might be an issue somewhere.

Anyway, this is not the place where you should discuss SQL 2005.
Please see http://go.microsoft.com/fwlink/?linkid=31765 for access
information to the beta newsgroups for SQL 2005. This is because
these groups are frequented by more SQL Server developers than
this newsgroup.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #6
Erland,
Thanks for pointing me to correct newsgroup. I'll post my issue there.
I do believe this is an issue with sql 2005 as I have several
functions which do the same type of retrieval - some work and some
don't, yet they all work fine on sql 2000
Carey Loomis

Jul 23 '05 #7
Erland,
Thanks for pointing me to correct newsgroup. I'll post my issue there.
I do believe this is an issue with sql 2005 as I have several
functions which do the same type of retrieval - some work and some
don't, yet they all work fine on sql 2000
Carey Loomis

Jul 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Peter Hogg | last post by:
Hello, I recently downloaded 'Microsoft Visual C# 2005 Express Edition Beta'. It's been brilliant, but I couldn't help wondering what more you get when you buy 'Visual Studio .NET'. There must...
5
by: Roy Gourgi | last post by:
Hi, I just installed VS 2005 Express with SQL Server and when I try to run the code that was working with VS 2003 is no longer working. Is it not backward compatible. What has changed. Below is...
0
by: John Hoge | last post by:
I'm testing VWD, which has some great features over VS.NET2003, but there is one feature that it seems to lack: I want to do my development and testing on a local testing server. Dreamweaver...
2
by: Craig Throne | last post by:
I see that .NET Studio 2005 contains a unit test framework. Does anyone know if it can do GUI testing as well. What I would like to do is record UI actions (mouse movements, clicks, keyboard,...
4
by: Peter Rilling | last post by:
Does VS.NET 2005 Professional support integrated unit testing, or is that only with the team system?
25
by: Marco | last post by:
Hi everyone. I've been trying to move some small applications written in vb.net 2003 to vb.net 2005 express just for testing purposes. I have noticed so far that the applications seem to run ...
4
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
We have to upgrade our Visual Studio .NET 2003 enterprise edition to .NET 2005. However, there is no enterprise edition for Visual Studio .NET 2005. There are 4 versions available for visual...
5
by: =?Utf-8?B?U2FsYW1FbGlhcw==?= | last post by:
Hi, I know that VS 2005 has a lot of testing features and already used them for doing web load testing. I am wondering if it is possible to load test a win forms application. I don't mean writing...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.