Click here to Skip to main content
15,924,507 members
Home / Discussions / Database
   

Database

 
GeneralRe: stored procedure error Pin
Saira Tanwir7-Nov-06 0:05
Saira Tanwir7-Nov-06 0:05 
GeneralRe: stored procedure error Pin
Mairaaj Khan7-Nov-06 0:19
professionalMairaaj Khan7-Nov-06 0:19 
QuestionTrigger Problem Pin
monika_vasvani6-Nov-06 20:44
monika_vasvani6-Nov-06 20:44 
AnswerRe: Trigger Problem Pin
Coding C#7-Nov-06 0:24
Coding C#7-Nov-06 0:24 
AnswerRe: Trigger Problem Pin
vbkenya7-Nov-06 5:00
vbkenya7-Nov-06 5:00 
GeneralRe: Trigger Problem Pin
monika_vasvani7-Nov-06 16:47
monika_vasvani7-Nov-06 16:47 
GeneralRe: Trigger Problem Pin
Mairaaj Khan7-Nov-06 19:51
professionalMairaaj Khan7-Nov-06 19:51 
GeneralRe: Trigger Problem Pin
vbkenya8-Nov-06 0:31
vbkenya8-Nov-06 0:31 
The inserted table is a SQL Server in-memory structure only available within triggers fired during INSERT and UPDATE operations. The table has the same structure (columns) as the table that the trigger is defined on and contains as many rows as have been inserted or updated. The inserted table contains the values that are being inserted into the base table.

For example, you have Table1 with 2 columns; [col1] and [col2] and you have defined an insert trigger on Table1. When you try to insert a row into Table1 containing the values "A" for col1 and "B" for col2, the trigger fires. Within the context of the trigger, SQL Server provides you with a temporary in-memory structure called 'inserted' which contains 2 columns; col1 and col2 and this table has 1 row containing the values "A" and "B" respectively. You can query this table just like any other table using available T-SQL constructs e.g SELECT , JOIN , UNION etc.

So to put the new data into another table, just query the 'inserted' table and insert the results wherever you want.

Just for the sake of completion, SQL Server also offers you another table called 'deleted' available in triggers fired for DELETE and UPDATE operations. It can be used in the same manner as the 'inserted' table only that it contains the values that are being deleted/modified from the base table.

Nathan H. Omukwenyi

Questiondeclaration of variables Pin
Ravi Shankar436-Nov-06 19:56
Ravi Shankar436-Nov-06 19:56 
AnswerRe: declaration of variables Pin
coolestCoder6-Nov-06 20:28
coolestCoder6-Nov-06 20:28 
GeneralRe: declaration of variables Pin
Ravi Shankar436-Nov-06 20:52
Ravi Shankar436-Nov-06 20:52 
AnswerRe: declaration of variables Pin
Mairaaj Khan6-Nov-06 20:50
professionalMairaaj Khan6-Nov-06 20:50 
QuestionWhat is the Sql Query? Pin
kumar bharat bhusanam6-Nov-06 19:15
kumar bharat bhusanam6-Nov-06 19:15 
AnswerRe: What is the Sql Query? Pin
coolestCoder6-Nov-06 20:34
coolestCoder6-Nov-06 20:34 
GeneralRe: What is the Sql Query? Pin
PavanPareta10-Nov-06 2:24
PavanPareta10-Nov-06 2:24 
Questionplz solve this Pin
Ravi Shankar436-Nov-06 19:07
Ravi Shankar436-Nov-06 19:07 
AnswerRe: plz solve this Pin
coolestCoder6-Nov-06 19:47
coolestCoder6-Nov-06 19:47 
GeneralRe: plz solve this Pin
Ravi Shankar436-Nov-06 20:12
Ravi Shankar436-Nov-06 20:12 
Questionhow to access errors from sql server 2000 in vb.net Pin
king sunny6-Nov-06 18:31
king sunny6-Nov-06 18:31 
AnswerRe: how to access errors from sql server 2000 in vb.net Pin
coolestCoder6-Nov-06 19:51
coolestCoder6-Nov-06 19:51 
QuestionSQL appending result rows Pin
xoxoxoxoxoxox6-Nov-06 12:57
xoxoxoxoxoxox6-Nov-06 12:57 
AnswerRe: SQL appending result rows Pin
Stathread6-Nov-06 18:31
Stathread6-Nov-06 18:31 
GeneralRe: SQL appending result rows Pin
xoxoxoxoxoxox7-Nov-06 5:24
xoxoxoxoxoxox7-Nov-06 5:24 
QuestionReporting Services snapshots - multiple parameters Pin
mdipalma786-Nov-06 9:39
mdipalma786-Nov-06 9:39 
Questionquery Pin
Ravi Shankar435-Nov-06 20:10
Ravi Shankar435-Nov-06 20:10 

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.