Scalar valued function compatibility issue.

  • I have created a function in SQL server 2005 to return the values without any space, my client system has SQL server 7.0.But the create function is

    giving error: Incorrect syntax near function check the compatibility or upgrade to higher compatibility.My function is as simple as given below.

    Let me know if there is any change in function syntax for SQL 7.0

    CREATE function [dbo].[Fn_Replace]

    (@keyword varchar (1000)

    )

    returns varchar(1000)

    AS

    BEGIN

    SET @keyword=REPLACE(@keyword,' ','')

    SET @keyword=REPLACE(@keyword,' ','')

    SET @keyword=REPLACE(@keyword,' ','')

    SET @keyword=REPLACE(@keyword,' ','')

    SET @keyword=REPLACE(@keyword,' ','')

    RETURN(@keyword)

    END

    GO

  • SQL Server version 7.0 doesn't support CREATE FUNCTION,

    user-defined functions were introduced in MSSQL 2000. In 7.0, you still

    have to use stored procedures.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply