Forum Replies Created

Viewing 15 posts - 301 through 315 (of 327 total)

  • RE: String Concatenation with Nulls and Spaces

    That may be but I think(?) it works across all option settings and compatibility versions.

     

  • RE: String Concatenation with Nulls and Spaces

    How about this?

    select Ltrim(Isnull(first_name,'') + ' ') +

             Ltrim(Isnull(middle_name,'') + ' ') +

             Ltrim(Isnull(last_name,'') + ' ') +

             Ltrim(Isnull(suffix,'')) as FullName

     

  • RE: String Concatenation with Nulls and Spaces

    You got me!  The LTrim does help in cases where only the title or middle name can possibly be null.

  • RE: String Concatenation with Nulls and Spaces

    Select Ltrim(ISNULL(FirstName, '') + Ltrim(ISNULL(middlename , '') )+ Ltrim(ISNULL(lastname , ''))+ Ltrim(ISNULL(suffix, '')) as FullName from dbo.Contacts

     

  • RE: Updating First the First Few Characters in a Cell

    "...operation will always force an index scan, while the like operator can use the index seek..."

    Remi,

    Could you please explain the difference between an index scan and an index seek.

    thanks,...

  • RE: Percentage with group by

    Select count(*),

           ((Select count(*) From YourTable Where PlanCode = YT.plancode) /

            (Select count(*) From YourTable) * 100 ) as [Percent],

     PlanCode

    From YourTable YT

    Group by PlanCode

    There's gotta be a better way

  • RE: Error not raised as I expect

    Noel,

    Why do you say it is correct to have ansi_nulls set to OFF?

    ron

  • RE: Error not raised as I expect

    I would like to correct my previous statement.  I did some testing and it appears that in the case of a "severe" error causing the proc to abort the return...

  • RE: Error not raised as I expect

    That depends on how you have ANSI_NULLS set.  When ANSI_NULLS = ON then a comparison to a null value will yield a result of FALSE and a check for IS...

  • RE: Error not raised as I expect

    If you check you might find that in this case your chid proc is returning NULL for a return code.

    If that's the case you can reslove the failure to catch...

  • RE: Limiting records joined with a JOIN

    Can we assume that all the "matching" records in table b are not exaclty the same?  So what is different about these matching records?

     

  • RE: Can''''t create User Defined functions!

    Try prepending the owner to the function name example:

    Create function dbo.CalcInterest( ...

     

  • RE: Arranging Data

    I have now tested my previous 'solution' and it needs a small modification.  The following select gets you the correct data.  You can use it in conjuction with an Insert...

  • RE: Arranging Data

    I haven't tested this but if may give you what you are looking for.

    Select a.owner as owner1,

              b.owner as owner2,     

              a.VIN

    From YourTable a

            Left Outer Join YourTable b

           ...

  • RE: Understanding 2nd Normal Form

    I think what Tal is trying to tell you is that you created AddressID as a surrogate key and that's fine.  But the surrogate key is standing in for the logical primary...

Viewing 15 posts - 301 through 315 (of 327 total)