Click here to Skip to main content
15,906,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi there,

I need to write a sql server job which takes two inputs and inserts values into a table.That is the username of the user who is using the system and the time he used it for that day. I wrote a step in the job to get username from a table and is fine. But the problem is to get the used time. I want to generate it dynamicaly when the task runs and this value is not available in any table as I wrote the code in c# to get the used time.Anyway I may store it in a temp table if we can write a job taking parameters.

I've searched for this but not found any result.Can you people suggest me how to write a job that takes input parameters.

Thanks in Advance,
Naresh.
Posted

1 solution

I see two options for you:
1. if you can have the "time used" in a table you can create a stored procedure that takes a parameter the curent user and reads coresponding time from temp table and write it in final table. In job you just execute the strored procedure.

2. it is more complicated but maybe you can transform your C# code to a scalar CLR function, but this is much more time consuming
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900