Forum Replies Created

Viewing 15 posts - 1,426 through 1,440 (of 5,504 total)

  • RE: updating several tables and deleting the original rows

    The first thing would be to get a SQL Server Express edition (version similar to what you use at work) and install it at home or wherever you're planning to...

  • RE: Select distinct rows

    peter.draper (6/2/2011)


    I understand, in the real data it is date and time, so there should never be that situation 🙂

    Peter

    "Never" will only be enforced by a unique constraint.... 😉

  • RE: Possible problem with statistics ???

    sqlnaive (6/2/2011)


    Ninja, Updating the stats with 20% may faten the process. However In our scenario, it may not resolve the issue entirely. There are two points:

    1. The entire dataset on...

  • RE: need summarized info in the sql join queries

    Arrgghhh!!!

    I'm sorry. I didn't look at the original query close enough to spt that it is grouped by a different column than used in the SELECt list.

    Here's the revised version:

    SELECT...

  • RE: Select distinct rows

    Using your original sample:

    A1 432 1/1/11

    A2 453 1/1/11

    A1 555 1/1/11

    A1 653 1/1/10

    A4 875 1/1/09

    Both rows have the same part_no and the same calc_date, but different calc_values. Which one would you...

  • RE: UAT Testing and reverting back committed transcation

    Backup and restore?

    Meaning: take a backup of the db before starting the tests and restore from backup once the tests are completed.

    Question aside: why do you have to revert to...

  • RE: Select distinct rows

    Glad I could help 😀

    Just make sure you'll never have duplicate date values per datetime column. A unique check constraint would help a lot here.

    You might also rethink the column...

  • RE: need summarized info in the sql join queries

    Regarding the syntax error: WHERE needs to be placed before GROUP BY

    SELECT P.MAKER,AVG(L.SCREEN) AS AliasColumnNameGoesHere

    FROM PRODUCT P

    INNER JOIN LAPTOP L

    ON P.MODEL = L.MODEL

    WHERE P.MAKER = 'LAPTOP'

    GROUP BY P.MODEL

    But I'd...

  • RE: Select distinct rows

    remove the parenthesis around the SELECT statement after insert into tbl_weighcalc(.

  • RE: SQL 2008 Error - Trigger Error

    banthis is a table in the same database where the [tb_inspiration] is located.

    Obvioulsy, you tried to insert a value that exists in the phrase column of the banthis table. My...

  • RE: Select distinct rows

    All you need to do is to adjust the table and column names.

    The INSERT INTO approach will work as long as the table you're tryingto insert already exist. Otherwise you'd...

  • RE: Finding maximum value out of 5 different columns

    Why don't you add a computed (persisted) column with a CASE statement expression ( 😉 ) returning the max value you're looking for?

    You could also use UNPIVOT against the...

  • RE: Select distinct rows

    Something like this?

    -- sample data setup

    CREATE TABLE #temp

    (

    part_number CHAR(2) ,

    value_ INT ,

    Date_ DATETIME

    )

    INSERT INTO #temp

    SELECT 'A1', 432 ,'20110101' UNION ALL

    SELECT 'A2', 453 ,'20110101'...

  • RE: Select distinct rows

    use the window where you typed your query and run the following query

    SELECT @@version

    The answer you provided is related to the operating system, not the SQL Server version... 😉

  • RE: SSIS job error

    Straight from the link I posted before:

    option 1:

    changing the 'table or view fast load' to 'table or view' mode

    option 2:

    Make sure to check your source and destination steps that may...

Viewing 15 posts - 1,426 through 1,440 (of 5,504 total)