To Create a function

  • Hi,

    I want to know that is it possible to create a function by using

    insert,update,delete command?

    Regards,

    Sunil.....

  • Functions aren't allowed to have side-effects, i.e. they aren't allowed to change the state of the database in any way.

    It's so that when they are included in querues, it doesn't matter whether the optimiser chooses a plan that runs a function once, or several times.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I want to know that is it possible to create a function by using

    insert,update,delete command?

    No.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • Thanks for reply...........

Viewing 4 posts - 1 through 3 (of 3 total)

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