Skip to Content.
Sympa Menu

freetds - RE: problem inserting nulls in a temporary table in a s tored procedure

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: problem inserting nulls in a temporary table in a s tored procedure
  • Date: Fri, 8 Nov 2002 13:52:27 -0500


> From: Isaac Grant [mailto:isaac AT silverorange.com]
> Sent: November 8, 2002 1:26 PM
>
> Running the following stored procedure returns an error:
>
> CREATE PROCEDURE sp_testing as
> SET NOCOUNT ON
> CREATE TABLE #test (testcol1 int,testcol2 int)
> INSERT INTO #test VALUES (1,NULL)
>
> SELECT * FROM #test
>
> Ther error returned is:
>
> Nov 8 14:17:52 zest httpd: PHP Warning: Sybase error:
> Cannot insert the
> value NULL into column 'testcol2', table
> 'tempdb.dbo.#test_____________________________________________
__________________________________________________________________0001000149
89';column
> does not allow nulls. INSERT fails. (severity 16)


That's completely normal.

There's a database option that determines the default nullness of columns.
It can also be affected by connection settings. Cf. SET ANSI_NULL_DFLT_ON.


Which API and TDS version are you using? It might be that the connection
setting changed between versions.

--jkl




The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that we do not accept account orders and/or
instructions by e-mail, and therefore will not be responsible for carrying
out such orders and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page