Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
    Post Closed as "off-topic" by Paul White says GoFundMonica
3 Incorporated comment; edited tags
source | link
    If not  Exists (Select * from sys.objects where name ='FNLX_getDate'  and type =N'FN')

    Create function [dbo].[FNLX_getDate]() returns Datetime
    as
    Begin
    .................
    End

When I execute the above script I get the error

Incorrect syntax near the keyword 'function'.

What can be wrong?

Using Microsoft SQL Server to execute above script.

    If not  Exists (Select * from sys.objects where name ='FNLX_getDate'  and type =N'FN')

    Create function [dbo].[FNLX_getDate]() returns Datetime
    as
    Begin
    .................
    End

When I execute the above script I get the error

Incorrect syntax near the keyword 'function'.

What can be wrong?

    If not  Exists (Select * from sys.objects where name ='FNLX_getDate'  and type =N'FN')

    Create function [dbo].[FNLX_getDate]() returns Datetime
    as
    Begin
    .................
    End

When I execute the above script I get the error

Incorrect syntax near the keyword 'function'.

What can be wrong?

Using Microsoft SQL Server to execute above script.

2 Make it a question.
source | link
    If not  Exists (Select * from sys.objects where name ='FNLX_getDate'  and type =N'FN')

    Create function [dbo].[FNLX_getDate]() returns Datetime
    as
    Begin
    .................
    End

when executingWhen I execute the above script showing error Incorrect syntax nearI get the keyword 'function'.error

Incorrect syntax near the keyword 'function'.

What can be wrong?

    If not  Exists (Select * from sys.objects where name ='FNLX_getDate'  and type =N'FN')

    Create function [dbo].[FNLX_getDate]() returns Datetime
    as
    Begin
    .................
    End

when executing above script showing error Incorrect syntax near the keyword 'function'.

    If not  Exists (Select * from sys.objects where name ='FNLX_getDate'  and type =N'FN')

    Create function [dbo].[FNLX_getDate]() returns Datetime
    as
    Begin
    .................
    End

When I execute the above script I get the error

Incorrect syntax near the keyword 'function'.

What can be wrong?

1
source | link

If function not exist then create function in SQL server

    If not  Exists (Select * from sys.objects where name ='FNLX_getDate'  and type =N'FN')

    Create function [dbo].[FNLX_getDate]() returns Datetime
    as
    Begin
    .................
    End

when executing above script showing error Incorrect syntax near the keyword 'function'.