Viewing 15 posts - 121 through 135 (of 345 total)
R_S (10/13/2011)
The simplest method to refresh is to take a backup and restore the latest production copy
I can't just copy the production database again because I removed some tables and...
October 13, 2011 at 12:19 pm
I separated the recordset into power on times and power off times. Then join those on the ID where the power off times come after the power on times. Then...
October 11, 2011 at 1:55 pm
memostone86 (10/11/2011)
SQLRNNR (10/11/2011)
toddasd (10/11/2011)
How do you figure HoursOn for 2323 is 7?I come up with ~5h55m on that one.
The lastest status for 2323 on 6/30/2011, the status is on after...
October 11, 2011 at 1:21 pm
How do you figure HoursOn for 2323 is 7?
October 11, 2011 at 12:54 pm
pdonley (10/11/2011)
toddasd, I believe you are correct. I must have been using the wrong term. I apologize. What you said is exactly what I am doing.
Not a problem. It struck...
October 11, 2011 at 9:51 am
It sounds like you are building the query in the front-end code and then sending that query to the database to be executed. If that is the case, then that...
October 11, 2011 at 9:02 am
chauchs (10/11/2011)
select t1.f1, t2.f1from table1 t1
join table1 t2
on t2.f5 = t1.f5
and t2.f3 = t1.f3
join table1 t3
on t3.f5 = t1.f5
and t3.f3 = (select...
October 11, 2011 at 8:05 am
Keopx (10/10/2011)
October 10, 2011 at 1:54 pm
How does this work for you?
alter procedure GetReport
@SpoolID int
AS
declare @sql nvarchar(4000)
select @sql=extrasql from reportspool where spoolid=@SpoolID
exec (@sql)
October 10, 2011 at 8:00 am
Assuming you're doing this on a test server, start with this:
CROP TABLE table1
CROP TABLE table2
(But change the Cs above for Ds. We seem to have some filter here that...
October 6, 2011 at 7:10 am
Also, to answer the question you posted the DDL for, your update is safe ...in this sample set. If you get the query John provided and run that, you'll see...
October 5, 2011 at 12:36 pm
You can simplify your CASE expression like this:
CASE table2.Code2
WHEN '1-10' THEN 1
WHEN '11-20' THEN 2
WHEN '21-30' THEN 3
WHEN '31-40' THEN 4
WHEN '41-50' THEN 5
WHEN '51-60' THEN 6
WHEN '61-70'...
October 5, 2011 at 12:05 pm
branovuk (10/5/2011)
How to use CASE statement (or similar, maybe if?),
because it is not just Update, it is based on data from table2 another values in...
October 5, 2011 at 7:00 am
This will give you everything you want to know: http://www.sommarskog.se/dynamic_sql.html
September 26, 2011 at 10:30 am
Viewing 15 posts - 121 through 135 (of 345 total)