Viewing 15 posts - 14,446 through 14,460 (of 14,953 total)
Something like this should do it:
;with
Cats (JobID) as
(select jobid
from job_cat
where cat in
(select cat
from usercat
where userid = @userid)
or not exists
(select 1
from usercat
where userid = @userid)),
Locs (JobID) as
(select jobid
from job_loc
where loc in
(select...
March 31, 2008 at 12:33 pm
You should be able to run 2005 on Vista. I've been doing so for almost 2 years.
I think all I had to do was make sure to patch visual...
March 31, 2008 at 12:19 pm
pommguest99 (3/31/2008)
As it is forecasting vis-a-vis, the value can never be greater...
March 31, 2008 at 12:17 pm
I decided to test it for performance:
create table #Test (
Lev1 int,
Firstline int)
insert into #test (lev1, firstline)
select t1.number, t2.number
from common.dbo.numbers t1,
common.dbo.numbers t2
where t1.number <= 100
and t2.number <= 1000
insert into #test (lev1,...
March 31, 2008 at 12:14 pm
You needed to add more Whens.
when lev1 is null then firstline
when firstline is null then lev1
That would solve it too.
March 31, 2008 at 12:03 pm
I guess the first question is: What database engine is it currently running on?
If it's MS SQL, the move should be as simple as any other database move. Move...
March 31, 2008 at 12:01 pm
When I tried it, I got 12 decimal places with a literal of "4.0". So, it appears to be decimal(18,12). But that's just my best guess.
As far as...
March 31, 2008 at 11:57 am
This should do the whole thing in one fell swoop:
diff = abs(coalesce(ea.lev1, 0) - coalesce(b.firstline, 0))
Should allow you to eliminate the Case statement entirely.
March 31, 2008 at 11:45 am
I'm not clear on what it is you're trying to accomplish.
Without the tables, and some sample data, I have to say at a first glance that the query looks pretty...
March 31, 2008 at 11:30 am
Roberta:
Sub-queries are exactly what their name says, they are a query inside another query.
In the case you outlined, a join is better than a sub-query. They will both work,...
March 31, 2008 at 11:26 am
Probably the simplest solution is to use Pivot after you break it up into rows. Otherwise, it's five sub-queries, one for each column.
March 31, 2008 at 11:15 am
Also, if there are foreign keys that reference the table you are truncating, you'll have to remove those first, then rebuild them. Not a big problem, but needs to...
March 31, 2008 at 10:54 am
Jack Corbett (3/29/2008)
You obviously do not have autoshrink enabled so you need to manually shrink your transaction log using DBCC ShrinkDB or DBCC ShrinkFile
Don't use autoshrink. It's a performance-killer....
March 31, 2008 at 10:50 am
rbarryyoung (3/27/2008)
GSquared (3/27/2008)
Bob updates the order and changes the price incorrectly: UpdateBy = "Bob"
Sue updates the order and changes the...
March 28, 2008 at 1:35 pm
Viewing 15 posts - 14,446 through 14,460 (of 14,953 total)