Click here to Skip to main content
16,005,241 members
Home / Discussions / Database
   

Database

 
AnswerRe: How to add not null column in SQL Server 2005? Pin
Mark J. Miller7-Apr-08 5:29
Mark J. Miller7-Apr-08 5:29 
Generallink database to adialog based application Pin
lahom6-Apr-08 12:33
lahom6-Apr-08 12:33 
Generalwhere add related tables automatically on diagram sql server 2005 Pin
Rami Said Abd Alhalim5-Apr-08 23:42
Rami Said Abd Alhalim5-Apr-08 23:42 
GeneralRe: where add related tables automatically on diagram sql server 2005 Pin
Blue_Boy6-Apr-08 20:17
Blue_Boy6-Apr-08 20:17 
GeneralSql qstn(bit) Pin
hari4ur5-Apr-08 0:22
hari4ur5-Apr-08 0:22 
GeneralRe: Sql qstn(bit) Pin
Colin Angus Mackay5-Apr-08 5:04
Colin Angus Mackay5-Apr-08 5:04 
GeneralRe: Sql qstn(bit) Pin
Mycroft Holmes5-Apr-08 18:16
professionalMycroft Holmes5-Apr-08 18:16 
GeneralMSSQL 2000 trigger on update [modified] Pin
Ronni Marker4-Apr-08 23:12
Ronni Marker4-Apr-08 23:12 
Hi Guys,
Havent been working much on triggers and well have to get one to work now, so need some help to get the holy grail.

I have a table called username and when ever a record have been changed I need to update the last update time in column lastvisittime. The problem is that with this trigger below it updates every record in the table and not just the single one that is being updated.

CREATE TRIGGER [TimeUpdate] ON [dbo].[username] <br />
FOR UPDATE<br />
AS<br />
UPDATE username set lastvisittime = dbo.TINT(getdate()) 


Generally I need to know how do I find out what row was currently supposed to be updated? Isteadof updating the whole table as it does now.

Have been trying good old uncle google but didnt find any clue to it, so hope the experts here can help Smile | :)

N.b. dbo.TINT(getdate()) is just a function that changes the datetime to an int value.


Cheers,
Ronni

modified on Saturday, April 5, 2008 6:57 AM

GeneralRe: MSSQL 2000 trigger on update Pin
Ronni Marker5-Apr-08 1:24
Ronni Marker5-Apr-08 1:24 
GeneralI have an Interesting Problem Pin
keencomputer4-Apr-08 20:43
keencomputer4-Apr-08 20:43 
GeneralRe: I have an Interesting Problem Pin
Rami Said Abd Alhalim5-Apr-08 23:44
Rami Said Abd Alhalim5-Apr-08 23:44 
GeneralConcurrency violation on update command. Pin
msx234-Apr-08 14:11
msx234-Apr-08 14:11 
GeneralRe: Concurrency violation on update command. Pin
Rami Said Abd Alhalim5-Apr-08 23:49
Rami Said Abd Alhalim5-Apr-08 23:49 
QuestionStored-Procedure (SP) - Executed as single transaction? Pin
Adeel Chaudhry4-Apr-08 9:26
Adeel Chaudhry4-Apr-08 9:26 
AnswerRe: Stored-Procedure (SP) - Executed as single transaction? Pin
Mark J. Miller4-Apr-08 12:03
Mark J. Miller4-Apr-08 12:03 
GeneralRe: Stored-Procedure (SP) - Executed as single transaction? Pin
Adeel Chaudhry5-Apr-08 4:50
Adeel Chaudhry5-Apr-08 4:50 
GeneralRe: Stored-Procedure (SP) - Executed as single transaction? Pin
Mark J. Miller6-Apr-08 4:31
Mark J. Miller6-Apr-08 4:31 
QuestionHelp in understanding a simple query result Pin
Snowman584-Apr-08 8:17
Snowman584-Apr-08 8:17 
GeneralRe: Help in understanding a simple query result Pin
A Wong4-Apr-08 9:02
A Wong4-Apr-08 9:02 
GeneralRe: Help in understanding a simple query result Pin
Snowman584-Apr-08 9:10
Snowman584-Apr-08 9:10 
GeneralRe: Help in understanding a simple query result Pin
A Wong4-Apr-08 9:54
A Wong4-Apr-08 9:54 
GeneralRe: Help in understanding a simple query result Pin
Snowman584-Apr-08 10:00
Snowman584-Apr-08 10:00 
GeneralRe: Help in understanding a simple query result Pin
suppaman5-Apr-08 4:24
suppaman5-Apr-08 4:24 
GeneralRe: Help in understanding a simple query result Pin
Snowman586-Apr-08 16:17
Snowman586-Apr-08 16:17 
GeneralRe: Help in understanding a simple query result Pin
suppaman10-Apr-08 13:11
suppaman10-Apr-08 13:11 

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.