Forum Replies Created

Viewing 15 posts - 6,736 through 6,750 (of 7,608 total)

  • RE: index creation issue/question ??

    It's just a warning message, unless you actually have a value in that column that exceeds 900 bytes.

    You could put that one index create in a separate step, and for...

  • RE: get the first and last day of any Year/Month

    The integer value for the first day of the month is even easier:

    SELECT BOM = @ThisYear * 10000 + @ThisMonth * 100 + 1,

    but you must CAST it to char(8)...

  • RE: How to shrink TempDb

    GilaMonster (2/25/2013)


    ScottPletcher (2/25/2013)


    GilaMonster (2/25/2013)

    CTEs don't store results

    Never??? What if enough memory does not exist to store the results? Surely the results would spill to disk then, presumably...

  • RE: Updating specific rows

    Not a lot to go on, but maybe something like this:

    DECLARE @rows_updated TABLE (

    area <same_datatype_as_in_table>,

    year <same_datatype_as_in_table>,

    benchmark <same_datatype_as_in_table>

    ...

  • RE: Show all data from four tables joined or matched on a particular column

    SELECT

    COALESCE(t1.comp_name, t2.comp_name, t3.comp_name, t4.comp_name) AS comp_name,

    ...

    FROM dbo.Tbl1 t1

    FULL OUTER JOIN dbo.Tbl2 t2 ON

    t2.comp_name = t1.comp_name

    FULL OUTER JOIN dbo.Tbl3...

  • RE: How to shrink TempDb

    GilaMonster (2/25/2013)

    CTEs don't store results

    Never??? What if enough memory does not exist to store the results? Surely the results would spill to disk then, presumably to tempdb...

  • RE: Subquery error

    IF EXISTS(SELECT 1 FROM VERSION

    WHERE VERSION LIKE '7.[01234567]%')

    BEGIN

  • RE: TSQL joined Views

    Usually views contain lots of columns that aren't really needed when several of them are joined to produce a new result set.

    Stop using the views and code directly against the...

  • RE: Every 3rd Friday of the Month

    SELECT

    CASE WHEN GETDATE() >= DATEADD(DAY, 1, [current_month_3rd_friday]) THEN

    --current day of month is past 3rd Fri, so calc next...

  • RE: How to reduce the number of table access from multiple "select count(*) group by" with union all

    Select

    A, B, C,

    sum(case when A between 1 and 100 and B between 1 and 100 and C...

  • RE: Need Deadlock troublehshoot help

    Holy cripe! A single, stand-alone INSERT and UPDATE are deadlocking? That table has serious performance issues and should be reviewed immediately. In the meantime, if at all...

  • RE: Need Deadlock troublehshoot help

    the other is doing Update on TableA by PK

    I'm guessing there are joins involved to help determine which row(s) to update.

    Try using just SELECT instead of UPDATE to get the...

  • RE: Alternatives to @@RowCount?

    In SQL Server this is really only one transaction. You can issue multiple BEGIN TRANSACTIONS, but the outer transaction is the only one that really counts. You can...

  • RE: Writing the Where Clause for a Query/Stored Procedure.....

    Specifically, something like this:

    SELECT sum([Fatigue/Weakness]), sum([Loss of Appetite]), sum([Rash(Macular-Papular)]), sum([Headache]), sum([Retro-Orbital Pain]), sum([Cough]), sum([Cold]), sum([Sore Throat]),sum([Dyspnea]), sum([Nausea]), sum([Vomitng]), sum([Diarrhea]),sum([Constipation]),

    sum([Petechiae]), sum([Subcutaneous Hemorrhage]), sum([Gum Bleeding]), sum([Gum Bleeding(Days)]), sum([Epistaxis]), sum([Hematemesis]), sum([Melaena]), sum([Bleeding...

  • RE: Rows being dropped in query

    is there something in the join that could be counting these records out?

    Maybe in some cases "s.[to Date of service]" is NULL to indicate "no end date"?

Viewing 15 posts - 6,736 through 6,750 (of 7,608 total)