Ms Sql Return Error Code
Contents |
Microsoft Tech Companion App Microsoft Technical Communities Microsoft Virtual Academy Script Center Server sql server stored procedure return error and Tools Blogs TechNet Blogs TechNet Flash Newsletter TechNet
Sql Server Stored Procedure Return Code
Gallery TechNet Library TechNet Magazine TechNet Subscriptions TechNet Video TechNet Wiki Windows Sysinternals Virtual
Sql Server Stored Procedure Return Value 0
Labs Solutions Networking Cloud and Datacenter Security Virtualization Downloads Updates Service Packs Security Bulletins Windows Update Trials Windows Server 2016 System Center 2016
Sql Server Return Codes List
Windows 10 Enterprise SQL Server 2016 See all trials » Related Sites Microsoft Download Center TechNet Evaluation Center Drivers Windows Sysinternals TechNet Gallery Training Training Expert-led, virtual classes Training Catalog Class Locator Microsoft Virtual Academy Free Windows Server 2012 courses Free Windows 8 courses SQL Server sql return value from stored procedure training Microsoft Official Courses On-Demand Certifications Certification overview MCSA: Windows 10 Windows Server Certification (MCSE) Private Cloud Certification (MCSE) SQL Server Certification (MCSE) Other resources TechNet Events Second shot for certification Born To Learn blog Find technical communities in your area Support Support options For business For developers For IT professionals For technical support Support offerings More support Microsoft Premier Online TechNet Forums MSDN Forums Security Bulletins & Advisories Not an IT pro? Microsoft Customer Support Microsoft Community Forums United States (English) Sign in Home Library Wiki Learn Gallery Downloads Support Forums Blogs We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. Implementing Stored Procedures Creating Stored Procedures (Database Engine) Returning Data from a Stored Procedure Returning Data from a Stored Procedure Returning Data by Using a Return Code Returning
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft db2 sql return code Imagine Microsoft Student Partners ISV Startups TechRewards Events sql server stored procedure default return value Community Magazine Forums Blogs Channel 9 Documentation APIs and reference Dev centers Samples Retired sql return code 803 content We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. Transact-SQL Reference (Database Engine) https://technet.microsoft.com/en-us/library/ms190778(v=sql.105).aspx Built-in Functions (Transact-SQL) System Functions (Transact-SQL) System Functions (Transact-SQL) @@ERROR (Transact-SQL) @@ERROR (Transact-SQL) @@ERROR (Transact-SQL) $PARTITION (Transact-SQL) @@ERROR (Transact-SQL) @@IDENTITY (Transact-SQL) @@PACK_RECEIVED (Transact-SQL) @@ROWCOUNT (Transact-SQL) @@TRANCOUNT (Transact-SQL) BINARY_CHECKSUM (Transact-SQL) CHECKSUM (Transact-SQL) COMPRESS (Transact-SQL) CONNECTIONPROPERTY (Transact-SQL) CONTEXT_INFO (Transact-SQL) CURRENT_REQUEST_ID (Transact-SQL) CURRENT_TRANSACTION_ID (Transact-SQL) DECOMPRESS (Transact-SQL) ERROR_LINE https://msdn.microsoft.com/en-us/library/ms188790.aspx (Transact-SQL) ERROR_MESSAGE (Transact-SQL) ERROR_NUMBER (Transact-SQL) ERROR_PROCEDURE (Transact-SQL) ERROR_SEVERITY (Transact-SQL) ERROR_STATE (Transact-SQL) FORMATMESSAGE (Transact-SQL) GET_FILESTREAM_TRANSACTION_CONTEXT (Transact-SQL) GETANSINULL (Transact-SQL) HOST_ID (Transact-SQL) HOST_NAME (Transact-SQL) ISNULL (Transact-SQL) ISNUMERIC (Transact-SQL) MIN_ACTIVE_ROWVERSION (Transact-SQL) NEWID (Transact-SQL) NEWSEQUENTIALID (Transact-SQL) ROWCOUNT_BIG (Transact-SQL) SESSION_CONTEXT (Transact-SQL) SESSION_ID (Transact-SQL) XACT_STATE (Transact-SQL) TOC Collapse the table of content Expand the table of content This documentation is archived and is not being maintained. This documentation is archived and is not being maintained. @@ERROR (Transact-SQL) Other Versions SQL Server 2012 THIS TOPIC APPLIES TO: SQL Server (starting with 2008)Azure SQL DatabaseAzure SQL Data Warehouse Parallel Data Warehouse Returns the error number for the last Transact-SQL statement executed. Transact-SQL Syntax ConventionsSyntax Copy -- Syntax for SQL Server, Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse @@ERROR Return TypesintegerRemarksReturns 0 if the previous Transact-SQL statement encoun
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of http://stackoverflow.com/questions/1035789/return-value-from-a-stored-proc-on-error this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign sql server up Return value from a stored proc on error up vote 14 down vote favorite 3 I have an sp in SQL Server that when errors returns -4 What does -4 mean? Is there a table somewhere explaining what the possible return values are? There must be some standard For example declare @RetVal int EXEC @RetVal = stpTest select @RetVal where stpTest is sql server stored "SELECT 1/0" returns -6. -6 must mean something! The sp that returned -4 only has UPDATE and SELECT INTO statements in it. At no point does it do 'SELECT -4' so how can I "find out what -4 means in that particular stored procedure"? Also, if there is no standard then why does a divide by zero error always return -6? If you have an sp that does not return anything i.e. it doesn't have any select statements in it and you do: declare @RetVal int EXEC @RetVal = yourSPName Then @RetVal will have a value of 0. If there is an error then @RetVal will be a value other then zero, for example if the only thing your sp does is "SELECT 1/0" then @RetVal will be -6. Try it and see My question is what do these return values mean? They must have some logical meaning! sql sql-server stored-procedures return-value share|improve this question edited Nov 5 '11 at 14:27 marc_s 454k938701033 asked Jun 23 '09 at 23:30 Steve As is stated repeatedly below, there are no standards. If you have the source