Declare @Proid Bigint
SELECT @ proid = id from sysobjects where type = 'p' and
Name = @ sp_name
SELECT A.NAME N 'Parameter',
ColumnProperty (@ proid, a.name, 'precision') AS N 'Length',
A.Length N 'occupies the number of bytes,
A.isOuntParam n 'Yes input parameter',
A.XPREC N 'Accuracy', Isnull (ColumnProperty (@ ProID, A.Name, 'Scale'), 0) AS N 'Digital Number',
--Colid, don't this
B.Name N 'Data Type'
From syscolumns a, systempes b
WHERE
ID = @ ProID and b.xUsertype = a.xUsertype