Forum Replies Created

Viewing 15 posts - 91 through 105 (of 114 total)

  • RE: how to create a conditional Alter Statement

    Dave is right, This sort of code is useful for delivering updated code or something, but if you're writing an application that depends on this, I guarantee there's a better...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: how to create a conditional Alter Statement

    Sure, you just have to wrap it in a block like this:

    IF EXISTS(SELECT NULL FROM sys.columns WHERE [name] = 'x' AND OBJECT_NAME([object_id]) = 'b')

    UPDATE b

    ...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: how to create a conditional Alter Statement

    I'm sorry it looks like I reversed the order of those.

    The select statement looks at the table definition for a column named X in the table named A

    So if that...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Help with Decimal precision

    I just found the answer:

    http://msdn.microsoft.com/en-us/library/ms190476%28SQL.90%29.aspx

    I may submit this as a QOTD...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: how to create a conditional Alter Statement

    It's possible the others have mnade your problem more complicated than you intended.

    If you were just looking for how to tell if a column exists in a table, you can...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Retrieving Identities on set-based inserts

    So I reread what I wrote, and there's actually two issues. The most important one actually has nothing to do with using tables or table variables (you handle this correctly).

    Depending...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Retrieving Identities on set-based inserts

    A couple of notes on Florian's post:

    The sample script works because you're using Table variables, which are local to the scope. If you use real tables, it is not...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Afraid of Help

    That's a pretty well thought-out Reply Tom. Got any pointers on how to avoid these risks? (Other than not taking the job in the first place 🙂 So,...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: "Subquery returned more than 1 value" with a twist

    Similar to the ansi nulls setting suggestion, you should check the concatenation settings if you are joining (or if your subquery is correlated) based on data types other than int.



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Afraid of Help

    The biggest problem I have with getting "Professional" outside help is my past bad experiences with consultants who came across as very knowlegable, but in the end couldn't deliver. ...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Query Performance Issue

    No Problem.

    One other thing I noticed: You've hard-coded which size, width and color you want to use, yet you then proceed to look up the ids for those values....



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: import data from excel to sql table

    It's also possible to copy and paste directly into the table in management studio if the layout of your spreadsheet matches the table.

    If you're looking for a programmatic method, look...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Query Performance Issue

    I'll take a stab at your question regarding the subquery, although I have to admit that I'm not as experienced or as talented as Gail and Grant.

    I believe that you...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Effective Dating Series Part I - The Problem

    GSquared (10/1/2009)


    I have to mention that seeing the title of this article made me wonder if SSC had changed into a different type of website overnight. 😉

    Heh, so did I....



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • RE: Many to Many relationship

    Perhaps what you're looking to avoid is creating 6 new tables to store the relationships between your four tables( a to b, a to c, b to c...). It...



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

Viewing 15 posts - 91 through 105 (of 114 total)