Question about inserting/updating rows with SQL Server (ASP.NET MVC) -
I have a very large table with several lines, each row has statistics for each user for a few days and obviously I do not have any data for the future, so I use it to update the data which
updated data SET visit = @wALL WHERE ... many terms ... And date = @ today
but if the row does not exist? I have to use
INSERT statistics (...) VALUES (visit = @ walk, ..., date = @ today)
I How can I check whether the row exists or not? Is there any way different from doing COUNT (*)?
If I fill the table with empty cells, then it takes thousands of rows to pick up megabytes and store the data.
If you are using SQL Server 2008 and above, In the 2008 edition, the code should check the code.
Comments
Post a Comment