Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8342093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:40:18+00:00 2026-06-09T05:40:18+00:00

I am writing a deployment script that Creates a new column with a default

  • 0

I am writing a deployment script that

  1. Creates a new column with a default value of 0 and is Null-able
  2. UPDATE the column data where a certain condition is met

Also note that if I explicitly set the default value to 0 in a INSERT Statement I recieve the same error when I am UPDATING data-

ERROR MESSAGE –

Invalid column name ‘isConvertWithDivison’.

SQL I AM USING –

ALTER TABLE dbo.accountCurrencies 
    ADD isConvertWithDivison BIT NULL DEFAULT 0

UPDATE dbo.accountCurrencies SET  isConvertWithDivison = 1 WHERE  currencyName = 'USD'  

INSERT dbo.accountCurrencies 
        ( currencyName)
VALUES  ( 'AUD'),( 'DKK'),( 'RUB'),( 'SEK')

Seems Obvious what is going on but how do I work around this?

I have tried this to get the new collumn commited to the database before I execute the data changes but still no luck.

BEGIN TRANSACTION
    ALTER TABLE dbo.accountCurrencies 
        ADD isConvertWithDivison BIT NULL DEFAULT 0
COMMIT TRANSACTION

UPDATE dbo.accountCurrencies SET  isConvertWithDivison = 1 WHERE  currencyName = 'USD'  

INSERT dbo.accountCurrencies 
        ( currencyName)
VALUES  ( 'AUD'),( 'DKK'),( 'RUB'),( 'SEK')

FYI – Running SQL 2008 R2

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T05:40:20+00:00Added an answer on June 9, 2026 at 5:40 am

    use GO after alter statement,

    ALTER TABLE dbo.accountCurrencies 
        ADD isConvertWithDivison BIT NULL DEFAULT 0
    
    go
    
    UPDATE dbo.accountCurrencies SET  isConvertWithDivison = 1 WHERE  currencyName = 'USD'  
    
    go
    INSERT dbo.accountCurrencies 
            ( currencyName)
    VALUES  ( 'AUD'),( 'DKK'),( 'RUB'),( 'SEK')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a deployment script that saves timestamped backup files to a backups directory.
I am currently writing a deployment script that installs a number of Windows services.
I'm in the process of writing a deployment script for Office 2010 and several
I'm writing a powershell script for deployment. I need to copy changed files from
I am currently writing a deployment script in MSBUILD, and after downloading several extensions,
I'm writing a deployment application that should install all required components before load main
I am writing a simple shell script that fetches output from one command and
I am writing a deployment script using MSBuild. I want to clean my web
I'm writing a deployment script and have run in to a strange problem... ian@baster:~$
I need help writing a TSQL script to modify two columns' data type. We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.