Rama Tito
asked on
Data segreation in MSSQL 2005
Hi, I have a table name as "MasterInComingData", where i receive all kind of data from my machinery, Table design as follows:-
Column Name DataType
No int (primary key)
MachineNo int
MacLoc varchar(50)
TimeRec varchar(50)
Temp varchar(50)
Alarm varchar(50)
My questions is, how to segregate in programmability in MSSQL 2005. Upon data receive in "MasterInComingData". I wanted to segregate the data into a table "Alarm" and "Temp".
Where "Alarm" table get data from "MasterInComingData" only the MachineNo, TimeRec and Alarm.
For Temp table get data from "MasterInComingData" only the MachineNo, TimeRec and Temp.
how to do in program method in MSSQL 2005.
Column Name DataType
No int (primary key)
MachineNo int
MacLoc varchar(50)
TimeRec varchar(50)
Temp varchar(50)
Alarm varchar(50)
My questions is, how to segregate in programmability in MSSQL 2005. Upon data receive in "MasterInComingData". I wanted to segregate the data into a table "Alarm" and "Temp".
Where "Alarm" table get data from "MasterInComingData" only the MachineNo, TimeRec and Alarm.
For Temp table get data from "MasterInComingData" only the MachineNo, TimeRec and Temp.
how to do in program method in MSSQL 2005.
ASKER
Hi, My incoming message format in format . - > [machineno, macloc, time, temperature, alarm].
By default: either one of parameter in temperature or alarm will be "null". i have to check condition to insert which table after data arrival. If temperature data is not equll to null then i have to insert in temp table.
I am very new for MSSQL. To insert the scrip do i have to do this:-
right click on "MasterInComingData" then select "Script table as" then "SELECT To" then "New Query Editor Window"
CREATE TRIGGER dbo.t_InsData (is that we do create another table here)
By default: either one of parameter in temperature or alarm will be "null". i have to check condition to insert which table after data arrival. If temperature data is not equll to null then i have to insert in temp table.
I am very new for MSSQL. To insert the scrip do i have to do this:-
right click on "MasterInComingData" then select "Script table as" then "SELECT To" then "New Query Editor Window"
CREATE TRIGGER dbo.t_InsData (is that we do create another table here)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you, I do have another question which will posted shortly
Welcome...
Run the below script and insert data into MasterInComingData table.
Open in new window