As you can see I am starting with SQL 7 and I would like to know if it exist a query which can automaticaly tell you how many columns you have in your table.
this is to be able to calculate the Null Bitmap.
thanks for your information
Patrick
declare @tbl varchar(50)
set @tbl = 'Tablename'
select NumberOfColumns = count(name) from syscolumns where id = (select id from sysobjects where name = @tbl)
or this...
declare @tbl varchar(50)
set @tbl = 'Tablename'
select NumberOfColumns = info from sysobjects where name = @tbl
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.