Forum Replies Created

Viewing 15 posts - 2,236 through 2,250 (of 3,544 total)

  • RE: SQL Query Again - Complex

    SELECT BetID,USERID,BETTYPE,0 as Matches,0 as Mystery

    INTO #MatchingBets

    FROM #Bets

    UPDATE #MatchingBets

    SET Matches =

    (CASE WHEN NUM1 IN (@Win1,@Win2,@Win3,@Win4,@Win5) THEN 1 ELSE 0 END)

    + (CASE WHEN NUM2 IN (@Win1,@Win2,@Win3,@Win4,@Win5) THEN 1 ELSE 0 END)

    +...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: alternative for using cursor

    Provided your using sql2k you could create a function to return the concatenated descriptions and use it instead of the cursor

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SQL join

    Create a function to return the concatenated contributor's names for a supplied bookid and use the function in your select

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Order by

    This will not work for 2 reasons

    1. newid() has to be in the select for the order by to work (you will get an error)

    2. order by affects the whole query...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: A record for each month, even there is no data

    As already stated you need a base table to join to get the range you require and without the data and query your using it is difficult to give a...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Transaction/ Lock Question

    Would have to search for it, Antares mentioned it on several posts a while ago and it has to do with controlling ID's making sure only one user can get...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Transaction/ Lock Question

    That depends....

    Unless you use Antares magic bit of code you will still need a transaction for the SELECT/UPDATE and the lock will be implicit anyway

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Zip Code Searching

    quoteNo offense, but the code I posted in my first post is the fastest way to extract that...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Query limited to 23 or less rows

    Check the version of MDAC on both client and server, I used to get a lot of connection problems pre 2.7

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Transaction/ Lock Question

    quoteA HOLDLOCK would be enough....

    No it would not, HOLDLOCK will not stop another user using HOLDLOCK

    I prefer...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: date time query

    quoteI've 6 records with following date

    2003-11-03 00:00:00.000

    when i run ur second query it returns only 1 record!!...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Automatic Offline Script

    Create a scheduled job to run sp_detach_db and set it to run once at the designated date/time, plus set it to delete if successful if you do not want to...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Reading Excel Data into SQL Server 7

    Depends on whether this a one off, all the spreadsheets the same structure and where the six cells are in the spreadsheet.

    SELECT * FROM

    OPENROWSET('Microsoft.Jet.OLEDB.4.0',

    'Excel 8.0;Database=C:\book1.xls', [sheet1$])

    will get...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: My Favorite SSCer

    The nearest I came to chalk when I was young was when the teacher would throw it at me for not paying attention,  closely...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: problems with spaces

    Thanks AJ

    Just returning the favour, you have set me straight on many an occasion

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 2,236 through 2,250 (of 3,544 total)