Forum Replies Created

Viewing 15 posts - 1 through 15 (of 114 total)

  • RE: Urgent help!

    Thanks Jeff.

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: Make a select from three columns (with case expression)

    it is a relatively straightforward CASE statement

    CASE WHEN perc_cs_publico <> 0 AND perc_cs_privado = 0 AND perc_cs_estrangeiro = 0 THEN PUBLICO

    WHEN perc_cs_publico...

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: Urgent help!

    that rollback transaction has to complete. If you reboot, it will depend on your recovery settings what will happen.

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: Kimball FactTable Types (missing a Fact Table type)

    Just my opinion, but the reason that your CASE 3 does not appear in Kimball's approach is because you wouldn't create such a fact table. Why would you exclude...

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: Update record getting from some SQL Query

    Your post is a little confusing...

    I believe if you got the citizenID as a distinct value you could use that as a subquery for updating...

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: Problem with running total

    You could create a table that is a place holder for the months (essentially 12 records). Then do a left join from that table to your data (on month...

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: Problem with running total

    Straight SQL is not going to show you want isn't in the database, but I'm confused on how that makes the YTD figures incorrect. Is it that they are...

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: DataBase Enging Tuning

    While the DTA is a wonderful tool, you really do need to understand SQL Server, your database and your business use cases to properly implement the changes it will suggest....

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: Finding "sort of" duplicate records - multiple column aggregate??.. HELP

    I believe i understand what you typed, but I'm not sure if you are asking a question here.

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: >=x versus IN

    I see that you are measuring your duration, but to see the likely culprit of the difference, you should use:

    SET STATISTICS IO ON

    The info you'll get will likely show you...

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: need help with a sql query

    Look into the PIVOT command in Books Online. If you still have trouble re-post with questions on PIVOT. I think it will achieve what you are looking for.

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: Remove Some Duplicate Rows with the Oldest InsertDate

    Excellent point Jon.

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: Remove Some Duplicate Rows with the Oldest InsertDate

    There are several methods you could follow. Is the MemberControlID unique? If it is, the follow SQL would pull out all the MemberControlID's that you want to keep:

    Select...

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: How to transpose reccords in SQl Server 2005

    Actually, PIVOT is what you are looking for:

    select Pivoted.* from

    (select c.teacher, c.period, c.classname from dbo.class c) p

    pivot

    (max(classname) for

    Period in ([1st], [2nd], [3rd], [4th], [5th], [6th], [7th], [8th])) as...

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • RE: Concatenating two columns to make a reference and include the date and time

    Look at Books Online about the SELECT statement and using and subselect.

    Essentially, you will use your SELECT as a table and join it to the other tables:

    select t1.field1, P.fieldname

    from

    ...

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

Viewing 15 posts - 1 through 15 (of 114 total)