Forum Replies Created

Viewing 15 posts - 991 through 1,005 (of 1,033 total)

  • RE: Simple query i CANNOT figure out :(

    craig (4/3/2008)


    The people code id identifies the person, but the table has a composite primary key with these columns

    people_code_id

    test_id

    test_type

    test_date

    does this change anything?

    Nope, as long as a single field identifies a...

  • RE: Simple query i CANNOT figure out :(

    To use EXISTS you'd need to get craftier

    select *

    from testscores as ts1

    where alpha_score_1 like 'f%'

    and not exists (select * from testscores where alpha_score_1 like 'p%')

    Becomes

    select *

    from testscores as...

  • RE: Simple query i CANNOT figure out :(

    Because you used EXISTS/NOT EXISTS instead of IN.

    Books Online


    When a subquery is introduced with the keyword EXISTS, it functions as an existence test. The WHERE clause of the outer query...

  • RE: Simple query i CANNOT figure out :(

    Yes... I took a wildswing as to what the field may or may not be called.

    It's also why I asked for the structure. 🙂

  • RE: Simple query i CANNOT figure out :(

    The problem then is that your query is filtering record by record. Just because the table has multiple records for the same user and some have the p1,p2 doesn't...

  • RE: Simple query i CANNOT figure out :(

    Sample Data, Actual Structure please.

    Are the f1,f2,f3,p1,etc values all in the field on a single record, or does each f1,f2,p1,p2 have it's own record?

  • RE: Troubleshooting Query

    Can you provide the table structure please?

    Odds are your Primary Key is neither the State nor the County?

  • RE: IF (COLUMNS_UPDATED()) ???

    Sergiy (4/3/2008)


    I don't have the structure of the table... but it's easy enough to encapsulate the field comparisons with isnulls.

    If you don't know something you must assume the worst.

    And if...

  • RE: Troubleshooting Query

    Do you have the structures for the table(s), syntax of the queries, sample data, etc?

    Hard to help with nothing to see.

  • RE: Find Only Yesterday's Orders?

    Ok... after pushing up to 100K rows I see your point.

    Is there a way to use DATEDIFF and get an Index Seek? I'm a little sad that my favorite...

  • RE: Find Only Yesterday's Orders?

    Perhaps I screwed up my index here, but I get a table scan from each of these

    create table datevalues (

    dates datetime,

    somevals integer )

    create index bobsyouruncle on datevalues(dates DESC)

    create statistics suesyouraunt...

  • RE: Find Only Yesterday's Orders?

    Why not just use

    WHERE

    DATEDIFF(day,processdate,getdate()) = 1

    ??

  • RE: Data Validation

    Not 100% sure what you're asking here, but...

    CREATE PROCEDURE IS_MGR

    @STATUSFLG Bit

    AS

    IF (@STATUSFLG = 1)

    BEGIN

    (... Put Code Here...)

    ...

  • RE: IF (COLUMNS_UPDATED()) ???

    Sergiy (4/2/2008)


    mtassin, you forgot to take care about NULLs.

    Also, your script gonna miss the case when user decides to add a space to a string.

    I don't have the structure of...

  • RE: sp_MSForeachdb then sp_MSforeachtable

    You can use whatever you like for the substitution character, but if you use something other than ? you need to specify it with a second parameter to the sp_msforeachdb...

Viewing 15 posts - 991 through 1,005 (of 1,033 total)