Forum Replies Created

Viewing 15 posts - 4,681 through 4,695 (of 26,490 total)

  • RE: PRINT bug ?

    SQLRNNR (8/12/2015)


    Let's keep this friendly.

    Let's not antagonize.

    Easier said than done when we get hammered for not providing the answer the OP expected when we did answer the question.

  • RE: PRINT bug ?

    mar.ko (8/12/2015)


    Well guys, not one of you provided a solution.

    There are two:

    1) ISNULL(@ColDefaultVal,'-')

    That variable was the one preventing the PRINT from executing.

    2) RAISERROR ('ColDflt=%s',0,1,@ColDefaultVal);

    This is even better as it indicates...

  • RE: Checking Existence of Row Prior to Insert

    pietlinden (8/11/2015)


    The problem is that you have to remove the duplicates before you insert the batch of records.

    This is one option:

    insert into table_2 (col1,col2,col3)

    select DISTINCT col1,col2,col3

    from table_1 t1

    where not exists...

  • RE: Checking Existence of Row Prior to Insert

    Libby (8/11/2015)


    I have a situation where our stored procedure inserts records from table_1 to table_2 when they don't already exist (uses the EXIST statement) on that table. If table_1...

  • RE: Are the posted questions getting worse?

    Alvin Ramard (8/11/2015)


    WayneS (8/11/2015)


    Lynn Pettis (8/11/2015)


    What an attitude.

    Duly smacked

    It's actually the last variable, that's NULL. 😀

    I think we scared him off.

  • RE: Turn Field Values into Coma Separated List

    Give this a try.

    select distinct

    mt.field1,

    ca.field3

    from

    dbo.MyTable mt

    cross apply (select stuff((select ',' + mt1.field2

    ...

  • RE: Fill in the gaps - ideas needed, help appreciated.

    Suggestion, post the DDL for the tables, sample data for the tables, expected results based on the sample data provided.

  • RE: Are the posted questions getting worse?

    What an attitude.

  • RE: PRINT bug ?

    mar.ko (8/11/2015)


    WHILE @@FETCH_STATUS = 0

    BEGIN

    FETCH NEXT FROM C_tables INTO

    @ColName

    ,@ColOrdPosit

    ,@TabSchema

    ,@TabName

    ,@ColDataType

    ,@ColDefaultVal

    ;

    PRINT @ColName + ' ' +STR(@ColOrdPosit) + ' ' +@TabSchema + ' ' +@TabName + ' ' + @ColDataType +...

  • RE: Are the posted questions getting worse?

    Ed Wagner (8/11/2015)


    Lynn Pettis (8/11/2015)


    Ed Wagner (8/11/2015)


    Alvin Ramard (8/11/2015)


    Ed Wagner (8/11/2015)


    Sean Lange (8/11/2015)


    Ed Wagner (8/11/2015)


    The silver spoons need to be ordered again. Better get at least a case.

    Here's a...

  • RE: Are the posted questions getting worse?

    Grant Fritchey (8/11/2015)


    Lynn Pettis (8/11/2015)


    Can't place the movie or show that came from, but love the editing!

    Big Trouble in Little China.

    That is actually what I suspected but wasn't sure.

  • RE: Are the posted questions getting worse?

    SQLRNNR (8/11/2015)


    Jeff Moden (8/11/2015)


    Even better is when they use NVARCHAR(256). That was my first experience with blowing a pork chop bone out my nose.

    Can't place the movie or show...

  • RE: Are the posted questions getting worse?

    Ed Wagner (8/11/2015)


    Alvin Ramard (8/11/2015)


    Ed Wagner (8/11/2015)


    Sean Lange (8/11/2015)


    Ed Wagner (8/11/2015)


    The silver spoons need to be ordered again. Better get at least a case.

    Here's a quote I don't think...

  • RE: Are the posted questions getting worse?

    Grant Fritchey (8/11/2015)


    SQLRNNR (8/11/2015)


    Grant Fritchey (8/11/2015)


    Sean Lange (8/11/2015)


    OMG. I just ran across this in a database from a 3rd party. There are actually 50 nvarchar(1) columns with names 1 -...

  • RE: Are the posted questions getting worse?

    SQLRNNR (8/11/2015)


    Ed Wagner (8/11/2015)


    Sean Lange (8/11/2015)


    Grant Fritchey (8/11/2015)


    Sean Lange (8/11/2015)


    OMG. I just ran across this in a database from a 3rd party. There are actually 50 nvarchar(1) columns with names...

Viewing 15 posts - 4,681 through 4,695 (of 26,490 total)