Monday, March 26, 2012

Incorrect syntax near the keyword 'CONVERT'

What in the name of all creation is wrong with this query? I just can't seem to find the trouble...

EXEC OppdaterForetak 900000000,'NO NON MOD DUNS Test 1','abcdveien 145','110','OSLO',NULL,'118','OSLO','22222222','22222222',CONVERT(datetime,'2006-07-18 00:00'), 101,'OSLO', 3,'Oslo','AS', 99999,'NB! TESTFORETAK',NULL,NULL,NULL, 345000001,CONVERT(datetime,'2006-07-17 00:00'),CONVERT(datetime,'2006-07-19 00:00'),'A',NULL,'Daglig leder alene.'

You can't use any function when you call the Procedure. It should be predefined.

Here you can use the variable to assign the values then reuse the varibale on the procedure call.

But for your query convertion is not nessasary.. since you are using the valid dateformat..

Code Snippet

EXEC OppdaterForetak 900000000,

'NO NON MOD DUNS Test 1',

'abcdveien 145',

'110',

'OSLO',

NULL,

'118',

'OSLO',

'22222222',

'22222222',

'2006-07-18 00:00:00',

101,

'OSLO',

3,

'Oslo',

'AS',

99999,

'NB! TESTFORETAK',

NULL,

NULL,

NULL,

345000001,

'2006-07-17 00:00:00',

'2006-07-19 00:00:00',

'A',

NULL,

'Daglig leder alene.'

No comments:

Post a Comment