Viewing 15 posts - 556 through 570 (of 1,156 total)
You should verify the backup, as Phillip stated.
Is the "management sql server" instance running on SQL 2000 sp4, or is it SQL 2005? I am asking because this is...
February 26, 2008 at 11:43 am
If you do not need the totals grouped, you dont need the case or the id column.
your update should look like this
UPDATE #T
SET @PrevGrpBal ...
February 26, 2008 at 11:16 am
No Problem 😀
Thanks for the feedback.
February 26, 2008 at 11:08 am
You probably have a "GO" somewhere in your code. If you use "GO", the variable is no longer in scope. Replace and "GO" with a ";".
This will throw...
February 26, 2008 at 10:41 am
Matter of preference I guess. I find cte's help me keep the code cleaner actually instead of using derived tables in the FROM clause. Keeps it more like tables there...
February 26, 2008 at 10:26 am
When you execute dynamic sql via the sp_executesql method it is parameterized. This means that you can declare variables, within the scope of the dynamic sql. This leads...
February 26, 2008 at 10:21 am
I would have gone with a solution similar to Jack's using derived tables. It is very simple and clean.
DECLARE @t TABLE
(
Room int,
Date datetime,
Qty_In_Out int
)
INSERT INTO @t
SELECT 101, '01/22/2008', 1 UNION...
February 26, 2008 at 10:02 am
No
The room in this example is occupied for each day between the day it was occupied and the day it was vacated.
If the data included a record for each day,...
February 26, 2008 at 8:55 am
you should change the query to count disctinct dates as such:
select Room, Count(distinct date) as [occupancy days]
from mytable
where date between '2/1/2008' and '2/15/2008' and Qty_In_Out > 0
group by room
order by...
February 26, 2008 at 8:51 am
The count only works if you do not have occupants checking in and out on the same day and another person checking into that room on the same day.
February 26, 2008 at 8:46 am
Couldnt you just do a count of the room where the occupancy is > 0 ?
select Room, Count(room) as [occupancy days]
from mytable
where date between '2/1/2008' and '2/15/2008' and Qty_In_Out >...
February 26, 2008 at 8:44 am
[highlight=#ffff11](case when lr.u_pagpagar=0 and lr.u_pagchpd=0 and lm.cm=20 then 'Aceite LT'
else
case when lr.u_pagpagar=1 and lr.u_pagchpd=0 and lm.cm=20 then 'Aceite PG'
else
case when lr.u_pagpagar=0 and lr.u_pagchpd=1 and lm.cm=20 then'Aceite...
February 26, 2008 at 8:39 am
The easier and preferred method is to simply create a variable for the path and use get date functions. Click the connection manager for the output text file...
February 26, 2008 at 7:45 am
Best practice is to change all service accounts via the SQL configuration manager. By using the configuration manager you will ensure that the user has all the rights he...
February 25, 2008 at 3:53 pm
Have you considered using SSIS? SSIS has bulk operations and is more scalable. I tend to lean on SSIS packages for ETL more than BCP because SSIS packages...
February 25, 2008 at 6:40 am
Viewing 15 posts - 556 through 570 (of 1,156 total)