Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
senthilaa
Starting Member
12 Posts |
Posted - 2008-04-19 : 17:30:19
|
| Hi I have a table, which contains Char and NChar NOT NULL columnsNow I need to change it to NULL, when I use the following command, it fails for the following error,The command I used,ALTER TABLE <TableName>ALTER COLUMN <ColName> CHAR NULLALTER TABLE <TableName>ALTER COLUMN <ColName> NCHAR NULLMsg 8152, Level 16, State 13, Line 1String or binary data would be truncated.The statement has been terminated.But for the same table, the below command executes fine,ALTER TABLE <TableName>ALTER COLUMN <ColName> SMALLINT NULLAlso I can change the NULLABILITY from NOTNULL to NULL using Enterprise Manger, editing the table using Table Design and selecting Allow Nulls option.I need a script to accomplish this task.Any help would be greatly appreciated.-Senthil |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2008-04-19 : 17:38:32
|
| you need char(n) nullwhere n is the length of the column.The error is because it is taking the default length which is smaller than the current size.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|