Forum Replies Created

Viewing 15 posts - 4,276 through 4,290 (of 7,597 total)

  • RE: aggregate for previous year specific date

    You might want to consider adding a flitered index on deceased date including the PatientNumber and DivisionCode. Then you can do an easy self-join, which I think should be...

  • RE: Recreating tables from a list of tables

    Andre 425568 (5/23/2016)


    We found that fixing this brings fragmentation down by anything from 0-60 % after doing table rebuilds, after rebuilds we staill have fragmentation on tables and indexes. We...

  • RE: Summing with different GL Accounts into one row

    It looks like some columns are missing from the SELECT above, so I can't try to do the full query, but here's a general approach for using a lookup table...

  • RE: Not returning Table Name

    IF OBJECT_ID('tempdb.dbo.#DBDATATYPES') IS NOT NULL

    DROP TABLE #DBDATATYPES

    CREATE TABLE #DBDATATYPES

    (

    DbName nvarchar(128)

    ,TableName nvarchar (128)

    ,ColumnName nvarchar (128)

    ,Datatype nvarchar (128)

    )

    INSERT INTO #DBDATATYPES

    EXEC sys.sp_MSforeachdb '

    IF ''?'' IN (''master'', ''msdb'')

    ...

  • RE: YEAR TO DATE DATA

    SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, START_DATETIME), 0) AS START_MONTH,

    SUM(SALES) AS TOTAL_SALES

    FROM MY_TABLE

    WHERE START_DATETIME >= '20150101' AND START_DATETIME < '20150511'

    GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, START_DATETIME), 0)

    ORDER BY...

  • RE: Using computed Columns to Create another Computed Column

    Matthew Saggers-700210 (5/12/2016)


    Lowell, yes this is the way to go. I found when the compute is quite complex like

    A int

    B int

    c int

    D as A+B

    E as ((A+B) / c) /...

  • RE: Unique Indexes Are Code; Non-Unique Indexes Are Data

    orjan.franzen (5/6/2016)


    Having to drop an unique index to increase performance can be done easily with a generated script wether it's a primary key with clustered index or a unique clustered...

  • RE: Unique Indexes Are Code; Non-Unique Indexes Are Data

    orjan.franzen (5/6/2016)

    The usage of unique indexes instead of declarative primary key constraints is just an old way of implementing entity integrity and should be avoided/forbidden if it's not for backwards...

  • RE: Unique Indexes Are Code; Non-Unique Indexes Are Data

    RichB (5/6/2016)


    What utter flamebait.

    Congratulations.

    As to people who are saying it's the DBA's job to index - Developers can't possibly be expected to grasp the subtleties... hogwash.

    No, it's not....

  • RE: Need some help transposing a query

    Select mcr.*

    FROM dbo.G_MASTER_CODING_RESULTS AS mcr WITH (NOLOCK)

    left join (

    SELECT

    MCRNUS.MASTER_CODING_RESULTS_ID

    FROM G_MASTER_CODING_RESULTS AS MCRNUS With (NOLOCK)

    WHERE...

  • RE: efficient Querying - NOT EXISTS

    pietlinden (5/4/2016)


    You could... but I'd read this first:

    http://sqlinthewild.co.za/index.php/2009/08/17/exists-vs-in/

    I would have sworn that EXISTS stops as soon as a True/False changes, while an IN reads the whole table. So I would...

  • RE: master, model, msdb

    cookiemonstagt (5/3/2016)


    So the data is saved on shared file and config locally .?

    I coded the backups to go to c:, which is local drive for that node only,...

  • RE: master, model, msdb

    Lynn Pettis (5/3/2016)


    ScottPletcher (5/3/2016)


    You can backup the dbs using the commands below from within SSMS or other appropriate SQL utility. Since someone has gone to the trouble to cluster...

  • RE: master, model, msdb

    cookiemonstagt (5/3/2016)


    Oh my

    .. thanks and one last question if the db is shared each node has these 3 files to be able only to run the...

  • RE: efficient Querying - NOT EXISTS

    You need to create an index on ID in T2, T3, T4, T5 and T6.

    You should check the tables in the order of most likely to EXIST first, so that...

Viewing 15 posts - 4,276 through 4,290 (of 7,597 total)