Viewing 15 posts - 151 through 165 (of 197 total)
As I said before, we KNOW it is has a valid value before the cursor begins looping.
I tried the = 0 .vs <> -1 but will do so again.
July 28, 2008 at 1:28 pm
Thanks, I've got it now. Yes, all columns are required and it's easier to write. 😉
July 28, 2008 at 10:22 am
Now, based on your post, I have added all the parameters for my Sp and am getting an error:
The parameterized query '(@Payment_ID as int,
...
July 28, 2008 at 8:23 am
I'm sorry for the confusion about edit capabilities. I *am* allowed to make changes and it looks like this *breakthrough* is going to be a big feather in my cap...
July 27, 2008 at 2:59 pm
Say, Gail, I got this from Mark Willis on Experts-Exchange. Basically it's building dynamic SQL.
ALTER PROCEDURE [dbo].[Select_Payments]
@PaymentID as int,
...
July 25, 2008 at 1:02 pm
Attached is the table creation script, one record of table data and a query along with it's execution plan.
July 25, 2008 at 7:15 am
GilaMonster (7/24/2008)
Since there's no changing that, ignore my comments. Maybe in the future if the system hits performance problems you can be the hero by telling them a possible cause....
July 24, 2008 at 3:41 pm
Any more tips on optimizing SP's where the WHERE clause is formatted like that?
July 24, 2008 at 11:04 am
GilaMonster (7/24/2008)
Just beware of parameter sniffing. Taht format of where clause tends to have very bad plan reuse and intermittent bad performance.For structures like that, WITH RECOMPILE may be necessary.
This...
July 24, 2008 at 8:17 am
I'm really kind of a newbie. The SP was generated by a tool that is used here and I am only modifying it to try to make it more efficient...
July 24, 2008 at 8:14 am
if I include both dates, it returns all rows instead of only records in the range
if I set the end date as null, it returns all rows.
There are 946000 records...
July 24, 2008 at 7:59 am
Would this work correctly?
AND (((@PaymentDtTmStart IS NULL)
AND (@PaymentDtTmEnd IS NULL))
...
July 24, 2008 at 7:40 am
HUH? I just need to know how to check the ranges.
July 24, 2008 at 7:32 am
So, do I look funny with egg on my face? Thanks a lot, you just saved my behind!
July 16, 2008 at 1:44 pm
BTW, because of the way things are being run, I cannot use a DECLARE or IF, so...
Here is the final working code:
SELECT CASE
WHEN EXISTS(SELECT 1 FROM...
February 27, 2008 at 9:05 am
Viewing 15 posts - 151 through 165 (of 197 total)