473,508 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2217
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
2145
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
3202
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
979
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
1285
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
2142
by: Peter Rilling | last post by:
Does VS.NET 2005 Professional support integrated unit testing, or is that only with the team system?
25
2445
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
1910
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
1688
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
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7124
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7385
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.