Specifying a Data Type

Parameters in a stored procedure are defined with a data type, much as a column in a table is. A stored procedure parameter can be defined with any of the Microsoft® SQL Server™ 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 will be accepted for the parameter. For example, if you define a parameter with a tinyint data type, only numeric values ranging from 0 to 255 will be accepted. An error will be 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  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.