How to get datatype of a column in SQL Server

Jayakumars
Posted by Jayakumars under Sql Server category on | Points: 40 | Views : 732
Hi

i have post the code

How to get datatype of a column in SQL Server

Run The Procedure
=========================
Exec sp_FindDatatype 'Employee'

Create Procedure
===============
CREATE Proc sp_FindDatatype
@TblName varchar(50)
as
SELECT COLUMN_NAME,DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME=@TblName

Comments or Responses

Login to post response