Forum Replies Created

Viewing 15 posts - 601 through 615 (of 702 total)

  • RE: Update column with data from another updated column

    serinor.e090266 (3/6/2009)


    I don't understand your requeriments very well, but in order to simplify the process, i think you don't need any local variable; only use the original value of the...

  • RE: Update column with data from another updated column

    You could provide a local variable to hold the intermediate result, then use it to set val1 and val2.

    Declare @newVal1 int

    update TEST

    set...

  • RE: Problem with the LIKE operator in the Select statement.

    To search for an underscore or percent sign (_ or %), specify and use an escape character. With a tilde escape, your query would be:

    select * from @tbl where name...

  • RE: query to find last date of a year

    Michael,

    Thank you. That really helps me understand. I had already tried substituting '1899' for -1 and found that it worked for the year evaluations, but now see that...

  • RE: query to find last date of a year

    Mangal,

    You've given an interesting solution that apparently depends in several ways on internals of MSSQL. Your -1 operand in the datediff could have been the slightly less obscure '1899'....

  • RE: Normalization

    A big disadvantage of redundant data is increased complexity of maintenance. Say you do add a "grandparent" foreign key A-ID to TableC. Then, if you ever change the A-ID...

  • RE: DateAdd Function

    Webrunner (and others following the subthread on my supplemental quiz question),

    The rounding of milliseconds in DATETIME data is to .000, .003, or .007. Keep this in mind when designing...

  • RE: DateAdd Function

    For one additional degree of difficulty: What's the result from this query?

    select DATEADD(HOUR,5,DATEADD(MINUTE,-59,'2009-02-09 12:34:56.789'))

    a) 2009-02-09 07:34:57.789

    b) 2009-02-09 16:35:56.789

    c) 2009-02-09 16:33:56.790

    d) 2009-02-09 16:35:56.790

  • RE: Rand() function error

    Jeff Moden (3/2/2009)[hr

    Ah... but that's not true for NEWID() which will give you a different return for every row generated by a SELECT. The code I provided above is...

  • RE: Removing cursor from TSQL - 2

    Lynn, I probably should have used something more than a winking emoticon to show that I am certainly aware of the term but was just trying to show Jeff some...

  • RE: Removing cursor from TSQL - 2

    So, Jeff, what's this "RBAR" I've heard so much about? 😉

  • RE: question, urgent please!!!

    The question "why" is important here not to tell you that you shouldn't find a solution to your core problem so much as to ask you to state the REAL...

  • RE: Rand() function error

    So what's wrong with RAND(), you may be wondering? As Jeff notes, the RAND (and also the NEWID) functions are deliberately designed to be invoked a single time in a...

  • RE: Foreign keys/null foreign keys and multiples thereof

    Your solution may be affected by whether there are external reasons to maintain separate series of ID values for Product, Gizmo and Widget, but it seems that you may want...

  • RE: Parenthesis Grouping

    In SQL 2005 SSMS, this is configurable. Under menu "Tools" pick "Options". Expand the "Environment" Option and selct "Fonts and Colors". Make sure "Show settings for:" is set to...

Viewing 15 posts - 601 through 615 (of 702 total)