Viewing 15 posts - 676 through 690 (of 2,647 total)
GilaMonster (6/13/2012)
June 13, 2012 at 1:19 pm
I don't know what to say... It works for me (except the @@rowcount because the EXEC is out of scope and only returns 1) and I see both print statements.
June 13, 2012 at 1:16 pm
GilaMonster (6/13/2012)
June 13, 2012 at 1:10 pm
Good point Cathy and David, however, it does not solve why the OP is not seeing any printed output. I can see it with that block, so I think the...
June 13, 2012 at 12:59 pm
Well, I ran this on some test tables I have and got the following results:
declare @table_id int
declare @schema_name varchar(128)
declare @table_name varchar(128)
declare @str varchar(4000)
declare @aud_flag char(1)
declare @aud_str varchar(4000)
set @aud_flag = 0
set...
June 13, 2012 at 12:55 pm
Lynn Pettis (6/13/2012)
WayneS (6/13/2012)
... Actually, I just plain forgot to remove it. I think they...
June 13, 2012 at 12:46 pm
Ha! I think Wayne's is right without the CTE. I did all that work to display rank when all I needed to do was droup by the new group...
June 13, 2012 at 12:30 pm
Lynn Pettis (6/13/2012)
Jared and Wayne,Do you notice that cte3 isn't even used in the final select? The final select is using cte2.
I'm so confused because I mixed up what...
June 13, 2012 at 12:24 pm
Lynn Pettis (6/13/2012)
SQLKnowItAll (6/13/2012)
UPDATE sample SET tech_mode_id = 6 WHERE ID = 3
Then tell me if your code still works. Not defending mine because I know it is...
June 13, 2012 at 12:21 pm
I don't see a declaration for @audit_flag. I say that knowing that you are leaving out script, and without all of it we will have a hard time helping...
June 13, 2012 at 12:16 pm
Run this:UPDATE sample SET tech_mode_id = 6 WHERE ID = 3
Then tell me if your code still works. Not defending mine because I know it is a mess... Just...
June 13, 2012 at 12:09 pm
I;m not sure that you can do a DENSE_RANK OVER(ORDER BY grp) because grp will not always be unique to all groups. It is in this set of data,...
June 13, 2012 at 12:03 pm
WayneS (6/13/2012)
WITH SAMPLE (REFERENCE_ID,TECH_MODE_ID,BEGIN_TIME,END_TIME) AS
(
SELECT 1, 6, CONVERT(DATETIME,'2012-05-03 20:29:22'),CONVERT(DATETIME,'2012-05-03 20:29:52') UNION ALL
SELECT 1, 5, '2012-05-03 20:29:53','2012-05-03 20:29:55' UNION ALL
SELECT 1, 5, '2012-05-03 20:29:56','2012-05-03 20:30:03' UNION ALL
SELECT...
June 13, 2012 at 11:44 am
The idea I used was to separate the same grouping of TECH_MODE_ID into separate groups by subtracting the rank from within the grouping from the rank of all rows. ...
June 13, 2012 at 11:41 am
Viewing 15 posts - 676 through 690 (of 2,647 total)