Viewing 15 posts - 1 through 15 (of 20 total)
ya know, i tried that --but must have botched the syntax/names, because it certinaly works.
select MyGeography.Lat from MyTable
select [MyGeography].Long from [MyTable]
thanks.
BTW, I did look around BOL, don't see...
February 10, 2009 at 12:05 pm
No cursors or temp tables needed.
You can always add a primary key to a table, then remove dups.
1) using CTE statement (examples above).
or
2) delete using a self-join with...
January 6, 2009 at 3:14 pm
don't need a temp table. don't need cursors.
you can remove dups in one statement.
cheers.
October 3, 2008 at 11:45 am
i strongly advise you / everyone to read about datetime handling in books online.
date and time handling is an extensive topic.
July 15, 2005 at 2:19 pm
minor point... maybe to get the records - but not to sort them since you're performing a calculation (charindex / left / datename) on the fly.
i'd stick with the datepart solution.
Ya...
June 23, 2005 at 2:59 pm
>> Datepart(mm, orderdate) between 2 and 4 or (Datepart(mm, orderdate) =5
Kenneth, what are you doing here? Between includes the range specified.
should be ...
Datepart(mm, orderdate) between 2 and 5
that includes Feb...
June 23, 2005 at 2:40 pm
i threw this into a web page, looks great. but won't print -- doesn't show up?
the browser appears set not* to render table background colors.
what you see, is not what you...
June 23, 2005 at 2:27 pm
here's the birthday sort :
select * from customers
order by Datepart(mm, DOB), Datepart(dd, DOB)
and likewise for dates between 2/1 and 5/15 regardless of year...
(example from using Northwind)
select * from orders
where Datepart(mm, orderdate)...
June 22, 2005 at 1:04 pm
exactly...
that's by month alone. here's by month / day - if you need to sort by day as well.
select * from orders
order by Datepart(mm, orderdate), Datepart(dd, orderdate)
June 21, 2005 at 2:03 pm
we keep 3 daily backups, plus translogs on a local raid volume (that goes to tape backup).
i'd say we have a minimum 12:1 ratio for physical storage requirements to...
June 21, 2005 at 1:43 pm
i just wrote an shell app to stuff the schema into source safe using DMO. just an afternooon project, a little longer for all the bells and whistles needed for...
June 21, 2005 at 1:31 pm
i'm sorry - did i miss something?
wouldn't you sort by month like this...
examples using Northwind :
select * from [orders]
order by Month(orderdate)
select * from orders
order by Datepart(mm, orderdate)
June 6, 2005 at 2:54 pm
when you change server names, just run the installer again - easiest way to update all the system tables with the new name.
May 31, 2005 at 1:18 pm
my favorite...
select convert(char(7), getdate(), 120) + '-01'
or
select convert(char(6), getdate(), 112) + '01'
convert to datetimes if you need to.
May 27, 2005 at 2:24 pm
Viewing 15 posts - 1 through 15 (of 20 total)