Here's what I have tried:
USE [cpqaAnswers]
GO
CREATE TABLE [cpqaAnswers].[cpqa].[KOANS](
[IDNO] nvarchar(13),
[LOANUMBER] nvarchar(14),
[NUMDAYS] nvarchar(13),
[REPAY] nvarchar(23)
)
BULK INSERT [cpqaAnswers].[cpqa].[KOANS] FROM 'C:\cpqaAnswers\cpqa_ST_varDECLARE_160310-1315\KOAN.txt'
SELECT * FROM [cpqaAnswers].[cpqa].[KOANS]
Something's wrong starting here ->
DECLARE @ZIDNO nvarchar(13)
DECLARE @ZLOANUMBER nvarchar(14)
DECLARE @TYEAR nvarchar(20)
DECLARE @CYEAR nvarchar(410)
And I get an error message (see beneath) here:
IF NOT EXISTS(SELECT * FROM [cpqaAnswers].[cpqa].[KOANS] WHERE (ISNULL(NUMDAYS,0) = 0)
OR (REPAY NOT IN ('SIMPLE','REDUCING'))
AND IDNO=@ZIDNO AND LOANUMBER= @ZLOANUMBER)
BEGIN
SET @TYEAR=@CYEAR
END
ELSE
BEGIN
RAISERROR('There are incomplete records the process has been Aborted', 11, 1)
END
Text of message:
Msg 50000, Level 11, State 1, Line 14
There are incomplete records the process has been Aborted
Does any of this like similar to anything else I should be seeing?