Forum Replies Created

Viewing 15 posts - 7,621 through 7,635 (of 10,144 total)

  • RE: checking for a column and printing a message

    DROP TABLE #Departments

    CREATE TABLE #Departments (deptID INT, areaID INT, IsActive TINYINT)

    INSERT INTO #Departments (deptID, areaID, IsActive)

    SELECT 102, 20, 1 UNION ALL

    SELECT 103, 20, 1 UNION ALL

    SELECT 104, 20, 1 UNION...

  • RE: Cursor within DTS

    This uses the original data set:

    -- change the name of the working table to #_hhrsales2 for testing

    -- add a new column ([original_cost] [money] NULL) to the working table

    -- There's no...

  • RE: Cursor within DTS

    LadyG (7/23/2010)


    Here you go Chris.

    Thanks

    There are a few errors in here - the only one which appears to matter is the CREATE INDEX..statement which references a column which doesn't exist...

  • RE: Cursor within DTS

    LadyG (7/23/2010)


    Here you go Chris.

    Thanks

    Lovely job LadyG, thanks for this!

  • RE: Cursor within DTS

    Jeff Moden (7/22/2010)


    Chris Morris-439714 (7/21/2010)


    Even if there is a clustered index on the table in the order that the update is supposed to be executed, there's no guarantee that the...

  • RE: Cursor within DTS

    LadyG (7/22/2010)


    Sent PM again. HAve you received it??

    Yes thank you, but there is still no script to populate a table with data to use for testing.

    Typically it would be something...

  • RE: Cursor within DTS

    LadyG (7/22/2010)


    Sent via PM. Would appreciate your ideas. Thanks

    No PM received. Without table creation scripts and some sample data, it's difficult to proceed.

  • RE: Cursor within DTS

    LadyG (7/22/2010)


    The problem is with the last part of the script, insert & select. Obvioulsy, as new_cost doesn't exist in the sales table, the calculated data needs to go somewhere...

  • RE: Cursor within DTS

    In the absence of scripts to create the tables and populate them with data, it's very difficult to tell.

  • RE: Cursor within DTS

    LadyG (7/22/2010)


    Hi Chris,

    Does this means I will have to introduce a new column, newcost, to the tmp_hhrsales2 table?

    You will need at least one new column, probably oldcost. If you can...

  • RE: Convert Decimal(18,6) field to Char(11)

    You're welcome Matt, thanks for the feedback.

  • RE: Convert Decimal(18,6) field to Char(11)

    SELECT MyPrettyNumber = REPLACE(STR(MyNumber*100,11,0), ' ', '0')

    FROM (

    SELECT MyNumber = CAST(11.24 AS DECIMAL(18,6))

    UNION ALL SELECT 100.290000

    UNION ALL SELECT 1000.290000

    ) d

  • RE: Cursor within DTS

    LadyG (7/21/2010)


    HAve attached the table attributes which includes indexes. Pls let me know your thoughts.

    What do the two changes you've made do, how do they affect the data??

    The changes I've...

  • RE: Cursor within DTS

    Jeff Moden (7/20/2010)


    Chris Morris-439714 (7/20/2010)


    The UPDATE of the table is a special kind called a Running Totals Update. Jeff Moden has written some excellent and easily consumable articles about them...

  • RE: Vertical Tables Merge

    mpradeesh (7/20/2010)


    Thank you all. I will go will the row_id for each positiion and join it to the both columns

    Thanks

    Forget table 1 with the ID, it's meaningless and...

Viewing 15 posts - 7,621 through 7,635 (of 10,144 total)