Viewing 15 posts - 781 through 795 (of 4,081 total)
Well, you could build a table with each db/schema/table/column in it, and then specify the default values to be used for each. Then you could use the...
November 9, 2012 at 12:34 am
There's a function for what you want: CONVERT()
select convert(varchar(6),convert(date,'01 Jan 1980'),12)
select convert(varchar(6),convert(date,'01 Jan 2000'),12)
The inner CONVERT function turns your string into a DATE character type. The...
November 9, 2012 at 12:30 am
Hey, does anyone realize that in 8-9 days, The Thread will have been running strong for 4 consecutive years now?
November 9, 2012 at 12:14 am
Just arrived in Seattle. No chest pains, no shortness of breath. So far so good. 😛
November 4, 2012 at 9:22 pm
I've come to use CTE's rather than subqueries, as in the last example, simply because it is easier for me to read from the top down than from inside out.
November 4, 2012 at 9:19 pm
Important to remember:
When someone says to use a certain technique because it is better/faster/more economical, make it a point to understand WHY. Blind faith...
October 30, 2012 at 10:44 am
Cheryl McLaughlin-385812 (10/11/2012)
October 29, 2012 at 4:06 pm
I know, Sean. And I can't understand why that isn't it. It would be nice if the OP came back and told us...
October 29, 2012 at 4:04 pm
Another solution is dynamic SQL. Write the query to return all rows, and then insert your TOP () and ORDER BY as needed.
October 29, 2012 at 12:58 pm
Is there a reason why you can't just create a table with an identity column and add all your unique value pairs to it? Then you could simply...
October 29, 2012 at 12:12 pm
Or did you mean to do something like this?
declare @datetimes table (ID int identity(1,1), date1 datetime, date2 datetime)
insert into @datetimes
select '11/03/2011','12/01/2012'
union all
select '11/03/2011','10/01/2011'
select MAX(case when Date1 >= Date2 then date1...
October 26, 2012 at 9:25 am
You originally were talking about four dates, so that's how we wrote the functions.
Inline table valued functions can be implemented with a CROSS APPLY, like so.
declare @datetimes...
October 26, 2012 at 9:06 am
I feel compelled to post a warning against using such a technique on tables with production-scale volumes. It can lead to poor execution plans. ...
October 25, 2012 at 2:32 pm
Viewing 15 posts - 781 through 795 (of 4,081 total)