473,387 Members | 1,342 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,387 software developers and data experts.

User defined functions in SQL server 7.0

Hi all!!
Does anybody know how I can create a function in SQL 7.0?? I have to
create functions that return a value that can be used in a select
statement. I think SQL Server version 7.0 doesn't support CREATE
FUNCTION, does it?

Ex:
Select MyFunction(Parameter)
From MyTable

Thanks a lot,
Jul 20 '05 #1
2 6946
Yes it does simple eg included

CREATE FUNCTION sqre (@num as int)
RETURNS int
AS
BEGIN

RETURN @num*@num

END

and to test

select dbo.sqre (5)

Regards

Reg :-)
"Sergio" <ba******@hotmail.com> wrote in message
news:6e**************************@posting.google.c om...
Hi all!!
Does anybody know how I can create a function in SQL 7.0?? I have to
create functions that return a value that can be used in a select
statement. I think SQL Server version 7.0 doesn't support CREATE
FUNCTION, does it?

Ex:
Select MyFunction(Parameter)
From MyTable

Thanks a lot,

Jul 20 '05 #2

"Sergio" <ba******@hotmail.com> wrote in message
news:6e**************************@posting.google.c om...
Hi all!!
Does anybody know how I can create a function in SQL 7.0?? I have to
create functions that return a value that can be used in a select
statement. I think SQL Server version 7.0 doesn't support CREATE
FUNCTION, does it?

Ex:
Select MyFunction(Parameter)
From MyTable

Thanks a lot,


Correct - user-defined functions are new in MSSQL 2000. In 7.0, you still
have to use stored procedures. You might find this useful:

http://www.algonet.se/~sommar/share_data.html

Simon
Jul 20 '05 #3

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

Similar topics

8
by: markus | last post by:
This string does not work in php: $sql="UPDATE mytable SET myfield=myuserfunction(myfield)" What I want is my function to evaluate each field and put the new value in the field. For...
0
by: Mike Chirico | last post by:
With mysql-4.1.1-alpha, using any User Defined Function ( UDF) at the query execution stage, on Linux 2.6, gave me the following error: "ERROR 2013 (HY000): Lost connection to MySQL server...
2
by: David Emme | last post by:
Access 97 I have a number of SELECT statements which contain references to user-defined VBA functions. These typically work as expected, but occasionally, on one user's machine or another,...
3
by: chreo | last post by:
I have user-defined function in MSSQL which returns Table (with 10 columns) (sorry for Polish names) CREATE FUNCTION PACZKI_Z_AKCJI (@AKCJA_ID int) RETURNS TABLE RETURN SELECT TOP 100...
3
by: jhmosow | last post by:
How can I restore the original User Defined Function Template? I made an error and saved one of my UDFs as a template but would like the original template restored? TIA
4
by: serge | last post by:
http://www.csharphelp.com/archives2/archive342.html I am using the sample code from this link but I am unable to figure out how to retrieve the list of the User-Defined Functions. I am able to...
36
by: Liam.M | last post by:
hey guys, I have one last problem to fix, and then my database is essentially done...I would therefore very much appreciate any assistance anyone would be able to provide me with. Currently I...
3
by: Lauren Quantrell | last post by:
I use the code below to generate a text file containing every stored procedure and view in my SQL Server backend database, but I can't figure out how to generate text of the User Defined Functions....
2
by: aj | last post by:
SQL Server 2005 64-bit 9.00.3042 SP2 When I map a database user to a login, I can specify a default schema for that user. After that, any SQL from that user w/o an explicit schema will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.