Forum Replies Created

Viewing 15 posts - 58,276 through 58,290 (of 59,048 total)

  • RE: turn time in excel into epoch time for sql server 2000

    ...and thank you for the feedback...

  • RE: turn time in excel into epoch time for sql server 2000

    Or... don't let it default to INT...

    declare @DateOfInterest datetime,

            @EpochDate datetime

    set @DateOfInterest = '12/11/1962'

    set @EpochDate      = '1/1/1970 03:00'

    select CAST((@DateOfInterest - @EpochDate) AS DECIMAL(24)) *24 *60 *60 *1000  as n

  • RE: query to find out last date of the previous month

    Short, simple, nasty fast because there are no VARCHAR conversions...

    SELECT DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0)-1

  • RE: Question on select execution

    I agree... I always spell them out all the way...

    I don't believe BOL calls them "alias names" though.

  • RE: How can I drop all the constraints in a database

    The scripts offered will certainly work (although you may want to add WHERE so.XTYPE = 'U' to filter on tables only), but tell me please... why would you want to...

  • RE: Question on select execution

    Not quite true... JOIN is an acceptable shortcut for INNER JOIN.  Additionally, LEFT JOIN, RIGHT JOIN, and FULL JOIN are acceptable shortcuts for the similarly named OUTER counterparts...

        USE Northwind

     SELECT...

  • RE: checking if a stored proecures parameters are null or empty

    Ben,

    Why not make the ConsultancyBookingNumber column in the Consultancy table and IDENTITY column instead of using MAX+1?  Then, you wouldn't even need this procedure as the column would be auto-numbering...

  • RE: Copy tables to another server

    Nicely done... You should publish this in the "scripts" section of this forum.

  • RE: Truncating Date

    Although the DATEADD/DATEDIFF method will sometimes return a faster duration, it is slower than "convert(datetime,convert(int,GetDate()-.5))" if you consider actual resources used like CPU Seconds and DIsk Reads and Writes.  Here's...

  • RE: Truncating Date

    I just can't bring myself to trust anything in an article where the author makes mistakes like the following...

    "Remember that the BETWEEN clause retrieves values that are equal...

  • RE: Generating a Range

    David wrote... "If I was to use the static table approach I would probably stick it in its own database so that it wouldn't artificially inflate the backups."

    Yep, I know...

  • RE: Calculating void calls

    Thank you for the very nice compliment... I only hope it does what you need

  • RE: Generating a Range

    Well done, David.  It's nice to see it when someone takes multiple methods and does a really good performance comparison.

    It seems that generating a range of numbers in a temporary...

  • RE: DELETE duplicate records - need a simpler Solution

    ...and thank you for the feedback...

    By the way, if you do put such an index on the table, you will never have duplicates again.

  • RE: Calculating void calls

    I only count 2 extra rows but that may be due to a simple lack of coffee...

    Anyway... I think this might be what...

Viewing 15 posts - 58,276 through 58,290 (of 59,048 total)