0
votes
0answers
31 views

Update existing (old) rows vs delete and insert when needed

I'm building a database system that needs to store login tokens for a system that validates if a users login token is valid or outdated. The table is pretty simple UserID int Primary Key LoginToken ...
1
vote
0answers
49 views

Update on a small table times out

We use Microsoft SQL Server Express Edition with Advanced Services 2008 R2 SP2 We have two locations. Each location has one sql server that serves about 20 client computers. Client computers are ...
1
vote
1answer
39 views

How to update a single record in a table based of foriegn key ID in another table?

I am still very new to sql. I am having troubles updating one table. I am sending information from a web application into Microsoft SQL 2008 database. I have a table called EmployeePermissions that ...
1
vote
2answers
178 views

Install SP 3 on SQL Server 2008, where merge replication is running

I have a SQL Server 2008 and I should install Service Pack 3 for it. On my server there are several databases replicated, and mobile devices sync data via merge replication. Can problems occur, if I ...
0
votes
1answer
589 views

Is it there anyway to restore updated records in Microsoft SQL Server 2008 R2?

We have an test database configured with our web application. Due to internal web application error the entries were get updated in the database. Is it there any way to recover the updated records? ...
1
vote
3answers
155 views

How to handle update or insert situations

From time to time my stored procedures looks like create procedure handle_data @fk int ,@value varchar(10) as begin if exists (select * from my_table ...
7
votes
1answer
1k views

Direct the OUTPUT of an UPDATE statement to a local variable

I would like to do this : DECLARE @Id INT; UPDATE Logins SET SomeField = 'some value' OUTPUT @Id = Id WHERE EmailAddress = @EmailAddress -- this is a parameter of the sproc Is this even ...
0
votes
1answer
142 views

Updating a table based on condition

I have a database having a staging_table. From this table, entries are added to other table named Profile. Whenever staging_table is updated, it checks whether all its entries are present in Profile, ...