Viewing 15 posts - 601 through 615 (of 702 total)
serinor.e090266 (3/6/2009)
March 6, 2009 at 10:48 am
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...
March 5, 2009 at 12:29 pm
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...
March 5, 2009 at 12:09 pm
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...
March 4, 2009 at 5:13 pm
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'....
March 4, 2009 at 4:29 pm
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...
March 4, 2009 at 1:44 pm
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...
March 4, 2009 at 11:50 am
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
March 3, 2009 at 11:45 pm
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...
March 3, 2009 at 10:43 am
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...
March 2, 2009 at 3:31 pm
So, Jeff, what's this "RBAR" I've heard so much about? 😉
March 2, 2009 at 2:48 pm
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...
March 2, 2009 at 2:42 pm
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...
March 2, 2009 at 2:21 pm
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...
March 2, 2009 at 10:48 am
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...
February 27, 2009 at 5:23 pm
Viewing 15 posts - 601 through 615 (of 702 total)