Click here to Skip to main content
15,908,455 members
Home / Discussions / Database
   

Database

 
GeneralRe: where clause in sql Pin
Eddy Vluggen14-Dec-09 1:40
professionalEddy Vluggen14-Dec-09 1:40 
GeneralRe: where clause in sql Pin
Luc Pattyn14-Dec-09 1:59
sitebuilderLuc Pattyn14-Dec-09 1:59 
GeneralRe: where clause in sql Pin
Niladri_Biswas14-Dec-09 18:12
Niladri_Biswas14-Dec-09 18:12 
QuestionDSn Creation through SQLConfigDataSource() funciton Pin
Durga_Devi14-Dec-09 0:19
Durga_Devi14-Dec-09 0:19 
QuestionHow to identify the ID of row which has been modified? Pin
Member 470414312-Dec-09 13:26
Member 470414312-Dec-09 13:26 
AnswerRe: How to identify the ID of row which has been modified? Pin
dan!sh 12-Dec-09 18:49
professional dan!sh 12-Dec-09 18:49 
AnswerRe: How to identify the ID of row which has been modified? Pin
Mycroft Holmes13-Dec-09 13:44
professionalMycroft Holmes13-Dec-09 13:44 
AnswerRe: How to identify the ID of row which has been modified? Pin
Member 450194017-Dec-09 8:11
Member 450194017-Dec-09 8:11 
I concur. This is NOT the place for a trigger. I only use triggers to store 1)disposable, 2)derived and 3)complex data used for reporting or searching. Must meet all 3 criteria. But to answer the question-
UPDATE Demo   
Set BeModified = 1 WHERE ID IN (SELECT ID FROM inserted)

OR
UPDATE Demo 
Set BeModified = 1
FROM Demo
INNER JOIN inserted 
ON Demo.ID = inserted.ID

This is assuming sql server.

The "inserted" table is a virtual table which contains all of the fields and values from the insert, update or delete that fired the trigger.

You might think that only a record at a time is updated but in fact since it is possible to update multiple records at the same time, this may NOT be what you want. But thats what you get with triggers. If you ever have to update all of the records in that table, BeModified will be set to 1 for all. Be warned.
QuestionInvalid Object Name : 'sysdatabases' Pin
VikashGohil11-Dec-09 20:11
VikashGohil11-Dec-09 20:11 
AnswerRe: Invalid Object Name : 'sysdatabases' Pin
Mycroft Holmes11-Dec-09 23:17
professionalMycroft Holmes11-Dec-09 23:17 
GeneralRe: Invalid Object Name : 'sysdatabases' Pin
VikashGohil13-Dec-09 18:47
VikashGohil13-Dec-09 18:47 
GeneralRe: Invalid Object Name : 'sysdatabases' Pin
Mycroft Holmes13-Dec-09 19:04
professionalMycroft Holmes13-Dec-09 19:04 
AnswerRe: Invalid Object Name : 'sysdatabases' Pin
Rob Philpott13-Dec-09 23:14
Rob Philpott13-Dec-09 23:14 
QuestionDeny users to change data through backend Pin
v1i9n6o7d11-Dec-09 19:06
v1i9n6o7d11-Dec-09 19:06 
AnswerRe: Deny users to change data through backend Pin
The Man from U.N.C.L.E.11-Dec-09 23:21
The Man from U.N.C.L.E.11-Dec-09 23:21 
GeneralRe: Deny users to change data through backend Pin
v1i9n6o7d12-Dec-09 1:07
v1i9n6o7d12-Dec-09 1:07 
GeneralRe: Deny users to change data through backend Pin
Eddy Vluggen12-Dec-09 4:34
professionalEddy Vluggen12-Dec-09 4:34 
AnswerRe: Deny users to change data through backend Pin
Mycroft Holmes11-Dec-09 23:22
professionalMycroft Holmes11-Dec-09 23:22 
QuestionLocking and Transaction in SQL Server Pin
sandeepranjan11-Dec-09 15:12
sandeepranjan11-Dec-09 15:12 
AnswerRe: Locking and Transaction in SQL Server Pin
The Man from U.N.C.L.E.11-Dec-09 23:15
The Man from U.N.C.L.E.11-Dec-09 23:15 
QuestionDetecting SQL Server Activity Pin
cjb11011-Dec-09 0:34
cjb11011-Dec-09 0:34 
AnswerRe: Detecting SQL Server Activity Pin
Garth J Lancaster11-Dec-09 1:03
professionalGarth J Lancaster11-Dec-09 1:03 
QuestionHow to delete data from database Pin
sarang_k10-Dec-09 17:25
sarang_k10-Dec-09 17:25 
AnswerRe: How to delete data from database Pin
dan!sh 10-Dec-09 17:55
professional dan!sh 10-Dec-09 17:55 
GeneralRe: How to delete data from database Pin
sarang_k10-Dec-09 18:05
sarang_k10-Dec-09 18:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.