Freshers Aptitude technical questions
Freshers Job Alert
Bookmark and Share

  Diff types of arguments supported SP

Parameters in a stored procedure are defined with a data type, much as a column in a table is defined. A stored procedure parameter can be defined with any of the Microsoft® SQL Server™ 2000 data types, including text and image . Stored procedure parameters can also be defined with user-defined data types.

Note   The cursor data type can be used only as an OUTPUT parameter to a stored procedure.

The data type of a parameter determines the type and range of values that are accepted for the parameter. For example, if you define a parameter with a tinyint data type, only numeric values ranging from 0 to 255 are accepted. An error is returned if a stored procedure is executed with a value incompatible with the data type.

Parameters

Parameters are used to exchange data between stored procedures and the application or tool that called the stored procedure:

  • Input parameters allow the caller to pass a data value to the stored procedure.
  • Output parameters allow the stored procedure to pass a data value or a cursor variable back to the caller.
Every stored procedure returns an integer return code to the caller. If the stored procedure does not explicitly set a value for the return code, the return code is 0.