In oracle we can let the datatype of the stored procedure parameter map to the datatype of the columns example
CREATE PROCEDURE [CheckCustomer]
@customerid onl_Customers.UserID%type
Can we do that in sql
stored procedure parameter data type automatically gets the column datatypeQuestion:
Is there a way so that in a stored procedure instead of assigning the data type of the parameter I can pull it from the columndata type.
Because sometimes we change the column datatypes and we do not want to go and change it all over the stored procedures we are in the design processes
_______________________________________-
I know about
select '@'+column_name+' ',data_type+coalesce('('+cast(character_maximum_length as varchar(10))+')','') from information_schema.columns
where table_name='your_table'
________________________________________-
my stored procedure looks like
create PROCEDURE [dbo].[usp_UserValidateLogin]
(
@LoginName nvarchar(30),
@OrganizationID int,
@Password nvarchar(20),
sarah
[Modified: fixed pre tags]