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.
| Author |
Topic |
|
vin
Starting Member
26 Posts |
Posted - 2003-04-01 : 00:14:55
|
| Hi folks,How to find out which table in my database has highest number or columns and i need to get the number of columns in that table and store that value in a variable. |
|
|
samsekar
Constraint Violating Yak Guru
437 Posts |
Posted - 2003-04-01 : 00:51:50
|
| HTH..Declare @MaxNoOfColumns intSelect @MaxNoOfColumns=Max(C.TotalColumns)from(select B.name as TableName,B.id as TableID, count(A.name) as TotalColumns from SysColumns as A Inner Join SysObjects as B on A.id=B.id and B.type='u' group by B.name, B.id ) as CSelect @MaxNoOfColumns as Max_No_ColumnsSekar~~~~Success is not a destination that you ever reach. Success is the quality of your journey. |
 |
|
|
vin
Starting Member
26 Posts |
Posted - 2003-04-01 : 01:17:02
|
| thanx sam |
 |
|
|
|
|
|