Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting row count as part of DB design info
Message
 
 
À
05/02/2008 09:22:46
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01289085
Message ID:
01289517
Vues:
17
>I tried the following, but I think the the sp still looks at the tables from the current DB. I can insert the results from the original version into the temp table, then into another table. I was just trying to find a way to do it in one command.
>
>use MyDesignDB
>go
>create table tRowCount (tablename varchar(128), rowcnt int)
>exec sp_MSforeachtable
>   'insert into tRowCount select 'MyTestDB.' + ''?'', count(*) from 'MyTestDB.' + ?'
>select * from tRowCount
>    order by rowcnt, tablename
>
Looks like you would not be able to do it. In my tries I was getting

Could not find server 'Database name' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform