Forum Replies Created

Viewing 15 posts - 2,146 through 2,160 (of 6,036 total)

  • RE: Csv list in column to separate columns

    Eliza (10/7/2012)


    1. bcp the table to a file.

    2. BULK INSERT from the file to a new table using comma as a delimiter.

    3. Report success. 🙂

    This wouldn't work as its a...

  • RE: Csv list in column to separate columns

    Eliza (9/17/2012)


    Hi all,

    Can I ask please if I have a row and one column has a csv list in it. Is there a way please to split the csv...

  • RE: Getting the last entry based on a previous entry.

    SELECT R1.Report_ID, R1.[ReportHistoryID], R1.modified_by, R1.last_modified, R2.[ReportHistoryID], R2.modified_by, R2.last_modified

    FROM [dbo].[Reporthistory] R1

    INNER JOIN (SELECT report_ID, MAX(last_modified) LastModified

    From [dbo].[Reporthistory]

    WHERE Report_status_id = 2

    GROUP BY report_ID

    ) RLM ON RLM.report_ID = R1.report_ID

    INNER JOIN [dbo].[Reporthistory]...

  • RE: Archiving...INSERT & DELETE

    Clustered index on [LogTime] should solve the problem.

  • RE: UPDATE when the values are the same

    I did a little experiment using string values of different length.

    Here is the base script:

    USE tempdb;

    SET NOCOUNT ON;

    GO

    CREATE TABLE dbo.Test

    (

    Name char(200)

    COLLATE Latin1_General_CI_AI NULL

    --COLLATE Latin1_General_BIN NULL

    );

    GO

    INSERT dbo.Test

    SELECT...

  • RE: UPDATE when the values are the same

    SQL Kiwi (9/16/2012)


    Sergiy (9/16/2012)


    Actually, you did. Trigger is executed after UPDATE. If SQL Server figures out that the values are the same and does not proceed with writing to the...

  • RE: UPDATE when the values are the same

    SQL Kiwi (9/16/2012)


    Sergiy, I should add that the fun in the example was in working out *why* that particular case gave the performance results it did. With a long...

  • RE: UPDATE when the values are the same

    L' Eomot Inversé (9/16/2012)


    Do you really imagine that the query processor's interface to the storage engine operates on pages as opposed to on rows or attributes?

    How does it matter what...

  • RE: UPDATE when the values are the same

    L' Eomot Inversé (9/16/2012)


    ... the storage engine decides not to update the row

    Can you please provide a reference to a document saying that storage engine operates rows?

    So far every...

  • RE: UPDATE when the values are the same

    SQL Kiwi (9/16/2012)


    According to Paul's logic the set in "inserted" table won't be created.

    No! I have never said anything like this. The inserted and deleted pseudo-tables in a...

  • RE: UPDATE when the values are the same

    Eugene Elutin (9/12/2012)[hr

    It's hard to see what will "prove it beyond all doubt" for Sergiy.

    No, it's actually quite easy to see.

    Some proper experiment.

    Not the one-sided script specifically baked to...

  • RE: CONCATINATE 3 COLUMNS (int) INTO A WORKABLE DATE FORMAT

    Jeff Moden (9/12/2012)Just pray people named their columns for inserts or BOOM!

    Not necessarily.

    If you add a computed column at the end of the table it would not break existing inserts,...

  • RE: Not in clause vs list of <>

    Actually hardcoding business rules is an extremely bad practice.

    So, none of the options is preferrable.

    (do I sound like you know who? 😉 )

    If you follow the proper DB modelling rules...

  • RE: NOT IN query very expensive, 100% CPU

    carlosaamaral (9/11/2012)


    SELECT table1.column1,

    '99',

    left(table1.column2, 2),

    max(table1.column3),

    'Yes',

    'Test'

    FROM table1

    WHERE NOT EXISTS ( SELECT 1

    FROM...

  • RE: UPDATE when the values are the same

    SQL Kiwi (9/7/2012)


    In SQL Server 2008 or later:

    I changed the execution part of you script a little bit:

    EXECUTE dbo.UpdateSame;

    SELECT * FROM dbo.Test -- added to check that the value in...

Viewing 15 posts - 2,146 through 2,160 (of 6,036 total)