Forum Replies Created

Viewing 15 posts - 121 through 135 (of 898 total)

  • RE: Problem Inserting records per Portfolio into a temp table

    Neil.McKinnon (6/20/2013)


    I did Abu, it returned the following error:

    "Msg 8152, Level 16, State 13, Line 1

    String or binary data would be truncated.

    The statement has been terminated."

    The structure of your...

  • RE: Is converting case cause TableScan in SQL Server 2008?

    Vincy-856784 (6/20/2013)


    Thank you very much for your quick response!

    Hmm. So, the only option I have is to get rid of the function since I was using LOWER(FRUIT) = 'apple'....

  • RE: t-sql joins

    inevercheckthis2002 (6/20/2013)


    Jan Van der Eecken (6/19/2013)


    Just OUTER JOIN tableA, tableB and tableC on id_number.

    Point of clarification -- sometimes data will be entered in TableA and not in TableB or TableC....

  • RE: Problem Inserting records per Portfolio into a temp table

    Can you also post the expected results based on your sample data along with a brief description of the logic?

    It will help us to test the solutions before we post...

  • RE: pivot? can't make it work.

    Do you find this simpler?

    SELECTid,

    MAX( CASE WHEN characteristic = 'color' THEN value ELSE NULL END ) AS color,

    MAX( CASE WHEN characteristic = 'age' THEN value ELSE NULL END ) AS...

  • RE: Problem Inserting records per Portfolio into a temp table

    I agree with the poster above

    Going by the description that you have provided even I don't think there is any need for a CURSOR

    Please post the table definitions, sample data...

  • RE: Partitioning in SQL Server 2008

    WayneS (6/19/2013)


    Kingston Dhasian (6/19/2013)


    Sai Viswanath (6/19/2013)


    Hi All,

    One more doubt on partitioning.

    - Do we need to have a primary key in the table which needs to be partitioned?

    - Can I...

  • RE: Rows to Columns (pivot or anyother way)

    A CROSS TAB will give you the desired results

    SELECTControlNo, MODELKEY,

    SUM( CASE WHEN SEQ = 1 THEN InspInterval ELSE 0 END ) AS int0,

    SUM( CASE WHEN SEQ = 2 THEN InspInterval...

  • RE: How to group by date in a date range

    marin-231997 (6/19/2013)


    Hello Dixie Flatline and Kingston,

    many thanks for your quick responses, much appreciated.

    Kingston's solution is exactly what I am looking for - I did not know how to group by...

  • RE: backup

    Krishna1 (6/19/2013)


    Thanks for quick reply. How do I test this. I need to show the diff that log will not get trucated even if we take full back every day....

  • RE: How to group by date in a date range

    Removed as it was a duplicate post

  • RE: How to group by date in a date range

    Something like this

    DECLARE@startdate DATE

    DECLARE@enddate DATE

    SET@startdate = '20130701'

    SET@enddate = '20130703'

    SELECTT.ITEM, DATEADD(DAY, D.number, @startdate) AS Dt, SUM(T.QTY) AS QTY

    FROM@t AS T

    CROSS APPLY(

    SELECT*

    FROMmaster.dbo.spt_values AS sv -- You can use a Tally table instead...

  • RE: Find the correct answer in the following query

    SELECT * FROM customer WHERE customer.customerid in (SELECT customer.customerid FROM salesorder)

    In the above query, the term customer.customerid references the customer table outside as the customer table is still in scope

    For...

  • RE: Find the correct answer in the following query

    aaron.reese (6/19/2013)


    you will get an error message

    Select Customer.CustomerID from salesorder

    table Customer has not been defined in the subquery.

    Are you sure? Check this

    CREATE TABLE customer

    (

    customerid INT

    )

    CREATE TABLE salesorder

    (

    customerid INT

    )

    INSERTcustomer

    SELECT1 UNION ALL

    SELECT2

    INSERTsalesorder

    SELECT1

    SELECT...

  • RE: Find the correct answer in the following query

    Are you in the middle of some exam or is your exam over?

    This does not seem to be some real time scenario that you are facing in your assignment.

Viewing 15 posts - 121 through 135 (of 898 total)