Forum Replies Created

Viewing 15 posts - 436 through 450 (of 605 total)

  • RE: T-SQL Output to Text File

    My favourite way is to use osql within a batch file.

    You then call the batch file from a job and write the execution log to another text file.

    I use this...


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: Debugger

    I am probably showing my ignorance here, but how do you get the debugger up in QA. I did not know there was one.


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: help to modify a query

    You need to put the sum function around your case statement, not inside of it.

    E.g

    sum(CASE

    WHEN DIS_DAT BETWEEN '01/05/2003' AND '05/31/2003'

    THEN RET_QTY else 0 end) as UNSOLD_2003,


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: query join, two many-to-many relationships

    A more efficient way would be to use a full outer join. This will return records not matching either side of the middle table.

    SELECT DISTINCT M.id, M.name

    FROM Member M

    FULL...


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: help to modify a query

    See my answe to this post I put in this morning;

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=131367&post=true

    You just need to replace the WHEN statement with between start and end dates.


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: debt collection - select info based on date

    Just had a brainwave and have found how to sum by group OK.

    Use

    select id,

    sum(CASE WHEN datediff(d, pdate,getdate()) 61

    THEN amount else 0 end) as OVER2M

    from product

    group by id

    I was...


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: Inline Query

    You need to name the table and column that you want to count so that sql recognises it. Also, it is quicker to count the primary key than to count...


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: debt collection - select info based on date

    You are going about it the wrong way. You need to use a case statement when generating anything that looks like a pivot table. Checks BOL for examples. For what...


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: Updating a table with warehouse

    A basic overview of olap.

    You need to have analysis services installed. I do not know which cd this comes on I am afraid.

    You set up a db with a central...


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: Mass update of dts package data source uid & password

    Sounds like you've got it covered. Good to hear. I will have to take a look at your solution. Never know when it might come in handy in a new...


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: Complicated Query

    Or like this -

    select t1.id, t1.lastname, t1.firstname,

    case t2.communication

    when 'phone' then t2.value else null end as phone,

    case t2.communication

    when 'email' then t2.value else null end as email

    from table1 t1, table2 t2

    where...


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: Updating a table with warehouse

    If you set up an olap db you can achieve this. When you populate the warehouse you can choose the option to append data only to the fact table.

    However, this...


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: Data Updates

    If you are looking at updating a sql server db from a non sql server db, message queues are required. For example, msqseries. This takes care of changes as they...


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: Right outer join

    I forgot that. I have not worked on oracle for about 18 months and it shows.


    ------------------------------
    The Users are always right - when I'm not wrong!

  • RE: Right outer join

    A quick and easy way is:

    WHERE CP.CLAIMID =* CD.CLAIMID

    AND CP.CLAIMID =* CT.CLAIMID


    ------------------------------
    The Users are always right - when I'm not wrong!

Viewing 15 posts - 436 through 450 (of 605 total)