Description of the default values of mssql Stored Procedures and function parameters (1/4)

Source: Internet
Author: User
For mssql, the default value of function parameters indicates that createprocp (@ svarchar (1) a) asselect @ sgoexecpgo -- 1 alterprocp (@ sdecimala) as & nbsp; select @ sgoexecpgo * server: Message 8114, level 16, status 5, process p, line 0 description of mssql and default function parameters
Create our general statement

Create proc p (@ s varchar (1) = 'A ')

As

Select @ s

Go

Exec p

Go
-- 1
Alter proc p (@ s decimal =)
As
Select @ s
Go
Exec p
Go
/*

Server: Message 8114, level 16, status 5, process p, row 0
An error occurred while converting nvarchar to numeric.

*/

-- 2
Alter proc p (@ s varchar (1) = medium)
As
Select @ s
Go
Exec p
Go
/*


----


(The number of affected rows is 1)

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.