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 |
|
jeff06
Posting Yak Master
166 Posts |
Posted - 2008-05-20 : 16:08:54
|
| insert #tbl_websubmissions11select *from #tbl_nostatements4I got following error:Server: Msg 515, Level 16, State 2, Line 1Cannot insert the value NULL into column 'statementreceiveddate', table 'tempdb.dbo.#tbl_websubmissions11_______________________________________________________________________________________________00000000052C'; column does not allow nulls. INSERT fails.The statement has been terminated.This code used to work in sql2000, we just update our system to sql server 2005. it fails to work.Please give suggstion how to fix this problem.Thanks.Jeff |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-20 : 16:19:52
|
| You need to update the #tbl_websubmissions11 table so that the statementreceiveddate allows nulls.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
 |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2008-05-20 : 16:27:26
|
| better yet use @TableVariables |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-20 : 16:32:05
|
quote: Originally posted by yosiasz better yet use @TableVariables
You can't make a blanket statement like this plus it doesn't solve the problem. There are times where using local temp tables are better than table variables. For instance, row count matters, whether or not you need to apply indexes, and whether or not you need to insert into these from a stored procedure.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
 |
|
|
|
|
|