Click here to Skip to main content
15,898,588 members
Home / Discussions / Database
   

Database

 
AnswerRe: [Microsoft][ODBC SQL Server Driver]Syntax error or access violation Pin
www.Developerof.NET26-May-08 1:52
www.Developerof.NET26-May-08 1:52 
QuestionTriggers, AFTER INSERT?? URGENT Pin
Karan_TN25-May-08 21:09
Karan_TN25-May-08 21:09 
QuestionSelecting DISTINCT and copying to new table? Pin
Karan_TN25-May-08 19:31
Karan_TN25-May-08 19:31 
AnswerRe: Selecting DISTINCT and copying to new table? Pin
Blue_Boy25-May-08 19:41
Blue_Boy25-May-08 19:41 
GeneralRe: Selecting DISTINCT and copying to new table? Pin
Karan_TN25-May-08 19:49
Karan_TN25-May-08 19:49 
GeneralRe: Selecting DISTINCT and copying to new table? Pin
Ashfield26-May-08 8:18
Ashfield26-May-08 8:18 
QuestionAssigning value to variable Pin
CodingYoshi25-May-08 8:40
CodingYoshi25-May-08 8:40 
AnswerRe: Assigning value to variable Pin
Colin Angus Mackay25-May-08 13:32
Colin Angus Mackay25-May-08 13:32 
CodingYoshi wrote:
So basically I want to assign Employee.EmployeeID from the query result to the variable. Most examples online show assigning result of aggregate functions to variables.


If your SELECT results in only one row being returned then it should work. However, you are doing the assignment inside an IF (NOT) EXISTS which doesn't obey the normal rules of processing. It is designed to short circuit as soon as any matching data is found in order to allow the appropriate conditional statements to be run.

I would suggest moving the SELECT out of the IF condition and changing the IF condition to an ISNULL(@FoundId).


GeneralRe: Assigning value to variable Pin
CodingYoshi26-May-08 8:33
CodingYoshi26-May-08 8:33 
GeneralRe: Assigning value to variable Pin
Colin Angus Mackay26-May-08 13:37
Colin Angus Mackay26-May-08 13:37 
AnswerRe: Assigning value to variable Pin
Laxmikant Lad25-May-08 19:17
Laxmikant Lad25-May-08 19:17 
GeneralRe: Assigning value to variable Pin
CodingYoshi26-May-08 8:32
CodingYoshi26-May-08 8:32 
QuestionInvalid descriptor index ?? Pin
Vaclav_25-May-08 7:27
Vaclav_25-May-08 7:27 
QuestionConversion of Data Access method of SQL Server 2005 to Data Access method of ADO.NET Pin
kashshay25-May-08 7:23
kashshay25-May-08 7:23 
AnswerRe: Conversion of Data Access method of SQL Server 2005 to Data Access method of ADO.NET Pin
Hesham Amin25-May-08 21:23
Hesham Amin25-May-08 21:23 
Questionhow to connect lan sql server with delphi Pin
hesam11025-May-08 3:33
hesam11025-May-08 3:33 
AnswerRe: how to connect lan sql server with delphi Pin
Colin Angus Mackay25-May-08 5:18
Colin Angus Mackay25-May-08 5:18 
AnswerRe: how to connect lan sql server with delphi Pin
Blue_Boy25-May-08 13:43
Blue_Boy25-May-08 13:43 
QuestionUse Page Locks when Accessing the Index Pin
Brendan Vogt25-May-08 1:57
Brendan Vogt25-May-08 1:57 
Questionsubstring from smalldatetime Pin
Mr.Kode25-May-08 0:50
Mr.Kode25-May-08 0:50 
AnswerRe: substring from smalldatetime Pin
Colin Angus Mackay25-May-08 5:16
Colin Angus Mackay25-May-08 5:16 
QuestionSQL Server Database Access Pin
hariram2825-May-08 0:35
hariram2825-May-08 0:35 
AnswerRe: SQL Server Database Access Pin
Colin Angus Mackay25-May-08 5:19
Colin Angus Mackay25-May-08 5:19 
GeneralRe: SQL Server Database Access Pin
hariram2826-May-08 2:15
hariram2826-May-08 2:15 
GeneralRe: SQL Server Database Access Pin
Colin Angus Mackay26-May-08 4:13
Colin Angus Mackay26-May-08 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.