Forum Replies Created

Viewing 15 posts - 3,136 through 3,150 (of 5,393 total)

  • RE: interview with microsoft

    Zeal-DBA (6/6/2011)


    please let me know wat are the specific things in "operating system concepts" on which i should have strong knowledge as a sql server DBA.

    Quite a lot of...

    -- Gianluca Sartori

  • RE: INSERT IF NOT EXISTS

    INSERT INTO #temp (item_code,variant_code)

    SELECT DISTINCT T2.psp_item_no,T2.psp_item_var

    FROM pmddb..pmd_mpsp_ps_postn T2

    WHERE T2.psp_io_flag = 'i'

    AND NOT EXISTS (

    SELECT 1

    FROM #temp AS T1

    ...

    -- Gianluca Sartori

  • RE: Is this true?

    I think you're right, it should be the other way round.

    I'm curious to read other opinions.

    -- Gianluca Sartori

  • RE: INSERT IF NOT EXISTS

    DISTINCT should do:

    INSERT INTO #temp (item_code,variant_code)

    SELECT DISTINCT T2.psp_item_no,T2.psp_item_var FROM pmddb..pmd_mpsp_ps_postn T2 WHERE T2.psp_io_flag = 'i'

    Hope this helps

    Gianluca

    -- Gianluca Sartori

  • RE: Are the posted questions getting worse?

    WayneS (6/4/2011)


    You'll enjoy it even more than being a father... you can spoil them, then hand them back to the parents!

    Confirmed!

    This is what my in-laws do with my 2...

    -- Gianluca Sartori

  • RE: Are the posted questions getting worse?

    Lynn Pettis (6/4/2011)


    Okay denizens of The Thread, I got a call yesterday evening from my oldest daughter that actually left me speechless.

    I am going to be grandfather![/i]

    Looks like I'll need...

    -- Gianluca Sartori

  • RE: How To Determine which days are weekends

    Vedran Kesegic (6/3/2011)


    This expression is independent of any language and datefirst settings:

    -- gives 1 for monday..., 7 for sunday

    datepart( weekday, @datetime + @@datefirst - 1 )

    This is a really smart...

    -- Gianluca Sartori

  • RE: REMOVE DUPLICATE

    You have to group your data on one or more columns:

    ;WITH SampleData

    AS (

    SELECT *

    FROM (VALUES

    (1, 'ABC11'),

    (1, 'ABC12'),

    (2, 'ABC11'),

    (2, 'ABC12'),

    (3, 'ABC11'),

    (3, 'ABC12'),

    (4, 'ABC11'),

    (5, 'ABC11'),

    (6, 'ABC11'),

    (6, 'ABC12'),

    (7, 'ABC12')

    ) AS InputData...

    -- Gianluca Sartori

  • RE: Are the posted questions getting worse?

    Lynn Pettis (6/3/2011)


    Had a phone interview Thursday morning with Microsoft. It seemed to go pretty good. We'll know how good if the fly me up to Redmond for...

    -- Gianluca Sartori

  • RE: Best possible join

    It should be an index with both fields in it. It should not matter which one first, especially when both tables have billions of rows, as it would probably end...

    -- Gianluca Sartori

  • RE: Best possible join

    Something like this should do:

    SELECT *

    FROM EMP2

    WHERE NOT EXISTS (

    SELECT 1

    FROM EMP1

    WHERE EMP2.Name = EMP1.Name

    ...

    -- Gianluca Sartori

  • RE: How To Determine which days are weekends

    You can use DATEPART to check the weekday:

    select datepart(weekday , getdate())

    Depending on your @@DATEFIRST setting, you will have to check for days 1 and 7 (default for US English) or...

    -- Gianluca Sartori

  • RE: does query lan gets modified after defragmentaion?

    Index rebuild recreates statistics with fullscan. When statistics are rebuilt, all dependant plans get invalidated.

    I don't know what happens with index reorganize, but I suspect it doesn't rebuild stats.

    Hope this...

    -- Gianluca Sartori

  • RE: Are the posted questions getting worse?

    paul.knibbs (5/31/2011)


    Jeff Moden (5/29/2011)


    Now that's cool. Didn't know that. I may have to look into that... you're getting better gas mileage than my 1300 cc motorcycle.

    I average 57mpg...

    -- Gianluca Sartori

Viewing 15 posts - 3,136 through 3,150 (of 5,393 total)