First, make all current NULL
values disappear:
UPDATE [Table] SET [Column]=0 WHERE [Column] IS NULL
Then, update the table definition to disallow “NULLs”:
ALTER TABLE [Table] ALTER COLUMN [Column] INTEGER NOT NULL
More Related Contents:
- How much size “Null” value takes in SQL Server
- How do you change the datatype of a column in SQL Server?
- SQL Server – error when creating stored procedure
- NULL values inside NOT IN clause
- Not equal != operator on NULL
- How can foreign key constraints be temporarily disabled using T-SQL?
- Insert multiple rows WITHOUT repeating the “INSERT INTO …” part of the statement?
- Does T-SQL have an aggregate function to concatenate strings? [duplicate]
- Parameter Sniffing (or Spoofing) in SQL Server
- SQL Server String or binary data would be truncated
- How to change identity column values programmatically?
- SQL Server Regular expressions in T-SQL
- How to get a date in YYYY-MM-DD format from a TSQL datetime field?
- How do I format a number with commas in T-SQL?
- Concatenating Column Values into a Comma-Separated List
- Find index of last occurrence of a sub-string using T-SQL
- SQL Server 2008 Empty String vs. Space
- How to set a default value for an existing column
- Need a datetime column in SQL Server that automatically updates when the record is modified
- How do I find a stored procedure containing ?
- Query to list all stored procedures
- WHERE clause on SQL Server “Text” data type
- Get ROWS as COLUMNS (SQL Server dynamic PIVOT query)
- SQL Server 2008 – How do i return a User-Defined Table Type from a Table-Valued Function?
- Check if a string contains a substring in SQL Server 2005, using a stored procedure
- Cannot bulk load. Operating system error code 5 (Access is denied.)
- Does query plan optimizer works well with joined/filtered table-valued functions?
- Is there an “IF EXISTS” test for a linked server?
- ADO.NET calling T-SQL Stored Procedure causes a SqlTimeoutException
- SQL Server stored procedure return code oddity