SQL Server Create delete custom function

Source: Internet
Author: User

Use Testgoifexists (SELECT* from sys.objects WHERE object_id = object_id (N'gettime') and typeinch(N'FN'N'IF'N'TF'N'FS'N'FT'))--determine if the custom function is present in the drop function gettime--Delete the Custom function Gocreate functions gettime (@t datetime)----Create a custom function with parameter returns datetime--return value type asbegin DECLARE @a datetime--declaring VariablesSet@a ='2014-02-01'--assign a value to the variablereturn@a--return EndSelectDbo.gettime ('2014-5-5')--Execute the function

SQL Server Create delete custom function

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.