Forum Replies Created

Viewing 15 posts - 4,231 through 4,245 (of 26,490 total)

  • RE: Getting previous month data when new year starts

    Another opinion.

    declare @CurrentDate datetime = dateadd(month,1,getdate()); -- Say current date is a month from now. In the declares below you could use GETDATE() instead.

    declare @StartDate datetime = dateadd(month,datediff(month,0,@CurrentDate) -...

  • RE: Rethinking Hiring

    jeffrey yao (12/2/2015)


    Iwas Bornready (12/2/2015)


    ian.lee 73912 (12/2/2015)


    Negative thinking senior manager: "What if we invest in training and developing our people and they leave us?"

    Positive thinking senior manager: "What if we...

  • RE: Copying an SQL table from one Server to another

    I agree with Sean. Since you are using 2000 and 2005 the problem may the direction you are going. If the table exists in 2005 and you are...

  • RE: Rethinking Hiring

    My problem is dual edged sword of technology. Businesses are quick to want to use new technologies to meet customer needs and expectations, but refuse to use the same...

  • RE: Need help with NOT IN

    mhuff 48469 (12/2/2015)


    Still a pup with SQL and having difficulty with this query that I am building off of an old Access query.

    SELECT

    '0720'AS Department,

    '2016' AS FY,

    DATEADD(DAY,-4,CONVERT(DATE,GETDATE())) AS PeriodEndDate,

    sum(chg_unt_no) as 'Count'

    FROM

    TPM300_PAT_VISIT

    INNER...

  • RE: writing queries that easily readable

    GilaMonster (12/2/2015)


    xsevensinzx (12/2/2015)


    I'm saying the one statement where not having a properly terminated statement above it could cause the code to error as a bug, could benefit from always ensuring...

  • RE: writing queries that easily readable

    xsevensinzx (12/2/2015)


    Can't stress semi-colons enough. I didn't have it in my sample, but it should be at the end of each statement. Don't forget to put it at the beginning...

  • RE: Restore Full, Differential and multiple bacups

    Welsh Corgi (12/1/2015)


    There is a way to restore all of the backups, Full, Differential backups from the GUI.

    SQL Server detects the differential and all of the all of the transaction...

  • RE: Use of SP_

    JustMarie (12/1/2015)


    Why not use _sp as a suffix? It still shows that the code is a stored procedure and lets you group things by name much more easily.

    I've advocated...

  • RE: Code: 0xC002F210

    mshashi259 (12/1/2015)


    I get the same error message..

    @backupSetId =...".: 100% complete End Progress Progress: 2015-12-01 03:02:37.21 Source: Back Up Database (Transaction Log) ...

  • RE: Where clause prevents index seek

    PHXHoward (12/1/2015)


    On its own, it is checking the table to see if there is a persisted computed column that has a NCI that matches the WHERE criteria. That's pretty...

  • RE: Override Syntax with a Query Plan

    Save the execution plans as .sqlplan files and upload those.

  • RE: Where clause prevents index seek

    PHXHoward (11/30/2015)


    I get it that they look the same but I did not know that SQL Server was smart enough to use an NCI on a computed column that is...

  • RE: Creating Trigger

    Alvin Ramard (11/30/2015)


    Lynn Pettis (11/30/2015)


    Lynn Pettis (11/30/2015)


    Alvin Ramard (11/30/2015)


    Lynn Pettis (11/30/2015)


    Pulling hen's teeth, but based on what little detail you have been willing to provide, does the following help?

    create table...

  • RE: Where clause prevents index seek

    PHXHoward (11/30/2015)


    Lynn's solution got us through it. I don't understand why it worked but it did.

    Creating a persisted computed column with '_' + PK and then creating a NCI on...

Viewing 15 posts - 4,231 through 4,245 (of 26,490 total)