I have a SQL Sever 2014 database that is used for our Helpdesk system.
I am wanting to write a SQL Query that I can schedule to run every morning at 6:00am that will insert a single row into a table.
Bascially I have a reoccuring Helpdesk call that needs to be logged every day and I'm wanting to automate this task.
This probably sounds simple enough but I need help with the syntax when it comes to getting the current date/time when the query runs and inserting this information into one of the fields.
Let me explain in greater detail.
The table where the information is to inserted into is called HELPDESK
The HELPDESK table has the following fields that need filling in
[CID] varchar Client ID field. This will always be set to ADG144
[TID] [int] IDENTITY(1,1) Ticket ID. This is the Helpdesk Call # that is assigned to the call. TID is autoassigned.
[OPENTIME] [datetime] Date and Time when the Helpdesk call was logged. Need the script to enter the current date/time when script runs
[ASSIGNEDTO] varchar Engineer who call is assigned to. Always set to JOHN
[SUBJECT] varchar Helpdesk Call Subject. Needs to say Onsite Support - xxxx where xxx is the current day and date eg Onsite Support - Tuesday 1/3/16
[STATUS] varchar Status of call - This will always be set to OPEN
So as you can see there are two fields OPENTIME and SUBJECT where the script must extract date information and enter it into the field
Hopefuly this explains things enough for you to follow.
Thanks in advance for any help provided.