Ok, this is another gotcha. If you are running Stored procedures on MSSQL via FreeTDS and the procedure has inserts into fields not explicitly set to allow nulls it will fail - however via query analyser it will work ok.
Problem is Query Analyser by default sets “ANSI_NULL_DFLT_ON ON” so the following code will work
Create table #Included_Usage (id int ,TotalUsage float null, EligibleUsage float null, EligibleLength int null, Airtime int null)
insert into #Included_Usage( NULL,’101′,’2′,2,4 );
However from FreeTDS it will bork. You have two options - attempt to set ANSI_NULL_DFLT_ON before running the proc, or change the proc to explicity allow nulls
Create table #Included_Usage (id int null,TotalUsage float null, EligibleUsage float null, EligibleLength int null, Airtime int null)
cI prefer the second alternative. I always like to err on the side of explicit definition, rather than implicit. Usually saves someone from bashing their head on something.