Click here to Skip to main content
15,899,124 members
Home / Discussions / Database
   

Database

 
GeneralRe: Reporting Services - PLEASE HELP! Pin
VK-Cadec28-Jul-06 8:14
VK-Cadec28-Jul-06 8:14 
GeneralRe: Reporting Services - PLEASE HELP! Pin
ToddHileHoffer28-Jul-06 8:18
ToddHileHoffer28-Jul-06 8:18 
GeneralRe: Reporting Services - PLEASE HELP! Pin
VK-Cadec28-Jul-06 8:27
VK-Cadec28-Jul-06 8:27 
GeneralRe: Reporting Services - PLEASE HELP! Pin
ToddHileHoffer28-Jul-06 8:48
ToddHileHoffer28-Jul-06 8:48 
QuestionAccess denied - urgent Pin
dansoft28-Jul-06 6:58
dansoft28-Jul-06 6:58 
AnswerRe: Access denied - urgent Pin
VK-Cadec28-Jul-06 7:35
VK-Cadec28-Jul-06 7:35 
AnswerRe: Access denied - urgent [modified] Pin
S Douglas29-Jul-06 20:04
professionalS Douglas29-Jul-06 20:04 
QuestionReferential Integrity Question [modified] Pin
xfitr228-Jul-06 6:27
xfitr228-Jul-06 6:27 
DB: SQL Server 2005

I am trying to figure out how to check that a value exist before inserting/updating a record in a new table. Simplified Example below:

Product
Product_ID (int)
Product_Name (varchar(25))

Inventory
Inventory_ID (varchar(50))
Inventory_Product_ID (int)
Inventory_PO_Item_ID (int)
Inventory_Status (tinyint)

I need to make sure that the Inventory.Inventory_Product_ID exists in the Product.Product_ID table before the record in the Inventory table is inserted/updated. I could create a stored procedure to do this, but the problem still exist that a record could accidentally be manually added to the table without cheking first. (Plus, I would like to throw an error in the stored procedure if the Inventory_Product_ID does not exist in the Products table.) I read that you can not use Select statements in contraints or rules. Would this be an example of using a trigger. If so, I am not too familiar with triggers and would appreciate some guidance with this problem. Thank you in advance.
AnswerRe: Referential Integrity Question Pin
ToddHileHoffer28-Jul-06 6:57
ToddHileHoffer28-Jul-06 6:57 
QuestionSQL Server Connection Pin
smarttom9928-Jul-06 5:31
smarttom9928-Jul-06 5:31 
AnswerRe: SQL Server Connection Pin
ToddHileHoffer28-Jul-06 7:00
ToddHileHoffer28-Jul-06 7:00 
QuestionCombining results of two queries Pin
coolestCoder28-Jul-06 4:19
coolestCoder28-Jul-06 4:19 
AnswerRe: Combining results of two queries Pin
ToddHileHoffer28-Jul-06 5:35
ToddHileHoffer28-Jul-06 5:35 
QuestionDatasets + Update Issue [modified] Pin
Tristan Rhodes28-Jul-06 4:07
Tristan Rhodes28-Jul-06 4:07 
AnswerConfirmed Pin
Tristan Rhodes31-Jul-06 0:37
Tristan Rhodes31-Jul-06 0:37 
Questionproblem with update Pin
Jeeva Mary Varghese28-Jul-06 2:13
Jeeva Mary Varghese28-Jul-06 2:13 
AnswerRe: problem with update Pin
Eric Dahlvang28-Jul-06 4:24
Eric Dahlvang28-Jul-06 4:24 
GeneralRe: problem with update [modified] Pin
Jeeva Mary Varghese28-Jul-06 20:02
Jeeva Mary Varghese28-Jul-06 20:02 
GeneralRe: problem with update Pin
Eric Dahlvang31-Jul-06 3:32
Eric Dahlvang31-Jul-06 3:32 
QuestionFirebirdSql.Data.Firebird.FbException ? Pin
nick_net128-Jul-06 1:10
nick_net128-Jul-06 1:10 
QuestionRegarding retrieve the data from two different tables Pin
ChennaiBabu28-Jul-06 1:07
ChennaiBabu28-Jul-06 1:07 
AnswerRe: Regarding retrieve the data from two different tables Pin
Mairaaj Khan28-Jul-06 2:19
professionalMairaaj Khan28-Jul-06 2:19 
AnswerRe: Regarding retrieve the data from two different tables Pin
enjoycrack29-Jul-06 6:22
enjoycrack29-Jul-06 6:22 
Question[Message Deleted] Pin
very_short_life27-Jul-06 23:17
very_short_life27-Jul-06 23:17 
AnswerRe: pleeeeeeeeeeeeeeeeeeeese help Pin
jebberwocky27-Jul-06 23:41
jebberwocky27-Jul-06 23:41 

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.