SQL Server Data Entry Guide
SQL Server Data Entry Guide
First, create your table in SQL Server to store the state name and tag values:
StateName NVARCHAR(100),
Tag1 NVARCHAR(100),
Tag2 NVARCHAR(100),
Tag3 NVARCHAR(100),
Tag4 NVARCHAR(100),
Tag5 NVARCHAR(100),
Tag6 NVARCHAR(100),
Tag7 NVARCHAR(100),
Tag8 NVARCHAR(100),
Tag9 NVARCHAR(100),
Tag10 NVARCHAR(100)
);
Create a stored procedure that will handle the insertion of data into the table:
AS
BEGIN
INSERT INTO MyTable (StateName, Tag1, Tag2, Tag3, Tag4, Tag5, Tag6, Tag7,
Tag8, Tag9, Tag10)
VALUES
'TagI', 'TagJ');
END;
SQL Server Agent allows you to schedule jobs to run at specific times.
Steps:
1. General Tab:
2. Steps Tab:
EXEC InsertDataIntoMyTable;
3. Schedules Tab:
2. Click Start.
1. Right-click on your job (InsertDataJob) under SQL Server Agent > Jobs.
At 6:00 AM and 6:00 PM, the following data will be inserted into the table:
| StateName | Tag1 | Tag2 | Tag3 | Tag4 | Tag5 | Tag6 | Tag7 | Tag8 | Tag9 |
Tag10 |
|-------------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|
| California | TagA | TagB | TagC | TagD | TagE | TagF | TagG | TagH | TagI |
TagJ |
Summary
- SQL Server Agent Job: Schedules the stored procedure to run at 6:00 AM and
6:00 PM daily.