Forum Replies Created

Viewing 15 posts - 1,186 through 1,200 (of 2,007 total)

  • RE: Row to column data show

    prashant-507002 (12/9/2011)


    Please try to understand As per your query i have to modify query each when user added new fieldName

    No you don't.

    Read what I wrote again, it uses dynamic SQL...

  • RE: Row to column data show

    prashant-507002 (12/9/2011)


    This is vertically data storage

    I can not put the hard code fieldname bcz user can add more field name in it.

    BEGIN TRAN

    SELECT Id, FieldName, FieldValue, RecordID

    INTO #temp

    FROM (SELECT 1,...

  • RE: Rollback data

    prashant-507002 (12/9/2011)


    I have run the update query in ssms without doing begin transaction.

    Are there any way to rollback the updated data?

    Hope it wasn't a production database.

  • RE: Row to column data show

    I don't like that there is no ID to show where 1 record ends and another begins, but try this

    BEGIN TRAN

    SELECT Id, FieldName, FieldValue

    INTO #temp

    FROM (SELECT 1, 'Name', 'John...

  • RE: Collapse a column into a single field that is keyed off another column

    BEGIN TRAN

    SET NOCOUNT ON

    --Create sample data to play with

    SELECT name, col1, col2

    INTO #yourTable

    FROM (SELECT 'mary', 'id222', 'a'

    UNION ALL SELECT 'mary', 'id222', 'b'

    ...

  • RE: >=x versus IN

    Here's a 1 million row attempt to reproduce what you're describing.

    BEGIN TRAN

    SET NOCOUNT ON

    IF object_id('tempdb..#testEnvironment') IS NOT NULL

    BEGIN

    DROP TABLE #testEnvironment

    END

    --1,000,000 Random rows of data

    SELECT TOP 1000000 IDENTITY(INT,1,1) AS ID,

    (ABS(CHECKSUM(NEWID()))...

  • RE: Split String

    Check out this article[/url], it explains how to do exactly what you need.

  • RE: update a huge data in one query.

    1. 18,000 is not a "huge data".

    2. The query you were given works fine

    3. Your database design is awful and will cause performance problems as your data-set increases.

    BEGIN TRAN

    SET NOCOUNT...

  • RE: Time Computation Challenge

    Feeling a bit kind.

    I've left a deliberate flaw in the design for you to work out.

    BEGIN TRAN

    CREATE TABLE #breaks (

    breakID INT IDENTITY PRIMARY KEY,

    breakTimeFrom TIME,

    breakTimeTo TIME)

    INSERT INTO #breaks

    SELECT breakTimeFrom, breakTimeTo

    FROM...

  • RE: Are the posted questions getting worse?

    Evil Kraig F (12/9/2011)


    Koen Verbeeck (12/9/2011)


    Cadavre (12/9/2011)


    Koen Verbeeck (12/9/2011)


    It's get even worse. There's a channel with relative new movies (Green Lantern and Hangover II for example). Then there's another channel...

  • RE: Are the posted questions getting worse?

    Koen Verbeeck (12/9/2011)


    Cadavre (12/9/2011)


    Koen Verbeeck (12/9/2011)


    I recently moved to a new house and I took the opportunity to get me and my family digital television (it's fairly "new" in Belgium).

    So...

  • RE: Dplicate records coming from SQL

    Why? What do you think is wrong with DISTINCT?

    SELECT role_name, mbr_id, start_dt, end_dt

    FROM (SELECT ixo_rlt_code AS role_name, ind_membership_id_ext AS mbr_id, ixo_start_date AS start_dt, ixo_end_date AS end_dt

    ...

  • RE: Are the posted questions getting worse?

    Koen Verbeeck (12/9/2011)


    I recently moved to a new house and I took the opportunity to get me and my family digital television (it's fairly "new" in Belgium).

    So now I have...

  • RE: Prevent option for saving changes

    Ellen-477471 (12/8/2011)


    When connected to the Management Studio on a SQL Server 2008 R2 server, I modified an existing table using 'Design' [also tried 'Add column'] ... after the two columns...

  • RE: Today's Random Word!

    SQLRNNR (12/8/2011)


    Yay. Now I know for sure that there are only 17 days until Christmas.

    And knowing is half the battle.

    /@

    \ ...

Viewing 15 posts - 1,186 through 1,200 (of 2,007 total)