Home Forums SQL Server 2008 SQL Server 2008 - General I need to copy records from a table, back into the same table changing the value of on field only. RE: I need to copy records from a table, back into the same table changing the value of on field only.

  • Lowell (5/23/2016)


    it's just syntax.

    you want to select modified data, and insert is still just an insert. i saw what you were tryingto do, though.

    below is a better example

    Insert INTO (

    [ScenarioID]

    ,[CostCenterID]

    ,[CostCenterName]

    ,[FunctionID]

    ,[FunctionName])

    SELECT 'Budget2013' AS [ScenarioID]

    ,[CostCenterID]

    ,[CostCenterName]

    ,[FunctionID]

    ,[FunctionName]

    FROM [US_DWH_NEW].[dbo].[BudgetMasterCostCenterHierarchy]

    where ScenarioID='budget2016'

    Table name is missing from the INSERT.