Hi
I have the nex table
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTA MP ON UPDATE CURRENT_TIMESTA MP,
`date_created` date DEFAULT NULL,
`time_created` time DEFAULT NULL,
`name` varchar(20) DEFAULT NULL,
`password` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),...
Search Result
Collapse
15 results in 0.0015 seconds.
Keywords
Members
Tags
-
newDevMan started a topic SQL Server: Create an ID field (PK) based on two fields with a trigger-- HELP!in SQL ServerSQL Server: Create an ID field (PK) based on two fields with a trigger-- HELP!
Ok, So I'm a bit new at SQL Server, and I've researched this everywhere but cannot find a clear answer and/or sample code for a solution:
-I have a table [Indicators] that has a bunch of fields including [MOE] field and a [Indicator_Selec tor] field, and the [INDid] field, which is the PK.
-My goal is to auto-generate the [INDid] field (PK) from concatenating the [MOE] and [Indicator_Selec tor] fields. so... [INDid]=[MOE]+[Indicator_Selec tor].... -
creating Trigger for every table in a database
Hi
Lets say I have a table MyUser (column: MyuserID, Username)
Another table Product (column: ProductID, ProductName)
Then I created a table MyUser_Audit (column: MyUserID, Username, audit_action, Audit_Timestamp ) to store all the audit trail.
And now, user01 with name Mary inserted ProductID and ProductName into the Product table.
How do I create a trigger to audit trail... -
About how to query trigger enabled status
Is that possible to show all triggers enabled status(true/false) within a schema by an SQL query? -
Simple Email Trigger Question, just am very new to triggers
Hi,
I'm trying to send an email to' sample@sample.c om' when a new row on my table contactform_con is inserted. Basically, when a person fills out the contact form (contactform_co n) I want one email to go to one person to let them know.
I've tried doing this using both navicat and PHPMyAdmin, but I've had no success.
I've tried using EXEC xp_sendmail, but I'm not even sure if I have that as a stored... -
Best route to schedule VB.NET to run automatically?
Hello all,
The current project I'm working on requires me to automate some VB.NET code to run every 24 hours. Currently I have everything tied to a local webpage and I've just been calling it all from a button click in a browser. A normal web app basically.
My question is....what is the best way for me to start getting this to run on a schedule time frame? I've been looking into triggers, but if I'm not mistaken... -
Can I do this in a trigger?
I am setting variables to a select statement. It is working, but I hear this is a bad practice. Can someone tell me if what the trigger is doing is a good practice.
set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
go
ALTER TRIGGER [Dpc_Add_Zone_OC _History] ON [dbo].[zone]
FOR INSERT, UPDATE
AS
Declare @icnt int
,@dcnt int
,@tran_type char(1)
,@ZoneID... -
Multiple condition trigger
I need help with a multiple condition trigger. I saw a post on Dec '06 and coded my trigger like that one but it still doesn't work. I am using DB2 V9 on z/OS.
CREATE TRIGGER DB2DBA.DSOPTCR5
NO CASCADE BEFORE INSERT ON MAD.DSOPTCT
REFERENCING NEW AS N
FOR EACH ROW MODE DB2SQL
SELECT CASE WHEN N.CNSTRNT_TO_TY PE_CD = 'C'
... -
Mysql DATETIME
I dont really have a problem, but I want to make my code faster and prettier.
I have some tables with DATETIME in it.
They have the std format %Y-%m-%d %H:%i:%s
I need them to be in %d.%m.%Y %H:%i format.
I tried to fix it with the server variable "datetime_forma t".
After reading a lot in mysql doc I found out that:
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.... -
creating a trigger to remote database
Hi,
I have to feed database A from database B which are in different machines but in the same network when a insert/update occurs on database B. I decided to use trigger for this and was trying to write a trigger but failed so far.... (I have written triggers in mysql but using pgsql is a bit difficult to me...) It will be so helpful to me if anyone can post a trigger for my scenario.
Please be kind enough to show... -
mysqldump wraps all trigger code in comments.
I was trying to compare a particular trigger on multiple servers.
First I tried phpMyAdmin to script the trigger code, which unfortunately only worked on one server that has newer version of phpMyAdmin...
Then I used mysqldump, which scripted trigger code on all the servers, bur with comments around all the trigger related code:
phpMyAdmine scripted trigger code without comments. Why are those comments... -
trigger error
Hi
Please help me create a trigger. This is the code but i am getting errors
CREATE Trigger MyTrigger
AFTER
update [or delete] on dbo.Products
REFERENCING OLD AS oldRow
for each row
BEGIN
UPDATE ncache_db_sync
SET modified = 1
WHERE cache_key = (Cast(Select oldRow.ProductI D FROM deleted OLD) As VarChar) + ':dbo.Products'
END TRIGGER;
... -
Trigger Before Insert or Update
I've created an ASP gridview and made it editable. It displays the information that was entered into a SQL table plus a time stamp and the submitter's user ID.
In the event information is edited on a specific row, I need to overwrite the time stamp, and requestor on that row to show who edited the entry.
I've found this example of a trigger for oracle but don't know how to modify it to work with SQL.
... -
How to disable trigger as soon as it got triggered.
I want to disable a trigger as soon as it got triggered. But dont know how to do this.
Could anyone please help me?
Thanks,
sanjaya -
Now() as DateTime default value
Hi.
I know this has been posted here before, but I couldn't find any answers.
I'm just wondering if you good people know a way to use the Now() function as the default value of a DateTime field, or anything that would give the same result, without having to use external scripts like PHP or ASP.
I do not want to use TimeStamp. I know it would get me similar results as using DateTime but with annoying side effects,...