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.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 count

Author  Topic 

satya068
Posting Yak Master

233 Posts

Posted - 2010-03-17 : 12:56:20
Hi..
could anyone help in this query?

In my database TABLE1 has 2 columns which contais all the table_names n row count in the database.

these are all the sys.tables n sys.indexes table_names and row count inserted into TABLE1.

Now i want to get a new column INSERT_DATE_COUNT>=sysdate() to all the tables in in TABLE1.

INSERT_DATE_COUNT is nothing but count for INSERT_DATE column which already exists in all the tables in the same database.

now my final table should exists TABLE_NAME,ROW_COUNT AND INSERT_DATE_COUNT.

when i run the query i need all the count for insert_date>=sysdate().

thnax for your help



Satya

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-17 : 13:05:57
you mean a single query for getting all the tables count?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

satya068
Posting Yak Master

233 Posts

Posted - 2010-03-17 : 18:08:14
Hi..Visakh.


looking to write set of select statement in a single query.
thanks

yashu
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-18 : 03:47:33
Refer
http://beyondrelational.com/blogs/madhivanan/archive/2007/11/02/different-ways-to-count-rows-from-a-table.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -