User defined functions in SQL server 7.0

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sergio

    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(Para meter)
    From MyTable

    Thanks a lot,
  • Reg Besseling

    #2
    Re: User defined functions in SQL server 7.0

    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" <basuracb@hotma il.com> wrote in message
    news:6e31b686.0 309160216.2c930 219@posting.goo gle.com...[color=blue]
    > 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(Para meter)
    > From MyTable
    >
    > Thanks a lot,[/color]


    Comment

    • Simon Hayes

      #3
      Re: User defined functions in SQL server 7.0


      "Sergio" <basuracb@hotma il.com> wrote in message
      news:6e31b686.0 309160216.2c930 219@posting.goo gle.com...[color=blue]
      > 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(Para meter)
      > From MyTable
      >
      > Thanks a lot,[/color]

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

      Se våra kampanjer på mobiler, abonnemang och tv- och streampaket | Telenor


      Simon


      Comment

      Working...