Forum Replies Created

Viewing 15 posts - 5,341 through 5,355 (of 26,490 total)

  • RE: Tuning CPU intensive remote query

    sql-lover (5/1/2015)


    Lynn Pettis (5/1/2015)


    Give the following a try:

    INSERT INTO #t

    SELECT DOB, col2, col3 FROM OPENQUERY([Server1],'

    SELECT top 1 @DOB, col2, col3

    FROM MyDatabase.dbo.MyTable

    WHERE col4 = @ZipCode

    AND col1 = @DOB

    ORDER BY MetricDate...

  • RE: Tuning CPU intensive remote query

    sql-lover (5/1/2015)


    Hi,

    I am tuning the following CPU intensive query, which is also a remote query for a given store procedure:

    INSERT INTO #t

    SELECT top 1 @DOB, col2, col3

    FROM Server1.MyDatabase.dbo.MyTable

    WHERE col4...

  • RE: Are the posted questions getting worse?

    jonathan.crawford (5/1/2015)


    Jeff Moden (5/1/2015)


    I had a rare and wonderful opportunity, today. Luis is in town and I finally got to meet him and have lunch with both him and...

  • RE: Fantasy Football 2015

    Bumping the FF2015 thread!

  • RE: Fantasy Football 2014

    roryp 96873 (5/1/2015)


    I'm in too when that rolls around. Steve already created a thread for the 2015 season a while ago. He must have been excited.

    Didn't see that...

  • RE: Fantasy Football 2014

    August will be here before we know it.

  • RE: Fantasy Football 2014

    Hey, I just got an email from Yahoo Sports. Looks like its time for more Fantasy Football!

    Count me in for 2015!

  • RE: Creating Primary Key on temporary table question

    ScottPletcher (4/30/2015)


    ScottPletcher (4/30/2015)


    Don't name the constraint, as constraint names have to be unique.

    ALTER TABLE dbo.test

    ADD PRIMARY KEY CLUSTERED

    ( ReportRunTime, VisitID, SourceID, BaseID, OccurrenceSeqID, [DateTime], SeqID, QueryID, Response );

    The original version...

  • RE: Creating Primary Key on temporary table question

    ScottPletcher (4/30/2015)


    Don't name the constraint, as constraint names have to be unique.

    ALTER TABLE dbo.test

    ADD PRIMARY KEY CLUSTERED

    ( ReportRunTime, VisitID, SourceID, BaseID, OccurrenceSeqID, [DateTime], SeqID, QueryID, Response );

    Since you can name...

  • RE: Works in 2008, not in 2012.

    lmacdonald (4/30/2015)


    I got this query from a tuning book and it does not run in 2012. I believe the issue is in the substring section, and the error mentions...

  • RE: Running sysfiles on a database, bringing in error.

    SQL-DBA-01 (4/30/2015)


    HI Experts,

    Whenever I'm runing query against the below database alone, it throws me the error. Any suggest why this happens?

    use [AdventureWorks_2005]

    SELECT * FROM dbo.sysFILES

    OR

    SELECT ...

  • RE: Delete statement suggestion that will help me fix my statement

    Michael Meierruth (4/30/2015)


    Pretty absurd this 'set dateformat' stuff.

    But I'll now vote for 'yyyymmdd' when hard coding dates.

    Not really when you consider that this setting can be affected by how the...

  • RE: Delete statement suggestion that will help me fix my statement

    Eric M Russell (4/30/2015)


    To prevent a conversion error, I had to change 2015-04-30 to 2015-04-10, where the month and day can be interchangable.

    set dateformat mdy;

    select cast('2015-04-10' as datetime);

    2015-04-10 00:00:00.000

    set dateformat...

  • RE: Trouble playing with dates

    dany.fortier (4/30/2015)


    Lynn Pettis (4/30/2015)


    dany.fortier (4/30/2015)


    YYYY-MM-DD is the format on the DB

    I try this SELECT ISNULL(MONTH(Anniversaire),''),'', Anniversaire FROM Tbl_RH_Pharmacie but got the same error, Am i doing it correctly &

    Try...

  • RE: Are the posted questions getting worse?

    Gail, iirc it may have been something I read in one of your posts or even a blog relating to temp tables in tempdb. Could you drop by this...

Viewing 15 posts - 5,341 through 5,355 (of 26,490 total)