Viewing 15 posts - 481 through 495 (of 1,182 total)
SELECT
@AvgRating = AVG(Rating)
,@NumRatings = COUNT(*)
FROM Comments
WHERE Comments.VidID = 1
May 30, 2008 at 11:12 am
KMM (5/30/2008)
I'm not quite sure if I understand how you are combining things for the INSERTing of Process Type 1. that table doesnt have a MSalesNbr as a column
OOPS, it...
May 30, 2008 at 8:57 am
stk (5/30/2008)
wow, thanks Michael, that works perfectly! 😀I should really learn more about those Common Table Expressions, they are quite handy at times...
CTE's aren't nearly as handy as a tally...
May 30, 2008 at 7:37 am
INSERT INTO #temp
SELECT * FROM dbo.A WHERE @var = 'A'
UNION
SELECT * FROM dbo.B WHERE @var = 'B'
...
May 30, 2008 at 7:25 am
OK, here's everything EXCEPT the handling of TYPE 3.
I've got to get back to work here, so hopefully someone can help with the rest.
This uses no Cursors, I haven't tested...
May 29, 2008 at 1:20 pm
Your script isn't complete. Where/How does @iMto1Flag get set? What are the other INSERT/UPDATE statements and the logic that determines which is used?
May 29, 2008 at 12:15 pm
select * from
Appointments
where StartTime >= '2008-5-29' and StartTime < '2008-7-1'
and (LastName is not null) or (FirstNames is not null)
order by StartTime desc
It's because your essentially saying ...
StartTime >= '2008-5-29'...
May 29, 2008 at 10:59 am
Of course I hit post, and see that Kenneth beat me to it ... LOL
May 29, 2008 at 9:19 am
I believe this is the easiest way to get the job done.
-- create some tables to hold sample data and results
DECLARE @att TABLE
(SchoolID INT
...
May 29, 2008 at 9:17 am
I'm not going to address the WHY you are doing this or suggest any better ways, this is simply a suggestion as i'm not sure why your trigger doesn't work...
May 28, 2008 at 5:26 pm
Please post the DDL (CREATE TABLE) scripts for your two tables, including primary key definitions.
May 28, 2008 at 9:08 am
Can you not just set the compatibility level on the database to 80?
May 28, 2008 at 8:37 am
I wouldn't say that a cursor is the best way, just that it would be a huge amount of work to re-write through a site like this. Not to mention...
May 21, 2008 at 1:43 pm
Not to sound abrasive, but why not write it without using a cursor?
Post your code and sample data and maybe we can give you a set-based NON CURSOR solution. 😀
May 21, 2008 at 12:48 pm
Viewing 15 posts - 481 through 495 (of 1,182 total)