Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9310629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:09:46+00:00 2026-06-19T01:09:46+00:00

What is the difference between these 2 lines in SQL Server 2005 Express? DATEADD(d,

  • 0

What is the difference between these 2 lines in SQL Server 2005 Express?

DATEADD(d, 0, DATEDIFF(d, 0, @Today));

and

DATEADD(d, DATEDIFF(d, 0, @Today), 0);

Other than making this statement fail at random times:

DECLARE @DateSrc DATETIME;

-- Chop off the time part:
SET @DateSrc = DATEADD(d, 0, DATEDIFF(d, 0, @Today));

INSERT INTO dbo.SeqNo(MyGUID, TheDay, LastNo)
SELECT @MyGUID, @DateSrc, 0
WHERE NOT EXISTS ( 
  SELECT 1 FROM dbo.SeqNo AS sn
  WHERE sn.MyGUID = @MyGUID AND sn.TheDay = @DateSrc 
  );
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T01:09:47+00:00Added an answer on June 19, 2026 at 1:09 am

    The problem was a concurrency issue.

    The change of the stored procedure has been in production now for a few days and no problems; interesting fix one thinks. Apparently both versions work.

    But, I just reviewed the code again that checks for a single instance of the application and it was moved to after this stored procedure call. Arhhgg! Concurrency issue.

    Sorry for the trouble and thanks again for your help.

    ps. Just one interesting thing… why couldn’t I reproduce the concurrency problem within SQL Server Management Studio as per my comment above? That interleaved perfectly with the newer DateAdd format.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can you please explain me exact difference between these two lines? NSArray *foo =
Can someone tell me in really slow terms the difference between these 2 lines
Suppose I have a socket. What is the difference between these two lines of
Can anyone tell me what the difference is between these 2 lines of code,
Simple question I imagine, but what is the difference between these lines of code:
What's the difference between these 2 lines CArray<MyClass, MyClass> MyArray CArray<MyClass, const MyClass &
I was wondering what is the difference between these two lines of code? int
What is the difference between these two lines of code? int *ptr = &x;
What is the difference between these two lines? int pInt = 500; and Integer
I'm trying to figure out the difference between these two lines of code.. We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.