Forum Replies Created

Viewing 15 posts - 181 through 195 (of 726 total)

  • RE: Need help to simplify my Search Query

    It appears to me that you're wanting all combinations, and if so, wouldn't this (untested) work for you?

     

    SELECT

     j.JoinID

    FROM

     Join AS j

     

     INNER JOIN Product AS p ON

      j.ProductID = p.ProductID

     

     INNER JOIN Location AS...

  • RE: Divide by Zero error, but continued execution; and error trapping

    Off the top of my head, I could see something like a Null value in the column, which would get it passed the WHERE clause, with an Isnull(column,0) as a denominator...

  • RE: Database name with special character(Urgent)

    But it's an application failure. Not SQL Server failure.

    The "application" is called "SQL Server Enterprise Manager" (actually "SQL Server Management Studio" in my case), and you say that this is...

  • RE: Database name with special character(Urgent)

    Who said anything about using bad SQL syntax? If you consider me using the right-click menu to drop a table to be an example of me using bad syntax, then...

  • RE: Database name with special character(Urgent)

    For the record, Kenneth's example earlier is a perfectly valid one as to why always using brackets to resolve less than ideal identifier naming choices isn't always a good idea.

    The...

  • RE: Database name with special character(Urgent)

    Jeff, I always read posts in their entirety when I come across them.

    I guess my main argument is that if we accept that...

  • RE: Database name with special character(Urgent)

    Except that that's really easy to take to an extreme. If we coded to handle all situations, pretty soon our code would all look something like...

    INSERT INTO [MyDB].[dbo].[TableOLastNames]

      (

     [LastName]

       )

    SELECT

     [LastName]...

  • RE: Database name with special character(Urgent)

    To some, it's what works for them.  To others, it's what works all the time.

    I would personally expand that to be "It's what works for them all the time.", as...

  • RE: Database name with special character(Urgent)

    My own personal "Best Practice" is to not use brackets when I control the object identifiers, as I won't let exceptions through. I'll even happily send the object creator back to...

  • RE: Joining to a table based on Prefix value of Column

    Do you mean this?

    SELECT

     g.orgnr_daughter

     ,name_daughter = CASE WHEN Left(g.orgnr_daughter,2) = 'IE' THEN fc.orgnr_daughter ELSE g.orgnr_daughter END

    FROM

     groupe_structure AS g

     

     LEFT OUTER JOIN ForeignCompany AS fc ON

      g.orgnr_daughter = fc.orgnr

    Completely untested, and I made an...

  • RE: Run all store procs at once

    I feel like we're going back and forth, or perhaps I'm still not getting it. You went from wanting to run the stored procs at once, to deploying changes, and...

  • RE: Run all store procs at once

    So you are just looking for deployment options?

    The quick and dirty way, and one that requires no third party tools, is just create a script with any changes, deploy it...

  • RE: Can someone please explain the datatype SYSNAME

    That's basically it in a nutshell. For instance, when upgrading from 6.5 to 7.0, sysname changed it's behind-the-scenes datatype from varchar(30) to nvarchar(128), so code that used sysname won't break...

  • RE: Can someone please explain the datatype SYSNAME

    sysname is version independent. If tomorrow, databases are allowed to have 1000 character names, sysnames should allow for 1000 characters. For most practical purposes, in SS 7 and later, you can...

  • RE: crosstab query

    By the way, if you only need this for reports, you can leave the data nice and normalized, and let the report itself do the crosstab for you.

Viewing 15 posts - 181 through 195 (of 726 total)