Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
anandc
Starting Member
20 Posts |
Posted - 2005-10-04 : 07:47:33
|
| I have written the below statement in a stored procIF EXISTS(SELECT DummyCol FROM DummyTbl)....when i am running this SP it gives me the proper result but all the records returned by "SELECT DummyCol FROM DummyTbl" statement are also shown in the Query Analyser window. why is it so? will this cause any performance problems in my application??Thanks- Anand |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-10-04 : 07:51:06
|
should not unless you have that query in another part of your script also you might want to modify it a bit IF EXISTS(SELECT * FROM DummyTbl)....and add a filter thru where clause?--------------------keeping it simple... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-04 : 07:51:44
|
| It will show the result if you run it in the Query AnalyserI dont think there is performance issueCan you post the full code and give more details?MadhivananFailing to plan is Planning to fail |
 |
|
|
anandc
Starting Member
20 Posts |
Posted - 2005-10-04 : 08:13:15
|
| Here is the part of code.....IF NOT EXISTS( SELECT IntErrorId FROM AppError WHERE IntRemitId = @intRemitId AND IntTransId = @intTransId AND IntErrorId = @intErrorId AND ISNULL(ErrorSkipInd, 'N') = 'N' AND ISNULL(FixedInd, 'N') = 'N')BEGIN INSERT INTO AppError(IntRemitId, IntTransId, IntErrorId, FileIndexID, AttributeNm, ReqValue, ActualValue, Remarks, ErrorSkipInd, SkippedBy, SkippedDate, FixedInd, CreatedBy, CreatedDt, ModifiedBy, ModifiedDt) VALUES( @IntRemitId, @intTransId, @intErrorId, @strFileIndexID, @strAttributeName, @strReqValue, @strActualValue, @strRemarks, @chrErrorSkipInd, @intSkippedBy, @dtmSkippedDate, 'N', @IntUserId, getDate(), @IntUserId, getDate() )END- Anand |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-04 : 08:51:36
|
| It is strangeIs this your full code?MadhivananFailing to plan is Planning to fail |
 |
|
|
anandc
Starting Member
20 Posts |
Posted - 2005-10-04 : 10:14:34
|
| Hi MadhivananThis is just a part of the code....the variables used has been assigned values in the code above this one....could you pls. let me know what is wrong with this ??- Anand |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-04 : 10:17:22
|
| If other part of code has Select Statements then those will be returned if you run the spWhy dont you post full code?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|