Freek's Blog

SQL en .NET vraagstukken en oplossingen die ik zoal tegenkom
posts - 199, comments - 123, trackbacks - 2, articles - 7

My Links

News

Google analytics script: Locations of visitors to this page

Article Categories

Archives

Post Categories

Image Galleries

Algemene links

MSDN

vb links

t-sql: count rows in tables from 1 database.

Posted on Tuesday, November 16, 2010 11:52 AM

CREATE TABLE #foo

(
tablename
VARCHAR(255),
rc
INT
)

INSERT #foo
EXEC sp_msForEachTable
'SELECT PARSENAME(''?'', 1), COUNT(*) FROM ?'
SELECT tablename, rc
FROM #foo
ORDER BY 1 asc

 

Feedback

# re: t-sql: count rows in tables from 1 database.

7/25/2011 5:23 AM by RIFT Power Leveling
thanks

Post Comment

Title  
Name  
Url
Comment   

ATTENTION: the code you need to copy is CaSe SeNsItIvE and is required to prevent spam.
Enter the code you see: