Finding the Data Type of Stored Procedure Parameter

  • Hi,

    This requirement is for dynamic custom attributes created by the User. Each Project can have different custom attributes collection. We have planned to store the attributes to separate tables grouped by DataType. Eg: VarcharTable, IntegerTable, FloatTable, DateTable.

    I have a Stored Procedure which has all the parameters specified as nVachar Data Type. Inside the SP, I should check the data type of passed parameter and store the values in specific Data Type tables.

    Is there any way that I could find the passed parameter Data Type inside the Stored Procedure?

    Thanks in advance.

    Regards,

    Nagarajan Mohan

  • Take a look at INFORMATION_SCHEMA.PARAMETERS. It's a system view in your database.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

  • Thanks for your reply. We think passing the datatype along with the parameters in XML format, would be better than hitting the INFORMATION SCHEMA tables.

    Thanks,

    Nags

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply