Friday, February 24, 2012

CREATE FUNCTION?

Hello!

How can I make this function in MS SQL:

CREATE FUNCTION id_name() RETURNS INTEGER
AS 'SELECT MAX(ID)+1 FROM Test;'

Thanks!
Big Smile [:D]

CREATE FUNCTION id_name ()
RETURNS integer

AS


BEGIN


declare @.Return integer
@.return =SELECT MAX(ID)+1 FROM Test
return @.return

END

Limno

|||CREATE FUNCTION id_name RETURNS INTEGER
AS SELECT MAX(ID)+1 FROM Test

No comments:

Post a Comment