Forum Replies Created

Viewing 15 posts - 6,316 through 6,330 (of 7,597 total)

  • RE: Sql Query Help

    Something like below. If the LAST_NAME and FIRST_NAME are in the same table (shouldn't be, from a design standpoint), then you can remove the outer query and join and...

  • RE: CASE Statment Help

    DarthBurrito (11/13/2013)

    I will get a false 1 since the modifieddate will always be larger than the ClosedField that has a NULL.

    How can I tell it when the DateClosed field is...

  • RE: calculating a date in the future

    a20213 (11/7/2013)


    Perfect Mr. Scott.

    Indeed, the same day of week has to be the same, mandatory.

    PS: When you say "So, adding 6 mos gives a date of '2014-11-05', which becomes '2014-11-11',...

  • RE: calculating a date in the future

    None of that is necessary: a simple calculation can give you the future date you need.

    The code below assumes you want a future matching-day date on or after the months-added...

  • RE: Compact, fully indexed, archive database

    You should also consider using option "SORT_IN_TEMPDB = ON" in the rebuild. That should give you about the same space gains without having to use a separate fg within...

  • RE: Index/table rebuild

    1. The only way to rebuild heaps is to add a clustered index; you can then drop it. Since, however, adding or dropping a clus index requires rebuilds...

  • RE: Pseudo PIVOT query

    SELECT

    MatchID, KeyCode,

    CASE KeyCode

    WHEN 'MTDT' THEN CONVERT(varchar(100), MatchDate, 101)

    ...

  • RE: How can I select values where first 2 characters are non numeric and last character is 1

    Safer might be:

    WHERE

    FtgNr NOT LIKE '[^0-9][^0-9]%1'

    Unless you really want "alphabetic" rather than "non-numeric" as originally stated. Spaces, underscores, periods, etc., would fail this test but pass the other one...

  • RE: Sp runs from 7 sec to 10 min (UnitPricingTrans)

    RVO (11/4/2013)


    ScottPletcher,

    We don't have authority to alter table definitions.

    This is Financial Application database by third party.

    We don't own the database.

    We even create all our custom code in a separate (Diff_Data)...

  • RE: Sp runs from 7 sec to 10 min (UnitPricingTrans)

    I think the clustered index should be ( accounting_period ) or, if you prefer, ( accounting_period, prj_code ) rather than the other way around. I don't think phase_code needs...

  • RE: Sp runs from 7 sec to 10 min (UnitPricingTrans)

    Please post the DDL, including all indexes, for the "prj_detail" table.

    If the clustered index is on an identity column, you should almost certainly change it to "accounting_period" instead. This...

  • RE: A trigger prevent user from update/delete a user login

    Instead of DDL_LOGIN_EVENTS, you can use DDL_SERVER_SECURITY_EVENTS, which covers a much wider range of statements. See BOL, "DDL Event Groups" for more details.

    You'll need to use EVENTDATA() from within...

  • RE: SQL Search very slow please help

    Kurt W. Zimmerman (11/1/2013)


    clayman (11/1/2013)


    Kurt W. Zimmerman (11/1/2013)


    clayman (11/1/2013)


    Kurt W. Zimmerman (11/1/2013)


    If I'm going to move data from one server to another via Import/Export I will script out...

  • RE: Performance Issue

    Not that familiar with Citrix, but maybe there is some way to get it to pass the original login info? Perhaps as some type of comment, or by writing...

  • RE: regarding validations in stored procedure

    SELECT

    @paid =

    CASE WHEN day_of_week = 5 /*Sat*/ THEN CASE WHEN @age <= 10 THEN 300 ELSE 500 END

    ...

Viewing 15 posts - 6,316 through 6,330 (of 7,597 total)