December 01, 2020, 08:26:42 pm
News: IF YOU ARE A MEMBER FROM THE ORIGINAL SITE AND CAN'T LOGIN. POST IN THE FEEDBACK FORUM (AS GUEST) AND AN ADMIN WILL ASSIST YOU TO ACCESS THE SITE!
Pages: [1]   Go Down
Author Topic: SQL Syntax problems grrrrrr [RESOLVED (I think)]  (Read 3911 times)
Slowhand
Supporters
*

Stars: +0/-0
Offline Offline

Gender: Male
Awards:
Topic Necromancer
Posts: 4668


I code C#!


WWW
« on: September 18, 2007, 09:33:20 am »

Hi,

I have these lines of SQL code, and SQL Server (2005) throws an 'Incorrect syntax' error on the first line with 'SELECT'.
I can't figure out what's wrong though...  crash
Code:
EXEC S08_PERSOON_OPLEIDING_UPDATE
@INT_PERSOON_OPLEIDING_ID,
SELECT CAST(@STR_STARTDATUM AS DATETIME),
SELECT GETDATE()

« Last Edit: September 19, 2007, 11:49:35 am by Slowhand » Logged


Bonker Gudd
Monster Poster
*

Stars: +0/-0
Offline Offline

Gender: Male
Posts: 1291



WWW
« Reply #1 on: September 18, 2007, 11:13:17 am »

Do you have to define what @INT_PERSOON_OPLEIDING_ID is?
Logged


Slowhand
Supporters
*

Stars: +0/-0
Offline Offline

Gender: Male
Awards:
Topic Necromancer
Posts: 4668


I code C#!


WWW
« Reply #2 on: September 18, 2007, 01:01:45 pm »

All three variables have been declared and have a value.
Logged


Slowhand
Supporters
*

Stars: +0/-0
Offline Offline

Gender: Male
Awards:
Topic Necromancer
Posts: 4668


I code C#!


WWW
« Reply #3 on: September 19, 2007, 11:50:45 am »

It seems the stored procedure doesn't accept functions for parameters.
If I put the results of the functions Cast() and GetDate() in seperate variables, and pass these variables to the stored procedure it works fine... doh
Logged


Pages: [1]   Go Up
Print
 
Jump to: