Forum Replies Created

Viewing 15 posts - 1 through 15 (of 20 total)

  • RE: Get latitude back from geography type?

    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...

  • RE: How to eliminate duplicate records from a database table?

    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...

  • RE: T-SQL

    >noticed that the INSERT is actually part of the stored procedure.

    That part was obvious. I was distracted by the possible NULL (or rather empty value) on the insert, and...

  • RE: Deleting Duplicate batches of rows

    don't need a temp table. don't need cursors.

    you can remove dups in one statement.

    cheers.

  • RE: date time query

    i strongly advise you / everyone to read about datetime handling in books online.

    date and time handling is an extensive topic.

  • RE: Can you order by on datename?

     

    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...

  • RE: Date range including all years

     

    >> 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...

  • RE: Barcode (Code 39) nothing special required

     

    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...

  • RE: Date range including all years

     

    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)...

  • RE: Can you order by on datename?

     

    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)

  • RE: 40-1 ratio for disk space to DB size?

    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...

  • RE: Schema Replication

    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...

  • RE: Can you order by on datename?

    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)

     

  • RE: Optimization plan freezing up SQL Server.

    when you change server names, just run the installer again - easiest way to update all the system tables with the new name.

  • RE: Firsrt day of a month

    my favorite...

    select convert(char(7), getdate(), 120) + '-01'

    or

    select convert(char(6), getdate(), 112) + '01'

    convert to datetimes if you need to.

     

Viewing 15 posts - 1 through 15 (of 20 total)