Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2004
    Posts
    3

    Unanswered: Simple (i hope) SQL help needed

    I was looking for a way to "globally" set my FROM database value. Is this possible?, or does the "FROM" syntax always require the database name? I would like to just state my table names in the FROM statement

    BEFORE Example:
    select T1.id, FROM PT.ptuser.tblRequest T1, where etc....

    Can the "PT.ptuser" be declared somehow 1 time so my SQL code could look like...

    AFTER Example:
    select T1.id, FROM tblRequest T1, where etc....

    hope this makes sense.... I'm trying to run SQL via Microsoft Query

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    No it doesn't....where are you executing the sql from?

    A stored procedure?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Sep 2004
    Posts
    3
    i'm executing via ".dqy" file which looks something like this:

    XLODBC
    1
    DSN=PT.dsn;Description=description;UID=xxxxx;PWD=p pppp;APP=Microsoft Office XP;WSID=severname;DATABASE=dbasename
    select etc.....

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Sorry...what's that? Why not use osql?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  5. #5
    Join Date
    Sep 2004
    Posts
    3
    Its a MS Excel ODBC Query File. Results are populated into Excel file.
    is there a better way to do it?

Posting Permissions

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