Forum Replies Created

Viewing 15 posts - 14,446 through 14,460 (of 14,953 total)

  • RE: Need help on small project from SQL professional

    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...

  • RE: Business Intelligence Design Studio

    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...

  • RE: Using case to find the difference

    pommguest99 (3/31/2008)


    In line with the previous request, lets say how do I find the percentage, between a.lev1 & b.firstline.

    As it is forecasting vis-a-vis, the value can never be greater...

  • RE: Using case to find the difference

    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,...

  • RE: Using case to find the difference

    You needed to add more Whens.

    when lev1 is null then firstline

    when firstline is null then lev1

    That would solve it too.

  • RE: moving Clearquest/clearcase DB's to a new SQL cluster

    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...

  • RE: select 3/4

    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...

  • RE: Using case to find the difference

    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.

  • RE: Looking for options to adjust query

    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...

  • RE: Query Building Tips (Need Them!)

    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,...

  • RE: Splitting Table Column on Delimiter

    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.

  • RE: Deleting millions rows from some tables

    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...

  • RE: Is transaction log needed at all? If not, how to get rid of it?

    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....

  • RE: Update a field with Stored Procedure output

    Glad you got it working.

  • RE: Update values within trigger

    rbarryyoung (3/27/2008)


    GSquared (3/27/2008)


    Joe creates an order in the Orders table: CreateBy = "Joe"

    Bob updates the order and changes the price incorrectly: UpdateBy = "Bob"

    Sue updates the order and changes the...

Viewing 15 posts - 14,446 through 14,460 (of 14,953 total)