Click here to Skip to main content
13,198,325 members (86,285 online)
   

Database

 
AnswerRe: xBase question Pin
Kevin Marois15-May-12 6:35
memberKevin Marois15-May-12 6:35 
QuestionRe: xBase question Pin
DavidCrow15-May-12 6:55
memberDavidCrow15-May-12 6:55 
AnswerRe: xBase question Pin
Kevin Marois15-May-12 7:01
memberKevin Marois15-May-12 7:01 
GeneralRe: xBase question Pin
DavidCrow15-May-12 7:30
memberDavidCrow15-May-12 7:30 
GeneralRe: xBase question Pin
Kevin Marois15-May-12 7:31
memberKevin Marois15-May-12 7:31 
GeneralRe: xBase question Pin
DavidCrow15-May-12 7:37
memberDavidCrow15-May-12 7:37 
GeneralRe: xBase question Pin
Kevin Marois15-May-12 7:44
memberKevin Marois15-May-12 7:44 
QuestionOracle: Replace single occurrence of a character Pin
Lash2014-May-12 8:21
memberLash2014-May-12 8:21 
AnswerRe: Oracle: Replace single occurrence of a character Pin
rana ray15-May-12 0:56
memberrana ray15-May-12 0:56 
GeneralLinq to Sql Pin
sindhuan14-May-12 1:10
membersindhuan14-May-12 1:10 
GeneralRe: Linq to Sql Pin
Kevin Marois14-May-12 11:45
memberKevin Marois14-May-12 11:45 
QuestionDoubt in a piece of code [Transact-SQL database audit]. Pin
vValkir13-May-12 21:54
membervValkir13-May-12 21:54 
AnswerRe: Doubt in a piece of code [Transact-SQL database audit]. Pin
Mycroft Holmes13-May-12 22:36
memberMycroft Holmes13-May-12 22:36 
GeneralRe: Doubt in a piece of code [Transact-SQL database audit]. Pin
vValkir13-May-12 22:54
membervValkir13-May-12 22:54 
The code preceding the lines I pasted above are the following:

CREATE TRIGGER tr_trigtest ON trigtest FOR INSERT, UPDATE, DELETE
AS
 
DECLARE @bit INT ,
       @field INT ,
       @maxfield INT ,
       @char INT ,
       @fieldname VARCHAR(128) ,
       @TableName VARCHAR(128) ,
       @PKCols VARCHAR(1000) ,
       @sql VARCHAR(2000), 
       @UpdateDate VARCHAR(21) ,
       @UserName VARCHAR(128) ,
       @Type CHAR(1) ,
       @PKSelect VARCHAR(1000)
       
 
--You will need to change @TableName to match the table to be audited
SELECT @TableName = 'trigtest'
 
-- date and user
SELECT         @UserName = SYSTEM_USER ,
       @UpdateDate = CONVERT(VARCHAR(8), GETDATE(), 112) 
               + ' ' + CONVERT(VARCHAR(12), GETDATE(), 114)
 
-- Action
IF EXISTS (SELECT * FROM inserted)
       IF EXISTS (SELECT * FROM deleted)
               SELECT @Type = 'U'
       ELSE
               SELECT @Type = 'I'
ELSE
       SELECT @Type = 'D'
 
-- get list of columns
SELECT * INTO #ins FROM inserted
SELECT * INTO #del FROM deleted
 
-- Get primary key columns for full outer join
SELECT @PKCols = COALESCE(@PKCols + ' and', ' on') 
               + ' i.' + c.COLUMN_NAME + ' = d.' + c.COLUMN_NAME
       FROM    INFORMATION_SCHEMA.TABLE_CONSTRAINTS pk ,
 
              INFORMATION_SCHEMA.KEY_COLUMN_USAGE c
       WHERE   pk.TABLE_NAME = @TableName
       AND     CONSTRAINT_TYPE = 'PRIMARY KEY'
       AND     c.TABLE_NAME = pk.TABLE_NAME
       AND     c.CONSTRAINT_NAME = pk.CONSTRAINT_NAME


So, there are no mentions about 'd.' or 'i.'. Are "d" and "i" alias for these tables by default?
AnswerRe: Doubt in a piece of code [Transact-SQL database audit]. Pin
djj5514-May-12 4:08
memberdjj5514-May-12 4:08 
QuestionOracle Question: Split String into two Pin
Lash2011-May-12 5:57
memberLash2011-May-12 5:57 
AnswerRe: Oracle Question: Split String into two Pin
Jörgen Andersson11-May-12 9:08
memberJörgen Andersson11-May-12 9:08 
AnswerRe: Oracle Question: Split String into two Pin
Lash2011-May-12 9:33
memberLash2011-May-12 9:33 
GeneralRe: Oracle Question: Split String into two Pin
Jörgen Andersson11-May-12 9:47
memberJörgen Andersson11-May-12 9:47 
Questiontimestamp Pin
vijaylumar11-May-12 1:39
membervijaylumar11-May-12 1:39 
AnswerRe: timestamp Pin
Eddy Vluggen11-May-12 1:42
memberEddy Vluggen11-May-12 1:42 
QuestionWhat is database SQL query to display the name of the table only in to datagrid? Pin
LAPEC10-May-12 1:04
memberLAPEC10-May-12 1:04 
AnswerRe: What is database SQL query to display the name of the table only in to datagrid? Pin
PIEBALDconsult10-May-12 3:16
memberPIEBALDconsult10-May-12 3:16 
AnswerRe: What is database SQL query to display the name of the table only in to datagrid? Pin
vvashishta10-May-12 4:17
membervvashishta10-May-12 4:17 
GeneralRe: What is database SQL query to display the name of the table only in to datagrid? Pin
Eddy Vluggen10-May-12 7:05
memberEddy Vluggen10-May-12 7:05 
Questionchoosing a database Pin
davood_b8-May-12 1:19
memberdavood_b8-May-12 1:19 
AnswerRe: choosing a database Pin
PIEBALDconsult8-May-12 3:16
memberPIEBALDconsult8-May-12 3:16 
QuestionRe: choosing a database Pin
Eddy Vluggen8-May-12 5:05
memberEddy Vluggen8-May-12 5:05 
GeneralRe: choosing a database Pin
PIEBALDconsult8-May-12 18:42
memberPIEBALDconsult8-May-12 18:42 
AnswerRe: choosing a database Pin
Eddy Vluggen8-May-12 5:08
memberEddy Vluggen8-May-12 5:08 
Questionusing xquery to populate a table variable in sql Pin
swjam6-May-12 4:34
memberswjam6-May-12 4:34 
QuestionRead LFD(log ) file SQLserver 2008 Pin
jojoba20114-May-12 17:38
memberjojoba20114-May-12 17:38 
AnswerRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen4-May-12 23:11
memberEddy Vluggen4-May-12 23:11 
QuestionRe: Read LFD(log ) file SQLserver 2008 Pin
jojoba20114-May-12 23:19
memberjojoba20114-May-12 23:19 
AnswerRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen4-May-12 23:31
memberEddy Vluggen4-May-12 23:31 
GeneralRe: Read LFD(log ) file SQLserver 2008 Pin
jojoba20115-May-12 20:31
memberjojoba20115-May-12 20:31 
GeneralRe: Read LFD(log ) file SQLserver 2008 Pin
Mycroft Holmes5-May-12 23:00
memberMycroft Holmes5-May-12 23:00 
JokeRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen6-May-12 6:08
memberEddy Vluggen6-May-12 6:08 
AnswerRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen6-May-12 0:37
memberEddy Vluggen6-May-12 0:37 
GeneralRe: Read LFD(log ) file SQLserver 2008 Pin
jojoba20116-May-12 23:30
memberjojoba20116-May-12 23:30 
AnswerRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen7-May-12 0:30
memberEddy Vluggen7-May-12 0:30 
GeneralRe: Read LFD(log ) file SQLserver 2008 Pin
jojoba20117-May-12 17:37
memberjojoba20117-May-12 17:37 
GeneralRe: Read LFD(log ) file SQLserver 2008 Pin
JohnPayton7-May-12 18:10
memberJohnPayton7-May-12 18:10 
GeneralRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen8-May-12 0:17
memberEddy Vluggen8-May-12 0:17 
QuestionRe: Read LFD(log ) file SQLserver 2008 Pin
jojoba20119-May-12 17:52
memberjojoba20119-May-12 17:52 
AnswerRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen10-May-12 0:07
memberEddy Vluggen10-May-12 0:07 
QuestionRe: Read LFD(log ) file SQLserver 2008 Pin
jojoba201111-May-12 17:28
memberjojoba201111-May-12 17:28 
AnswerRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen12-May-12 0:45
memberEddy Vluggen12-May-12 0:45 
QuestionRe: Read LFD(log ) file SQLserver 2008 Pin
jojoba201112-May-12 22:31
memberjojoba201112-May-12 22:31 
AnswerRe: Read LFD(log ) file SQLserver 2008 Pin
Eddy Vluggen13-May-12 4:08
memberEddy Vluggen13-May-12 4:08 

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.


Advertise | Privacy |
Web01 | 2.8.171020.1 | Last Updated 20 Oct 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid