If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Urgent: Msg 241 & Msg 8114

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-25-03, 14:00
joshi123 joshi123 is offline
Registered User
 
Join Date: Jul 2003
Posts: 1
Urgent: Msg 241 & Msg 8114

Hi, here is the stored procedure. I got the errors with SAMPLE_DATE & RESULT_VALUE. Remaing columns are fine.

Source table columns and datatypes:

START DATE VARCHAR 25
RESULT VALUE VARCHAR 25

Destination table columns and datatypes:

SAMPLE_DATE DATETME 8
RESULT_VALUE NUMERIC 13(25,8)


CREATE PROCEDURE

SP_D_LEGACYSTORET_21FLVEMD_INS
AS
BEGIN
TRUNCATE TABLE D_LEGACYSTORET_21FLVEMD
INSERT INTO

D_LEGACYSTORET_21FLVEMD(STATIONID,DATASOURCE,
SAMPLE_DATE,PARAMETER_ORIGINAL,RESULT_VALUE)

SELECT a.[Primary Station ID] AS STATIONID,

'LEGACYSTORET_21FLVEMD' AS DATASOURCE,

CONVERT(DATETIME,a.[Start Date]) AS SAMPLE_DATE,

a.[Parameter Code] AS PARAMETER_ORIGINAL,

CASE WHEN isnumeric(a.[Result Value])=0 THEN NULL
WHEN isnumeric(a.[Result Value])=1 THEN
CONVERT(NUMERIC(25,9),a.[Result Value])
END AS RESULT_VALUE

FROM D_LEGACYSTORET_21FLVEMD_L a
END

GO

Errors are:

Server: Msg 241, Level 16, State 1, Procedure
SP_D_LEGACYSTORET_21FLVEMD_INS1, Line 5
Syntax error converting datetime from character string.

Server: Msg 8114, Level 16, State 5,
Procedure SP_D_LEGACYSTORET_21FLVEMD_INS1, Line 5
Error converting data type varchar to numeric.


please let me know where is the error

Thanks alot
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On