Hello All,
I have a Table1 and based upon it i created Table2 with all the formulas and complexity. Here i need to execute those queries whenever some data is entered into the Table1.
How it is possible?
Basically, i have given a file(excel file) upload option in the ASP.NET which stores the excel file data into the database. Now i need to execute certain queries on the Table1 for fetching manipulated data to be stored in Table2. And this has to occur whenever a user uploads a new data in Table1, hence Table2 will be regularly updated.
Will it work using a stored procedure in C#.
Like, giving a SQL commands in Button Click Event
Or
Executing it in SQL server it self.
I hope am clear in explaining my problem.
Soluble answers will be greatly appreciated.
Thanks
Saiekrishna
What I have tried:
Example of my query which needs to be automatically executed:
INSERT INTO Table2
SELECT field1],
count(case when [field2] = 'No Value' then 1 end) as Results_1,
sum(case when [field3] IS NULL then 0 else 1 end) as Result_2,
count(case when [field4] = 'Yes' then 1 end) as Result_3,
sum (case when [field5] = '0' then 0 else 1 end) as Result_4,
FROM Table1