Howcan insert record Mon to Sata and Sun wll nt insert recod
how can insert record Monday to Sataday and Sunday will not insert record in sql server
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Dhanunjay Jajimoggla100 reputationPosted Oct 15, 2014, 12:20 AM EDT
you many handle this scenario in following ways...
1) Client side
OR
2) .cs Page
if(DateTime.Now.DayOfWeek.ToString()=="Sunday"){
// return some alert message
}
else
{
//call Insert method
}
3)In Stored Procedure
begin
if(select datename(dw,getdate())=='Sunday')
return 'There is no chance to insert the values on Sunday'
else
//your insert command
OR
4) Use trigger also