Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2005
    Posts
    40

    CASE SQL Construct

    I am using the following code to construct an SQL 7.0 View Column

    "CASE WHEN [DailyHours] > SUM([TransAmt]) THEN 0 ELSE 1 END"

    and it works great!!

    However, when I try the same line in SQL 2000, I get the message "The query designer does not support the case SQL construct"

    The help screen is no help as all it says is "the syntax you entered is valid but is not supported visually by Query Designer. Be sure the verify your syntax before saving."

    It will not let me save, so I'm not sure what to do from here now????

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,566
    You need to write your query in Query Analyzer, not the Query Designer, which is limited in the types of query logic it can represent in its GUI interface.
    No self-respecting DBA writes queries in Query Designer. Time to take off the training wheels...
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jan 2005
    Posts
    40

    Reply...

    You are right, I shouldn't be using Query Designer..... here's my problem.

    My client is in another city, and I am logging onto their system remotely to copy some code I've written using a VPN they set up for me on my lap top....

    The only software I have on my lap top is designer ... which is lame I know.

    I have Visual Studio on my primary system....... but no simple way to put this code on their system - ANY thoughts???

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Why don't you 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
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by blindman
    No self-respecting DBA writes queries in Query Designer. Time to take off the training wheels...
    You taking midol today?
    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.

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,566
    Quote Originally Posted by Brett Kaiser
    You taking midol today?
    Just my usual grace and elegance.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  7. #7
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Just rename the file to remove the .txt extension
    Attached Files Attached Files
    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.

  8. #8
    Join Date
    Jan 2005
    Posts
    40

    Ok Now What???

    I opened the file and I get a black screen that looks like an old DOS prompt, which is asking for a password. No matter what I enter it doesn't accept, and a blank simply closes the window......... I'm confused...... what's the password - my windos password or something specific that I have yet to learn??

  9. #9
    Join Date
    Feb 2005
    Location
    Utah
    Posts
    73
    at a command window type 'osql.exe /?' it will give you a quick help message on how to use osql. Once you are in to the server, you can execute t-sql commands from there. Look it up in BOL if you need more help.
    Dandy
    Aspiring Database Dwarf

Posting Permissions

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