Forum Replies Created

Viewing 15 posts - 1,321 through 1,335 (of 3,957 total)

  • RE: import string with array into table

    Jeff Moden (10/9/2013)


    dwain.c (10/9/2013)


    And it can't split comma delimited strings as fast as DelimitedSplit8K.

    As you said in your fine article, it's only because it was designed to do just one...

  • RE: Site for good SQL learnings

    enriquezreyjoseph (10/9/2013)


    dwain.c (10/8/2013)


    The best learning is by doing, and I agree that this site is extraordinary for this.

    Pick a problem that someone has posted and try to solve it yourself....

  • RE: Adding Zero

    Here is what I propose:

    WITH StartingPoint AS

    (

    --SELECT

    --count([Unit]) as Actual,

    --unit,

    --[1st_of_month],

    --last_of_month

    ...

  • RE: Adding Zero

    Luis Cazares (10/9/2013)


    You need a Units table or at least a Units set to look for all units. after that the rest is easy, just add a RIGHT JOIN.

    SELECT

    count(fr.[Unit])...

  • RE: Difficulty in creating the proper Update Statement

    Not as compact but just for the record, here's another way:

    WITH ShouldBe AS

    (

    SELECT a.[RIN], [Type], [Code], [Lot], ShouldBe

    ,RIN2=b.[RIN]

    ...

  • RE: Convert comma to single quotes

    Here's another way that doesn't worry much about how many spaces are included.

    WITH SampleData (Condition, Columnname) AS

    (

    SELECT 'akraft,crunckel','TN'

    UNION ALL SELECT 'AL,AZ','State'

    ...

  • RE: String Split and LEFT OUTER JOIN in Two Tables

    If you want to return a number if it appears in either table but not in the other, I don't think EXCEPT will work.

    Not sure if my interpretation...

  • RE: Are the posted questions getting worse?

    Am I the only one left speechless and flabbergasted by this post?

    http://www.sqlservercentral.com/Forums/FindPost1503017.aspx

    I used to teach 2 methods to swap A and B in entry level university FORTRAN course (too) long...

  • RE: import string with array into table

    Jeff Moden (10/9/2013)


    Mike Saunders NL (10/7/2013)


    Hello again,

    I am running into a problem importing a string containing an array into a table.

    My string looks like '[{mark,peters,mr}{jane,fonda,mrs}{john,doo,mr}{james,bond,mr}]'

    I want to import this into...

  • RE: import string with array into table

    Sean Lange (10/9/2013)


    erikd (10/9/2013)


    dwain.c (10/7/2013)


    But it can also be done with a single call to PatternSplitCM:

    WITH SampleData(MyString) AS

    (

    SELECT' [{mark,peters,mr}{jane,fonda,mrs}{john,doo,mr}{james,bond,mr}]'

    )

    SELECT MyString

    ,Col1=MAX(CASE WHEN ItemNumber%6...

  • RE: Site for good SQL learnings

    The best learning is by doing, and I agree that this site is extraordinary for this.

    Pick a problem that someone has posted and try to solve it yourself. You...

  • RE: Update script

    The elephant on the carpet here of course is that the next statement in line is going to be:

    EXEC (@UpdateScript)

    And that is going to be highly prone to SQL injection....

  • RE: Unpivot SQL Query

    rs80 (10/8/2013)


    Guess my question wasn't clear?

    I'm not clear on it. So far you've given us your control table. If you could give us that but instead as DDL...

  • RE: import string with array into table

    Mike Saunders NL (10/8/2013)


    Hello all,

    Thanks for your help. The solutions you've provided are super and far beyond my current skill level.

    Learned a lot, Thanks again!!!

    Mike

    Not sure who said this but...

  • RE: What is your favorite "I didn't know that" moment in T-SQL?

    At the risk of bringing this thread back on track, I'd have to say that without the slightest doubt my greatest SQL Eureka moment was hitting on the CROSS APPLY...

Viewing 15 posts - 1,321 through 1,335 (of 3,957 total)