Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query Sql Server tables and run code?
Message
From
08/05/2013 15:59:54
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Query Sql Server tables and run code?
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01573064
Message ID:
01573064
Views:
57
Let say I have a database in Sql Server with about 20 tables in it, and that most of those tables have a field "qty".

How could I write query that says

" For each table in the database where the table has a column named 'qty'
Select table_name, Max(qty) as max_qty "



Basically, I need a cursor that shows the tablename and the Max(qty) from that table.

BTW it doesn't matter to me whether this is code I from FoxPro or in Sql Server Mgmt Studio.
Next
Reply
Map
View

Click here to load this message in the networking platform