Forum Replies Created

Viewing 15 posts - 3,631 through 3,645 (of 10,144 total)

  • RE: Simple query failing

    ElijahE (2/19/2014)


    I have SQL 2008r2 installed on my laptop and yesterday I installed SQL 2012. Since doing that the following simple query in SQL 2008r2 fails:

    IF OBJECT_ID('usp_test','P') IS NULL

    ...

  • RE: pivot / unpivot

    Hi and welcome to ssc.

    There's an article for newcomers which you may find useful; http://www.sqlservercentral.com/articles/Best+Practices/61537/%5B/url%5D

    If you take a little time to prepare a sample data script, forum users will...

  • RE: Help with Query Output

    This will do it, but it's somewhat arbitrary:

    ORDER BY b.displayorder, ISNULL(c.col1,2147483647) DESC

  • RE: Help with Query Output

    Why?

  • RE: Help with Query Output

    A simple query exactly described generates this dataset:

    Col1col2col3#IDCol1col2displayorder#Col1col2col3

    5C053#3131#515

    6C061#1112#NULLNULLNULL

    1C011#1112#111

    3C031#1112#313

    4C042#2123#414

    2C022#2123#212

    Here's a sample data script and a query constructed from your notes:

    DROP TABLE #TableA

    CREATE TABLE #TableA (Col1 INT, col2 VARCHAR(3), col3 INT)

    INSERT INTO...

  • RE: Are the posted questions getting worse?

    Greg Edwards-268690 (2/17/2014)


    Ed Wagner (2/17/2014)


    dwain.c (2/16/2014)


    Ed Wagner (2/13/2014)


    dwain.c (2/13/2014)


    Jack Corbett (2/13/2014)


    Glad no bare-chested pictures of Grant, or frankly anyone on the thread, have popped up here too.

    I guess...

  • RE: Cursor and update

    phineas629 (2/12/2014)


    Thanks Luis,

    I feel like I've been stuck in sql purgatory, just barely knowing enough to get by. I'm really hoping to make the leap to a real developer. I...

  • RE: Time Conversion Issue

    abhas (2/11/2014)


    Hi All,

    I want to convert time into hours as per below format. Please guide.

    For example – 2:15:00 would be computed as 2.25 HRS or 6:30:00 would show as...

  • RE: Please help to sort this

    chetan.deshpande001 (2/10/2014)


    @ ChrisM@Work - What you did is actually a easy way out. thanks for bursting my bubble ..This has prompted me to learn how APPLY works.. This is one...

  • RE: Multiples address lines on a single row. Pivot?

    Nice work. I'd miss out the first view though - unless it's going to be used elsewhere, it's simply clutter:

    SELECT RowID,

    MAX(CASE WHEN LineNumber = 1 THEN DelAddr ELSE ''...

  • RE: INSERT INTO, EXCLUDING ONE COLUMN

    hoseam (2/10/2014)


    @chrism-2@Work

    The end to end process is pretty much what I have said, I have products I need to clone. I have 10 tables, in any table I might need...

  • RE: Please help to sort this

    ss.meghana8 (2/10/2014)


    I have 2 columns colour,countof

    How many colours?

  • RE: Inserting end of month dates in table with variable # of months

    ;WITH MyData AS (

    SELECT SUBTerms = 2, initialstartdate = CAST('2013-03-15' AS DATE) UNION ALL SELECT 4, '2013-01-15' UNION ALL SELECT 6, '2013-05-15'

    )

    -- MyData is a mockup of your existing result...

  • RE: SQL Query

    kapil_kk (2/10/2014)


    ChrisM@Work (2/10/2014)


    balu.arunkumar (2/10/2014)


    Hi This part shows error.

    /*------------------------

    SELECT*, SUM( Price ) OVER( Partition BY Customer_Name ORDER BY DatePurchased) AS Total_Till_Date

    FROM#sample where Customer_Name='A'

    ------------------------*/

    Msg 102, Level 15, State 1, Line 1

    Incorrect syntax...

  • RE: Return values in stored procedures and exiting

    The return value of a stored procedure is int, and cannot be changed. Traditionally it was used to indicate success (RETURN 0) or failure (RETURN n, usually negative).

Viewing 15 posts - 3,631 through 3,645 (of 10,144 total)