Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 get column length

Author  Topic 

dr S.A.f.
Starting Member

13 Posts

Posted - 2008-04-09 : 04:09:17
Hi,

I am creating a piece of code to create audit tables based on my current tables. I'm using the info in sysobjects to get this done, but I have one problem.
I can't seem to find the actual lenght of a column, I tried with the systypes.length, but that was obviously not what I needed. Does someone know how (or where) I can retrieve the length that I need?

thx in advance.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-09 : 04:19:17
SELECT * FROM INFORMATION_SCHEMA.COLUMNS


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

dr S.A.f.
Starting Member

13 Posts

Posted - 2008-04-09 : 04:50:38
thank you very much.
I never knew that it would be that simple :)
Go to Top of Page
   

- Advertisement -