Get a Table's Row Count from system tables

Anyone knows how to get a Table's Row Count from system tables?

Thanks.

Please mark the post(s) that have helped you as "Answer"
0
thuhue
5/30/2004 3:01:45 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

1 Replies
841 Views

Similar Articles

[PageSpeed] 17

select count(*) from sysobjects

sysobjects is a system table name. Replace this with the system table name which you want to get the row count.
Kusal Wijewantha
Senior Software Developer
SSW Australia
www.ssw.com.au
0
kusal
5/31/2004 12:14:48 AM
Reply:

Similar Artilces:

Is having a trigger that inserts a row in Table 'A', when a row in same table is inserted by ADo.Net code?
I want to insert a row for a Global user  in Table 'A' whenever ADO.Net code inserts a Local user row into same table. I recommended using a trigger to implement this functionality, but the DBA was against it, saying that stored proecedures should be used, since triggers are unreliable and slow down the system by placing unecessary locks on the table. Is this true OR the DBA is saying something wrong? My thinking is that Microsoft will never include triggers if they are unreliable and the DBA is just wanting to offload the extra DBA task of triggers to the programmer so that a s...

Many db's / few tables vs. Few Db's / many tables
Our infrastructure group had a consultant come in for an eval. Currently, one development group who support many different groups create a database per group (sales, etc). The consultant said that this was inefficient, and that we should combine all of the databases into one database. The Infrastructure group now wants us to use one db for everything. Does anyone have any thoughts on the advantages / disadvantages of these approaches. It depends what "everything" is.  If you are mixing sales data, manufacturing data, security data, then I would still create a number of sma...

superreview cancelled: [Bug 344505] role="anything" on <table> should remove roleless <td>'s, <th's> from hierarchy : [Attachment 229522] Any role on a table means the table structure descendants are
Aaron Leventhal <aaronleventhal@moonset.net> has cancelled Aaron Leventhal <aaronleventhal@moonset.net>'s request for superreview: Bug 344505: role="anything" on <table> should remove roleless <td>'s, <th's> from hierarchy https://bugzilla.mozilla.org/show_bug.cgi?id=344505 Attachment 229522: Any role on a table means the table structure descendants are no longer structurally relevant, unless they have their own role. They're being used to layout the container. https://bugzilla.mozilla.org/attachment.cgi?id=229522&action=edi...

superreview requested: [Bug 344505] role="anything" on <table> should remove roleless <td>'s, <th's> from hierarchy : [Attachment 229522] Any role on a table means the table structure descendants are
Aaron Leventhal <aaronleventhal@moonset.net> has asked for superreview: Bug 344505: role="anything" on <table> should remove roleless <td>'s, <th's> from hierarchy https://bugzilla.mozilla.org/show_bug.cgi?id=344505 Attachment 229522: Any role on a table means the table structure descendants are no longer structurally relevant, unless they have their own role. They're being used to layout the container. https://bugzilla.mozilla.org/attachment.cgi?id=229522&action=edit ...

SQL call to count the total rows in Table B for each user in Table A
I have 2 tables:   TableA: Name UserA UserB UserC   Table B: Name               Data UserA              xxx UserB              asdasd UserB              ewrsad UserC              dsafasc UserA        &nbs...

How to add link from one table's colum onto the other table's column?
I have 2 tables in a DataSet and have a link on them. I intend to put one column's content in one table, let's say t1, as the other column's link in the other table, let's say t2. However, after the link is created what I got is the t2's string in the link not the t1's. Here is my code: In the aspx: DataNavigateUrlFormatString="http://someweb.com/site/{0}" In the VB:'Create the link variableDim link As System.Web.UI.WebControls.HyperLinklink = DirectCast(e.Item.Cells(1).Controls(0), System.Web.UI.WebControls.HyperLink) 'Binding the link onto the column of Agency NameDim dr As Da...

Error: Primary key for row in table 'x' is referenced by foreign key 'f' in table 'y'
(ASA 9 newest ebf) I'm getting this error even though mentioned foreign key has cascade updates (and deletes too) enabled. Is this some new behaviour in asa 9, or why can i get such message for cascaded foreign key? Any ideas? Thanks Pete Found a reason for it...but should it really work so? It's this way: - table a has columns a,b,c - table b has columns a,c, and references columns a,c (with a,c) in table a with cascade updates - table a hes before update trigger to change columns a when column b is changed (set new_row.a = ...) and that set new_row.a = ... i...

How to get record count or row count of rows in reporting service table object?
SSRS 2005.  Let's say I define ONE dataset.  In the page layout I drop in 2 tables.  table1 and table2.  In each of these 2 tables, I add a filter. Let's call the field Active Flag, and I filter on "Y" and "No" respectively.  Now, at the bottom of the report(and not inside the tables themselves) I want to drop 2 textboxes onto the page layout.  I want to get the record count from table1, and the record count in table 2, and place it in each textbox at the bottom of the page that shows the total records per table.  Sounds easy, bu...

SQL Server Table's column Referencing two parent tables.
Hi everybody,  I know that it is possible for one column to reference two different parent tables by defining two foreign keys on a same column, I have done it and SQL Server does give any error. But I want to know that is it advisable to define multiple foreign key on a column referncing two differnt parent table's primary key in differnt case... ? Means If Case 1 then It should reference to column1 or table1 otherwise it should reference to table2? How is it practicle...?    Please, 'Mark as Answer' if this post has helped you! - Bihag Thakerhttp://bihagt...

How to get the ID's not in another sql table?
I have a select statement where I select the userID, FirstName, and LastName, and I want all those rows except where ther userID is in another table.  (It's kind of an exception table).  How do I say where UserID is not in the other Table (column name is also userID in ther other table) Never make important decisions on a Monday! What is the datatype for the UserID field in both the tables. If its INT then you can say Select UserID,FirstName,LastName from Table1 where UserID not in (Select distinct UserID from Table2).Avi select userid, firstname , lastname from table...

Unable to cast object of type 'System.Data.Linq.DataQuery`1[Table]' to type 'Table'.
Hello,  I wanted to modify the newly inserted data but I receive this error “Unable to cast object of type 'System.Data.Linq.DataQuery`1[Gallery]' to type 'Gallery'.”...    Protected Sub LinqDataSource1_Inserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LinqDataSourceStatusEventArgs) Handles LinqDataSource1.Inserted        Dim newrecord As Integer = e.Result.idGallery        Dim db As GalleryDataContext = New GalleryDataContext      &...

I have created a table Table with name as Varchar and id as int. Now i have started inserting the rows like, insert into Table values ('arun',20).
I have created a table Table with name as Varchar and id as int. Now i have started inserting the rows like, insert into Table values ('arun',20).Yes i have inserted a row in the table. Now i have got the values " arun's ", 50.                 insert into Table values('arun's',20)  My sqlserver is giving me an error instead of inserting the row. How will you solve this problem?    The direct answer to your question is: You insert it like this:   ...

Getting table records count with SQL statement VB.net
I have a table named USERS with a column named USERNAME. I am trying to get the count and cannot seem to get any results back. Code I've tried. cmd2.CommandText = "SELECT USERNAME AS RETURNCOUNT FROM USERS" rs = cmd2.ExecuteReader intCount = rs("RETURNCOUNT") ************Did not return any*************  ******************************************************************************************************************************* cmd2.CommandText = "SELECT COUNT(0) AS RETURNCOUNT FROM USERS" rs = cmd2.ExecuteReader intCount = rs("R...

Is a temp table or a table variable used in UDF's returning a table?
In a table-valued UDF, does the UDF use a table variable or a temp table to form the resultset returned?  sun21170 It has to be table variable.***********************Dinakar NethiLife is short. Enjoy it.***********************...

Web resources about - Get a Table's Row Count from system tables - asp.net.sql-datasource

Resources last updated: 11/25/2015 8:07:35 PM