SQL Server failed while converting nvarchar value ' XXX ' to data type int

Source: Internet
Author: User

Recently done Oracle and SQL Server database compatibility, feel that SQL Server really does not use Oracle, stored procedures can only return int type, crazy crazy

The difference between output and return of a stored procedure

SQL Rounding Ceiling ()

RETURN
Exits unconditionally from the query or process. RETURN is instantaneous and complete and can be used at any time to exit from a procedure, batch, or statement block. The statement after the RETURN is not executed.
The integer value returned. Stored procedures can return an integer value to the calling procedure or application

Unless specifically indicated, all system stored procedures return a value of 0 indicating success, and returning a value other than 0 indicates a failure.

When used for stored procedures, return cannot return null values. If the procedure attempts to return a null value (for example, using return @status and @status is NULL), a warning message is generated and a value of 0 is returned.

Output parameter outputs can be used to output any type of result (excluding table types), and return can only return an integral type and always return an integer value. The general return is used to terminate the process of the stored procedure and return. So return generally returns a value of 0. The output parameter is similar to the one in other programming languages, as in the case of an address.


Output can return multiple values, and its type is also a variety of
return returns only int, whose value is typically used in programming to represent the execution state of a stored procedure

SQL Server failed while converting nvarchar value ' XXX ' to data type int

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.