Question

Asked:
Asked By:
Jan 6 2009   8:34 PM GMT
TlogP   15 pts.

Is there a way to retrieve datatypes from stored procedures?


Stored Procedures, SQL tables, SQL 2000, SQL stored procedures

I have used the following simple query to retrieve datatypes from sql 2000 tables.

select TABLE_NAME,
COLUMN_NAME,
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH
from <tablename>.information_schema.columns
where table_name = '<tablename>' and column_name = '<columnname>'

Is there a way to retrieve datatypes from stored procedures?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



What do you mean by datatypes from stored procedures?
  • AddThis Social Bookmark Button

Browse more Questions and Answers on SQL Server.

Looking for relevant SQL Server Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Carlosdl   21920 pts.  |   Jan 7 2009  7:56PM GMT

Are you talking about the datatypes of the stored procedure’s parameters ?

 

TlogP   15 pts.  |   Jan 8 2009  2:26PM GMT

I need to know what datatype i.e. char, varchar, text, nchar…. the SP is passing to the database table. I am able to view this in QA but I have about a 1000 db i need to check on. I wanted to write something like what i posted to do this. what i posted returns the datatype or metadata for a table.

thanks for your help.

 

mrdenny   41270 pts.  |   Jan 9 2009  7:00PM GMT

The datatypes that the stored procedure is passing to the table will be what ever datatypes the table is setup for. You can’t exactly stuff a varchar value into an INT column.