Viewing 15 posts - 106 through 120 (of 206 total)
Here is a quick shot. You might have to adjust the order by in the row_number() fuctions to get your desired output.
CREATE TABLE #temp (test CHAR(2), test2 INT)
CREATE TABLE...
August 27, 2009 at 12:35 pm
I chucked this together pretty quick but it works as long as there is always a stop time. If there are consecutive stop times then this blows up. ...
August 27, 2009 at 11:17 am
I think the above query will work. Just add all of the elements from the customer table to both the select and the group by clause.
SELECT #temp.cid, cnumber, otherColumn,...
August 26, 2009 at 2:42 pm
I am not really sure what you are trying to do. Is the data such that 1 cid corresponds to 1 cnumber in the customer table? If so...
August 26, 2009 at 2:23 pm
I went ahead and generated the create table script and your sample data. I think this is what you are looking for. The top part just creates the...
August 26, 2009 at 1:50 pm
You are attempting to rollback a committed transaction but without a question in your post it makes it tough. There are some very good people on this forum but...
August 26, 2009 at 6:49 am
It sounds like you need an insert trigger on table 1. I can't rattle off the syntax for this off the top of my head but you can look...
August 26, 2009 at 6:42 am
I don't have the SQL 2000 available anymore but I think you can change the number of characters displayed in the tools menu. You can try the "results to...
August 26, 2009 at 6:16 am
moyer.mail (8/26/2009)
I had a question about this script.
select a.name, a.length, b.name
from syscolumns a, sysobjects b
where a.id = b.id
--and a.length > 128
--and a.length 128
and a.length < 250
--order...
August 26, 2009 at 6:11 am
I think you will need to join sysjobsteps and sysjobshistory on the step_id as well as the job_id.
I modifed your query but there is probably a better query to get...
August 24, 2009 at 12:04 pm
There isn't a loop in the code. Try adding the 3 lines below.
FETCH NEXT FROM vwCursor INTO @TRL_Run_Date, @Vend_Name, @File_Name, @TRL_CNT
WHILE @@FETCH_STATUS = 0 --ADD THIS
BEGIN --ADD...
August 20, 2009 at 1:46 pm
You can use the sp_helpconstraint proc to help you out. The bottom section of the output will be the foreign keys that reference the table.
August 20, 2009 at 1:36 pm
You have the else clause using an integer. Try something like this.
CASE WHEN [SH Arv D Loc Date] > [End Date] THEN 'Late' ELSE '' END AS LTLOT
August 20, 2009 at 12:22 pm
I will guess that your example is an "easy" version of the data you actually have but this works for the example. You will have to add lines to...
August 19, 2009 at 6:21 am
Wow, and here I was working on some elaborate scheme to get this working. I guess the start creates a shell outside of SQL. Thanks for this you...
August 18, 2009 at 7:22 am
Viewing 15 posts - 106 through 120 (of 206 total)