Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sshay
Starting Member
1 Post |
Posted - 2003-01-13 : 11:05:26
|
| Hello AllI am working on a Trigger and I need a little help. I want the Trigger to fire once I set the status to True in the Items_TBL to populate the StartDate & EndDate Values from the Settings_TBLIs there anyway to populate existing values in the Items_TBL which have the status="TRUE" After I create the TriggerThanksStuartSettings_TBLID (int)StartDate (date)EndDate (date)Items_TBLItemID (int)StartDate (date)EndDate (date)Status (varchar)CREATE TABLE [dbo].[Settings_TBL] ( [ID] [int] NULL , [StartDate] [datetime] NULL , [EndDate] [datetime] NULL) ON [PRIMARY]GOINSERT INTO Settings_TBL (ID,StartDate,EndDate) VALUES('1','1/10/2003','1/31/2003')CREATE TABLE [dbo].[Item_TBL] ( [ItemID] [int] NULL , [StartDate] [datetime] NULL , [EndDate] [datetime] NULL , [Status] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL) ON [PRIMARY]GOINSERT INTO Item_TBL(ItemID, Status) VALUES('25', NULL)INSERT INTO Item_TBL(ItemID, Status) VALUES('26', NULL)INSERT INTO Item_TBL(ItemID, Status) VALUES('27', NULL)UPDATE Item_TBLSET Status='TRUE'WHERE ItemID='26' |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2003-01-13 : 11:08:51
|
quote: Is there anyway to populate existing values in the Items_TBL which have the status="TRUE" After I create the Trigger
Force the trigger to fire?update Items_TBL set status='true' where status='true'?-------Moo. |
 |
|
|
|
|
|
|
|