QuoteReplyTopic: Operand type clash: int is incompatible with datetime2 Posted: 30-Aug-2011 at 1:41pm
Thanks that's great to know! The initial problem was solved by using another server, but this saves me from having to rename my temp tables/comment stuff out while I map it.
Try adding the following line directly after BEGIN
SET FMTONLY OFF
When trying to get information from a stored procedure, the framework calls the proc with all null parameters and with FMTONLY set to ON. Generally this fails with temp tables.
I'm updating an old project that still uses DF Classic. I've created a stored procedure and I'm getting the above error.
There is an issue with mapping procedures with temporary tables, so i have a real table that gets returned.
Here is the procedure:
CREATE PROCEDURE procCreateAccountTrx @pStartPeriod int, @pEndPeriod int, @pStartYear int, @pEndYear int, @pStartDate datetime, @pEndDate datetime, @pAccounts varchar(4000) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON;
IF OBJECT_ID (N'[tempTransactions]', N'U') IS NOT NULL DROP TABLE [tempTransactions] CREATE TABLE [tempTransactions]( [AccountId] [int] NOT NULL, [SubAccountId] [int] NOT NULL, [OpeningBalance] [money] NOT NULL, [DebitAmount] [money] NOT NULL, [CreditAmount] [money] NOT NULL, [Reference] [varchar] (50) NOT NULL, [BatchName] [varchar] (50) NOT NULL, [Period] [int] NOT NULL, [Year] [int] NOT NULL, [TransactionDate] [datetime] NOT NULL )
select a.Number, a.Description, s.Code, t.OpeningBalance, t.DebitAmount, t.CreditAmount, t.Reference, t.BatchName, t.Period, t.Year, t.TransactionDate From [tempTransactions] as t INNER JOIN GLAccount as A ON t.AccountId = a.Id INNER JOIN GLSubAccount as S on t.SubAccountId = s.Id
END GO
I have never seen this error before and am not too sure how to get past it. Any clues?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum