Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to count fields in an sql 2000 database TABLE

Status
Not open for further replies.

snipesnab

IS-IT--Management
Oct 24, 2002
171
0
0
GB
Hi There,

I was wondering if anyone has a VB script which will count the fields in an SQL 2000 table, and if there are more than 5000 fields i need a true response.

Any ideas greatly appreciated.

 
fields are referred to as columns, if you mean rows then you can do this

function CountRows
dim rowcount
[connection open]
connection.execute("select 'Total' = count(*) from table")
rowcount = connection("Total")
[connection close]
if rowcount => 5000 then
CountRows = true
else
countRows = False
end if
end function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top