Specifying a Data Type

Creating and Maintaining Databases

Creating and Maintaining Databases

Specifying a Data Type

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. For more information about using cursor variables, see Scope of Transact-SQL Cursor Names.

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.

See Also

Creating User-Defined Data Types

CREATE PROCEDURE

Data Types