How To get the max(Primary key) Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: How To get the max(Primary key)

Threaded View

  1. #1
    Join Date
    Jan 2006

    How To get the max(Primary key)

    Hi all,

    I have a requirement where I need to get the max(primary key ) of all tables in database.
    I have an option to manually write a query like:
    select max(primary_key1) from table1;
    select max(primary_key2) from table2;

    But I want to avoid doing that.
    Do we have any better way of doing it.

    Also I need to create a spool file on some other machine, whose IP is known.
    Generally when we spool a file we write:
    spool c:/Records_Count/STAGING_TABLE_COUNT

    How can I locate this spool file on other machine.

    Any help is appreciated,
    Last edited by cool_tas; 01-27-2006 at 06:49 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width