How to automatically insert data to sql according to date-wise.?

Posted by Mittaikariss under Sql Server on 11/3/2011 | Points: 10 | Views : 2745 | Status : [Member] | Replies : 8
I have some doubts.How to automatically insert data to sql according to date-wise.example attendance for employee. some person came today with in 10.00 o clock i will put present for that employee.but he wont come today within 10.00 o clk automatically will come that employee today absent ..what can i do....i am using trigger...but i cant get expected output.

....sundarsowmia....


Responses

Posted by: Jpchoudhari on: 11/3/2011 [Member] Starter | Points: 25

Up
0
Down
It is possible to mark an employee absent or late if he comes after 10.00 using trigger. can u give which trigger u r using??

Kind Regards,
Jay

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

Posted by: Mittaikariss on: 11/3/2011 [Member] Bronze | Points: 25

Up
0
Down
i am using after insert trigger.....i dont know is it correct.....but i did try this trigger...u know this concept....please clarify how to do that as your point of view step by step...its very helpful for me..please and thanks for your reply Mr.jpchoudhari.

Thanks


http://www.invomtech.com/

....sundarsowmia....

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

Posted by: Jpchoudhari on: 11/3/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

chk this u should get what trigger is http://www.mysqltutorial.org/sql-triggers.aspx

and about ur problem.. cant u check the time and if it is beyond 10 mark it as a absent

Kind Regards,
Jay

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

Posted by: Jpchoudhari on: 11/3/2011 [Member] Starter | Points: 25
Posted by: PandianS on: 11/3/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi

1. Create One stored procedure to Put Absent for all the employees those who are all not present yet within 10 O'Clock for the Day.
2. Schedule SQL Server JOB at 10 O'clock and Call the Stored procedure inside the Step of the JOB.

So, It'll automatically Put Absent for all the employees those who are all not present yet within 10 O'Clock.

I hope it would help!

Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

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

Posted by: Mittaikariss on: 11/4/2011 [Member] Bronze | Points: 25

Up
0
Down
Thanks Mr.Pandian its Helpful for me and also jay.

....sundarsowmia....

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

Posted by: Mittaikariss on: 11/4/2011 [Member] Bronze | Points: 25

Up
0
Down
And then i am using sql 2005 management sutdio. there isn't sql server agent.how to add sql server agent for job Schedule in sql2005 management studio

Thanks.

http://www.invomtech.com/

....sundarsowmia....

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

Posted by: PandianS on: 11/4/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down

1. In which login do you login into SQL Server ?
2. You don't have the SQL Agent Access permission for that Login.

How to resolve It!

1. Login into SQL Server using Sysadmin Role (i.e: sa)
2. Execute the following statement to Grant access permission for your Login
USE [msdb]

GO
EXEC sp_addrolemember N'SQLAgentUserRole', N'YourLogin'
GO
The statement is used to grand SQL Agent access/view permission to YourLogin.


Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

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

Login to post response