| Author: Deepika Haridas 29 Nov 2008 | Member Level: Diamond | Rating:  Points: 5 |
1) SELECT Count(*)As Coloumns FROM Sys.SysColumns Where ID = (SELECT ID FROM Sys.SysObjects Where Name = 'YourTableName')
2) create Procedure Prc_GetColumnCount @TableName varchar(20) as Begin Select Count(Name) from Syscolumns Where id = (Select id from SysObjects Where name = @TableName) End
Prc_GetColumnCount ‘Table name’
3) select COUNT(*) from information_schema.columns where table_name = ‘Your_Table_Name'
Thanks & Regards, Deepika Editor
If U want to shine like a SUN..First U have to burn like the SUN!! Need a Guide? Join my mentor program..
|
| Author: Dharmendra Banoliya 30 Nov 2008 | Member Level: Gold | Rating:   Points: 3 |
1.select COUNT(*) from information_schema.columns where table_name = 'your tablename'
2.EXECUTE sp_columns 'your tablename'
3.SELECT Count(*)As Coloumns FROM Sys.SysColumns Where ID = (SELECT ID FROM Sys.SysObjects Where Name = 'your tablename')
|
| Author: Ritu 30 Nov 2008 | Member Level: Silver | Rating:    Points: 6 |
1.select COUNT(*) from information_schema.columns where table_name = 'tablename'
2.EXECUTE sp_columns 'tablename'
3.SELECT Count(*)As Coloumns FROM Sys.SysColumns Where ID = (SELECT ID FROM Sys.SysObjects Where Name = 'tablename')
where sp_columns is a system defined stored procedure. and tablename is your tablename in selected database.
|
| Author: shyamvinod 01 Dec 2008 | Member Level: Silver | Rating:  Points: 3 |
1.EXECUTE sp_columns 'tablename'
2.SELECT Count(*)As Coloumns FROM Sys.SysColumns Where ID = (SELECT ID FROM Sys.SysObjects Where Name = 'tablename')
3.select COUNT(*) from information_schema.columns where table_name = 'tablename'
|