March 20, 2012 at 7:55 am
hello im facing this rather easy problem. i want to use an integer datafield to calculate balance.i want the first data inside the field to be zero(0) so that i can use it to increment/decrement the default balance value.but the first data is NULL so it isnt participating in calculations.i dont know if you've got me or not.if you've got me then please try to help me or if you haven't then ask me specifically
March 20, 2012 at 8:01 am
Create a DEFAULT for your column. You can do it via T-SQL or Table Design in SSMS
March 20, 2012 at 8:03 am
If you mean a column in a table, you can add a default value to one, like this:
alter table dbo.MyTable
add default(0) for MyColumn ;
You'll need to use real table and column names, of course.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply