Insert Error: Column name or number of supplied values does not match table definition.
- From: "Jason" <JasonJason@xxxxxxxxxxxxx>
- Date: Mon, 14 May 2007 16:33:30 -0700
I am hoping someone has seen this before and/or can provide some insight...
I have a classic .asp web site that is running this sql against a SQL Server
2005 database:
set nocount on;
if object_id('tempdb..#TempChartData_410','U') is not null
Drop Table #TempChartData_410;
Create Table #TempChartData_410 (FromDate datetime, ToDate datetime);
declare @Diff int;
declare @BeginDate datetime;
declare @EndDate datetime;
set @BeginDate = cast('03/01/2006' as datetime);
set @EndDate = cast('05/20/2007' as datetime);
set @Diff = datediff(ww,@BeginDate,@EndDate);
while @Diff > 0
begin
set @EndDate = dateadd(ww, 1, convert(varchar(10), @BeginDate, 101));
insert into #TempChartData_410 values (@BeginDate, @EndDate);
set @BeginDate = @EndDate;
set @Diff = @Diff-1;
end
When run from my .asp page, this code generates the following error:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Insert Error: Column name or number of supplied values does not match table
definition.
When run from Management Studio it runs just fine.
Anyone know what might be causing it, and how I can fix it?
Thanks!
/jason
.
- Follow-Ups:
- RE: Insert Error: Column name or number of supplied values does not match table definition.
- From: Walter Wang [MSFT]
- RE: Insert Error: Column name or number of supplied values does not match table definition.
- Prev by Date: Trying to use m_strSort with OLE DB
- Next by Date: RE: Programming hyperlink field of an MS Access Database
- Previous by thread: Trying to use m_strSort with OLE DB
- Next by thread: RE: Insert Error: Column name or number of supplied values does not match table definition.
- Index(es):
Relevant Pages
|
Loading