Forum Replies Created

Viewing 15 posts - 226 through 240 (of 851 total)

  • RE: How to trim the decimal places?

    [font="Verdana"]I guess the issue is with not wanting to round the decimal places. Sadly, even using the various formatting options in SQL Server Reporting Services will round (I think.)

    So...

  • RE: how to retrive the second highest value from the table

    jcrawf02 (5/20/2009)


    Fire the 1st guy and find max(salary) . . . 😛

    [font="Verdana"]Pay everyone the same. :-P[/font]

  • RE: Insert

    Tara (5/19/2009)


    I am trying to do something like this

    INSERT into OBBR.Emp.dbo.Revcounts

    (col1,col2,dbname)

    SELECT

    col1,col2,server-db

    FROM #temp

    In the column dbname i would like to have server.dbname and i am doing this way...

    (@@servername+db_name())

    [font="Verdana"]Something like (@@servername+','+db_name())...

  • RE: Insert

    [font="Verdana"]For servername, use @@servername, and for database name, use db_name(). For example:

    select@@servername,

    db_name();

    [/font]

  • RE: Similar to HLOOKUP in Excel but need help using TSQL

    [font="Verdana"]Excel can treat a range of cells like it is a table. SQL Server has (inherently) tables. So you don't have to pretend that a range is a...

  • RE: Data Warehousing, from where to Start

    [font="Verdana"]Start with the Kimball methodologies (as recommended above.) He has an excellent web site and another book that are well worth reading.

    When you come to tool sets, if you...

  • RE: How do you select top 10 for each unique key?

    [font="Verdana"]I can't see how it can implement any kind of ranking without a sort.

    My issue with the ranking functions is in how they are defined. I mean, if you...

  • RE: How do you select top 10 for each unique key?

    Bob Hovious (5/18/2009)


    Mr. Wilbur said RANK()

    rank() over (partition by s.objtype order by (s.usecounts) desc) as UCRank

    [font="Verdana"]Erk. He did too!

    Okay, key difference is this:

    SQL Server Books Online


    If two or more...

  • RE: How do you select top 10 for each unique key?

    Bob Hovious (5/15/2009)


    Bruce, how does the RANK approach differ from ROWNUMBER()?

    Also, I don't believe that CROSS APPLY will always do a subquery per row. The optimizer may surprise...

  • RE: Triggers and performance

    [font="Verdana"]One system reaching in and injecting data into the tables of another system is the data equivalent to code in one system reaching into the middle of the code in...

  • RE: Are the posted questions getting worse?

    GilaMonster (5/17/2009)


    Steve Jones - Editor (5/17/2009)


    Good to hear you play baseball down under.

    South Africa is not Down Under. That term refers to the rather large continent somewhere to the east...

  • RE: multiple criteria and multiple columns in SELECT statement using one table

    TomYum (5/14/2009)


    What if there are two or three tables involve? Let say from loans and savings? Will this code work out?

    select

    sum(case when loan.amount < 15000 then...

  • RE: Are the posted questions getting worse?

    Lynn Pettis (5/14/2009)


    Must remain in the desert, must remain in the desert...

    [font="Verdana"]Now there's your problem right there. You need another S in that desert.[/font]

  • RE: How do you select top 10 for each unique key?

    Bob Hovious (5/14/2009)


    Or maybe...

    [font="Verdana"]I thought of that approach too (I have introduced my team to the joys of CROSS APPLY, thank you Bob!) But I suspect the straight ranking...

  • RE: Are the posted questions getting worse?

    Bob Hovious (5/14/2009)


    Hey Bruce and Paul... how is life in New Zealand? Where do you each live again?

    Bruce, you're on the North Island (Auckland?) right?

    [font="Verdana"]I'm...

Viewing 15 posts - 226 through 240 (of 851 total)