Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL2000 ---> SQL 7.0

Status
Not open for further replies.

ebase

MIS
Jan 7, 2004
40
US
Hello,

I am trying to help a friend who needs help in SQL 7.0. His current code is for SQL2000 and is using functions as below:

CREATE FUNCTION getgl (@ap_y nchar(1), @mot nchar(2), @cc nchar(2), @item nchar(3))
RETURNS nvarchar(15)
AS
BEGIN
DECLARE @MODE nvarchar(4)
DECLARE @GL nchar(13)
SET @MODE = CASE @mot when '40' then '0202' when '41' then '0202' else '0501' end
SELECT @GL =
CASE UPPER(@ap_y)
WHEN 'Y' THEN '4'+ @MODE + '0-' + @cc + @item
WHEN 'N' THEN '5'+ @MODE + '0-' + @cc + '-000'
ELSE '399999-00-000'
END
RETURN(@GL)
END

then trying to execute it using something like this:

INSERT INTO TransferCostT(blah,blah,blah)VALUES(dbo.getgl('N', '40', LEFT('3101',2), LEFT('0210',3)))

How would you get this to work in SQL 7.0? I do not know anything about SQL so I apologize if this is a stupid question. Just trying to help a friend. Thanks.
 
I guess what I am asking is what is used in SQL 7.0 to use the functions in SQL 2000.

Thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top