Forum Replies Created

Viewing 15 posts - 4,846 through 4,860 (of 6,400 total)

  • RE: RESTORE could not start database - Possible schema corruption

    Could you not use the generate scripts function in ssms.

    It's somewhere on the database when you right click it, can also get it to script out the data and should...

  • RE: Today, Tomorrow, This Week

    Just use due date > getdate() and due date <= the first expression in my last post

  • RE: Today, Tomorrow, This Week

    --To get 23:59:59 of the current day

    SELECT CONVERT(DATETIME,LEFT(CONVERT(NVARCHAR,GETDATE(),120),10)+' 23:59:59.997')

    --To get 00:00:00 of the next day

    SELECT CONVERT(DATETIME,LEFT(CONVERT(NVARCHAR,GETDATE()+1,120),10)+' 00:00:00.000')

    --To get 23:59:59 of the next day

    SELECT CONVERT(DATETIME,LEFT(CONVERT(NVARCHAR,GETDATE()+1,120),10)+' 23:59:59.997')

    That will do what you need,...

  • RE: Today, Tomorrow, This Week

    Sachin 80451 (5/28/2012)


    It give me this error:

    Msg 243, Level 16, State 1, Line 1

    Type DATE is not a defined system type.

    DOH, my bad, forgot I was in the 2005 Forum,...

  • RE: Today, Tomorrow, This Week

    Why do you need to change from DATE to DATETIME?

  • RE: Today's Random Word!

    SQLDBA360 (5/28/2012)


    anthony.green (5/25/2012)


    crookj (5/25/2012)


    anthony.green (5/25/2012)


    Ray K (5/25/2012)


    SQLRNNR (5/24/2012)


    crookj (5/24/2012)


    Daniel Bowlin (5/24/2012)


    anthony.green (5/24/2012)


    Ray K (5/24/2012)


    SQLRNNR (5/23/2012)


    Revenant (5/23/2012)


    tiger

    Survivor

    Foreigner

    asylum

    records

    I Want to Know What Love Is

    Shakespeare's Sister

    Whistler's Mother

    Mr Bean

    Mr Bill

    Bill and Ben the flower...

  • RE: Limiting the records?

    cursors have their place when you need to do RBAR but if you can go for set based executions.

    now depending on what your cursor is doing will depend on if...

  • RE: Today, Tomorrow, This Week

    Ok, lets start again

    For the current day you want

    DueDate > GETDATE() AND DueDate < CONVERT(DATE,DATEADD(DAY,1,GETDATE())) --DueDate > '2012-05-28 15:12:00.000' AND DueDate < '2012-05-29'

    For tomorrow (if you just want...

  • RE: Limiting the records?

    yes, like Andy said, you need to add in a row_number clause to your select, wrap it all in a cte, then have 2 variables, set 1 as the lower...

  • RE: Limiting the records?

    It all depends on what your doing with the processing and if the whole table needs to be processed at the same time or if they can be processed in...

  • RE: Today, Tomorrow, This Week

    Sachin 80451 (5/28/2012)


    Yes fantastic that works. I did only want records for that day and after current time.

    what would the logic be for tomorrow?

    or this week?

    For tomorrow

    To see...

  • RE: Today, Tomorrow, This Week

    Sachin 80451 (5/28/2012)


    This also returns records with the following due date 29/5/2012 00:00:000?

    Can you post us some more sample data with varing dates, then give us a date and time...

  • RE: How to count the rows?

    declare a variable and set it to the variable + @@rowcount on each itteration

    declare @rc bigint = 0

    set @rc = @rc + @@rowcount

  • RE: Today, Tomorrow, This Week

    Sachin 80451 (5/28/2012)


    I have a load of records in a table. Each with a duedate. The duedate is a datetime field.

    I want to get todays records. Past the current...

  • RE: Booked 70-450

    Yeah, I'm out of the books now, everything is away, only thing i can see on my desk is my flash cards, but as I have spend all morning crossing...

Viewing 15 posts - 4,846 through 4,860 (of 6,400 total)