home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 132 / dpcs0299.iso / Business / Superoff / super / Sql / SORCVIEW.5QL < prev    next >
Encoding:
Text File  |  1997-01-31  |  552 b   |  16 lines

  1. CREATE VIEW SO.rowcount (num_rows, table_name) AS
  2.     SELECT t.count, t.table_name FROM systable t, sysuserperm p
  3.         WHERE t.creator = p.user_id AND p.user_name = 'SO'
  4.  
  5.  
  6. Alternatively
  7. Find user_id from sysuserperm
  8. SELECT user_id FROM sysuserperm WHERE user_name = 'SO'
  9.  
  10. Then use a simpler view
  11. CREATE VIEW SO.rowcount (num_rows, table_name) AS
  12.     SELECT count, table_name FROM systable 
  13.         WHERE creator = [user_id]
  14.  
  15. Replace [user_id] with the value you got in the statement above.
  16. In databases created by us, this is always 4