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 2000 Forums
 Transact-SQL (2000)
 Count of table columns

Author  Topic 

Trent
Starting Member

39 Posts

Posted - 2005-09-13 : 15:31:19
Is there any way to get a count of the number of columns?
Also, I'm more interested in if there's a way to get the date the table was created?
Thank you for any help!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-09-13 : 15:34:44
-- number of columns
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'TableName'

-- date table was created
SELECT crdate
FROM sysobjects
WHERE [name] = 'TableName'

Tara
Go to Top of Page

Trent
Starting Member

39 Posts

Posted - 2005-09-13 : 15:40:22
RESOLVED
Wow, that's simple, I'm glad I asked.
Thank You!
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-09-13 : 15:41:15
Tara did that one when she was taking a nap

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
   

- Advertisement -