Forum Replies Created

Viewing 15 posts - 211 through 225 (of 428 total)

  • RE: Enriching duplicate records (not deleting)

    Actually, 2 and 3 are still not mutually exclusive this way. For rule 1 you can determine whether a row needs to be included by reading only data from this...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Enriching duplicate records (not deleting)

    Thanks for taking it offline. Please be even more careful with other people's privacy than your own.

    One tip: since 'companyphone' is going to be your first selection criterion, I would...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Enriching duplicate records (not deleting)

    petervdkerk (10/18/2011)


    I need to ...

    The database can be found here: http://www.wu....ng.com/files/prosp_db.zip

    I know for a fact that my employer (JF Hillebrand) does not want their name and contact data listed in...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Is there a "tables collection" in T-SQL?

    declare @stmt nvarchar(max);

    select @stmt = stuff((

    SELECT ' UNION ALL SELECT * FROM ' + quotename(sc.name) + '.' + quotename(st.NAME) + ' WHERE PROTOCOLNAME =...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Display multiple rows values as single row value (Different Columns)

    ;WITH InnerTable AS

    (

    SELECT ROW_NUMBER() OVER (PARTITION BY COURSE_ID, TEACHER_ID ORDER BY COURSE_ID) AS Row,

    TEACHER_ID, COURSE_ID, SCDAY, SCINI, SCEND

    FROM Schedule

    )

    select Teacher_ID,

    Course_ID,

    max(case row when 1...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: convert date in sql

    The opening post seemed to ask for a string to datetime conversion. However as was clarified only recently, poster was actually looking for a conversion from datetime into a formatted...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: convert date in sql

    select convert(datetime, '1967-10-13T17:55:12', 126)

    Do you want me to chew your food for you too? 😉

    Note the comments on BOL though: no spaces!, i.e. one minute past 1 on January first...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Help needed getting max date from 2nd query

    iluvmyelement (10/12/2011)


    UPDATE: I think I made the necessary change to get what I expected. Now I just need to adapt this to my 'real' database with different tables/fields....



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Help needed getting max date from 2nd query

    I haven't tested it (I don't have nw installed), but this should do what you need using a sub-query construction. You can also use the window-functions (f.e. row_number()) to do...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Try catch in a transaction block or transaction in try catch block???

    krishna.vanne (10/10/2011)


    ...

    1. Am I doing it right?

    2. Can I nest the try catch to check for insert into trackingtable too?

    3. Is there a better way to do this?

    1 - No,...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: parse XML file

    Thanks for the attempt, but that is not the execution plan. That is a picture of a part of the execution plan. Please have a look at this article http://www.sqlservercentral.com/articles/SQLServerCentral/66909/...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: trigger

    Just use the "alter table" command.

    For example:

    alter table dbo.Mytable alter column colname int identity(1,1) not null



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: trigger

    Do you know SQL server has a feature called identity? All you need to do is define your primary key column as an int column and give it the identity(<seed>,<increment>)...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Adding either a "1" or "2" in a column (using Select, Union All, and three tables)

    Ok, so let's assume you've got a trigger that creates the view dynamically. And thus you've got the view all set to return all totals for all statusses in a...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: parse XML file

    By specifying '//r' for the xpath, you say SQL server needs to traverse the entire document in search of any elements called 'r', anywhere in the document.

    Do you know anything...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

Viewing 15 posts - 211 through 225 (of 428 total)