How to solve this with Stored Procedure.

Posted by Jayakumars under ASP.NET on 11/13/2011 | Points: 10 | Views : 1011 | Status : [Member] [MVP] | Replies : 3
I have Enter for holiday Details like this below my Table Struture


Table Stru
===========
Days varcahr
DFrom Datetime
DTo Datetime


here my issue i will enter from date to date to insert
my intension

1.How to Restrict Duplicate Date Insert in sql
2. How to restrict between date already give the holdays date
ex:From Date ->25/11/2011-DD/MM/yyyy Todate like this->27/11/2011-DD/MM/yyyy format
here user enter suppose -26/11/2011 but this is not allow here becos already leave date alloted so
how will do this one stored proceduere any one post this i need most urgent .

Mark as Answer if its helpful to you


Responses

Posted by: Blessyjees on: 11/14/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,

You can do this in SP. First you need to check the data exist startdate or endate like

if not exist( select * from stru where @startdate between startdate and endate or @endate between startdate and endate)
Begin
write insert query
end

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: perfectchourasia-9163 on: 11/14/2011 [Member] Starter | Points: 25

Up
0
Down
use the jquery datepicker and read the usage of that your problem will be solved.

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: perfectchourasia-9163 on: 11/14/2011 [Member] Starter | Points: 25

Up
0
Down
the best way two check date on clientside i have used in our site fortunehotels.in in this way only

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response