Forum Replies Created

Viewing 15 posts - 6,511 through 6,525 (of 7,608 total)

  • RE: DATABASE BACK UP PROBLEM

    I would never have them run their own BACKUP command.

    You need to have them call a stored proc so that you can add/override all options necessary to the BACKUP; for...

  • RE: quick edit data

    For a very small number of immediate changes, it's ok. But close the window immediately after the changes. If you let it hang open, you might cause issues...

  • RE: Finding the Top X Values Each Day from History Table

    Not much to go on, but probably something like this:

    SELECT ...

    FROM (

    SELECT

    ...,

    ...

  • RE: CALCULATE 2 years back data

    OK, so:

    datetime_column < DATEADD(YEAR, -2, DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 0))

  • RE: sp_send_dbmail Query

    Just capture value of the RecordID that you just modified in the calling code, and pass it into the code to be dynamically executed:

    @query = 'DECLARE @RecordID AS Varchar(12)

    SET @RecordID...

  • RE: CALCULATE 2 years back data

    In general, as below. But, if the column is not datetime, CAST the date calc to the exact datetime of the column. For example, if the column is...

  • RE: Performance Tuning Large update statement--HELP

    dspink (7/15/2013)


    Also any thoughts on this approach?

    Select * INTO T1_Obfuscated FROM T1. (obfuscating only columns needed.) then dropping T1 and renaming T1_Obfuscated to T1. Not really too worried about space...

  • RE: Performance Tuning Large update statement--HELP

    Sean Lange (7/15/2013)


    Many of the things you listed as possibilities are likely to help but probably the biggest performance woe is calling the same scalar function 11 times for 250...

  • RE: Finding the most recently modified row from a group of tables

    SELECT IP.IPCode, MAX(AllSubtables.UpdateDate) AS LastUpdateDate

    FROM SAMPLE.IP IP

    INNER JOIN (

    SELECT IPCode, MAX(UpdateDate) AS UpdateDate FROM SAMPLE.IP IP2 GROUP BY IP2.IPCode

    UNION ALL

    SELECT IPCode, MAX(UpdateDate) AS UpdateDate FROM SAMPLE.AddressProfile AP GROUP BY AP.IPCode

    UNION...

  • RE: Check series is valid or not

    SELECT CASE WHEN Total_Rows = Active_Rows THEN 'Valid' ELSE 'Invalid' END AS Status

    FROM (

    SELECT

    SUM(1) AS Total_Rows,

    ...

  • RE: GetDate() 5 Years ago without time formated 'YYYY-MM-DD'

    Welsh Corgi (6/24/2013)


    Thanks for the help guys.

    I'm using the Data calculation in the WHERE Clause.

    WHERE Effective_Date < CONVERT(DATE, DateAdd(yy, - 5, GetDate()));

    Does it matter which method I use as far...

  • RE: Red lines under third occurance of a table name

    Sean Pearce (7/11/2013)


    ScottPletcher (7/11/2013)


    Sean Pearce (7/11/2013)


    bert.hooks (7/11/2013)


    Wow. Insults from an idiotic know-it-all.

    Pot --> kettle --> black.

    Excuse me for being defensive, but Microsoft products have been putting food on...

  • RE: linked server issue

    PearlJammer1 (7/11/2013)


    Scot - your suggestion worked. I had to enable the MSDTC service and now the distributed queries run.

    Thanks for the pointer !

    🙂

    No problem. That's the most common fix,...

  • RE: Red lines under third occurance of a table name

    Sean Pearce (7/11/2013)


    bert.hooks (7/11/2013)


    Wow. Insults from an idiotic know-it-all.

    Pot --> kettle --> black.

    Excuse me for being defensive, but Microsoft products have been putting food on my table since...

  • RE: Red lines under third occurance of a table name

    You could also just add a "GO" after the ALTER TABLE; that will put the SELECTs in a separate batch, by which table SQL should "know" they already exist, having...

Viewing 15 posts - 6,511 through 6,525 (of 7,608 total)