Viewing 15 posts - 3,946 through 3,960 (of 4,080 total)
I'm not laughing or mad, Joe. But you actually had two questions. Steveb already gave you a link to the UNPIVOT operation, which has an example...
December 3, 2008 at 1:53 pm
Yes. Primary Key constraints force columns to be unique. For example, you usually have an employee ID number as a primary key for an employees table...
December 3, 2008 at 11:07 am
... and to strip off the time from a datetime column, you can use CONVERT
declare @sample datetime
set @sample = getdate()
select @sample as DateAndTime,CONVERT(char(10),@sample,101) as DateOnly
December 3, 2008 at 11:02 am
where B.col2 = '5' and B.col2 is null
-------------------------------------------
B.col2 can't be both '5' and NULL at the same time.
December 3, 2008 at 10:54 am
When you say a date field is "empty", does that mean the column in your table is NULL ?
If so, you can just take a count of the rows in...
December 3, 2008 at 10:44 am
My current thinking is along the lines of a trebuchet.
Next year I'm going to have one down by my dock. Most of my buddies find...
December 3, 2008 at 8:45 am
Note to self.... invent and patent pork chop slinger... the infomercials are going to be hilarious.
December 3, 2008 at 8:34 am
... and now I know there is a SIGN function... which of course returns just exactly what is needed for setting the "bits". Remind me never to take...
December 3, 2008 at 8:29 am
Seeing no way to improve on the CASE logic in the proposed solution, I tried using a CHARINDEX test instead of a LIKE test just for grins.
...
December 2, 2008 at 5:53 pm
Ok, Jeffrey... I'll hold him while you beat the answer out of him 😉
December 2, 2008 at 5:20 pm
You could always make your defaults null and then test/assign values as the first part of your proc. For example if you wanted the number 8 to be...
December 2, 2008 at 4:23 pm
I agree about the use of an identity column instead of a trigger, but if you are determined to stick with your existing setup, the following will assign consecutive project...
December 2, 2008 at 8:10 am
How about this? Circa 1980, I was working for IBM and was introduced to something called SQL which we were just starting to sell as a programmer productivity...
December 2, 2008 at 8:03 am
Thanks. Sorry for letting so many days pass. They let us off early for Thanksgiving holidays.
December 1, 2008 at 10:20 am
Your join looks the same in all cases so this might work a little faster for you. I know it looks strange to have your criteria in both...
December 1, 2008 at 10:15 am
Viewing 15 posts - 3,946 through 3,960 (of 4,080 total)