Wrox Programmer Forums
SQL Server 2008 General discussion of SQL Server *2008* version only - not related to a specific book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2008 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 18th, 2012, 05:45 AM
Registered User
Join Date: May 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

T-SQL script for this: QuantityinHand should be grater than 0. The record. Should not be inserted or modified manually if QuantityinHand is 0. I need help on the above questions. Please

Last edited by Adewale; May 18th, 2012 at 05:48 AM.. Reason: To add more word
Old May 20th, 2012, 09:43 AM
Friend of Wrox
Join Date: Nov 2009
Posts: 156
Thanks: 13
Thanked 16 Times in 16 Posts
Smile use TRIGGER

create trigger forinsertrig1
on table1
for insert, Update
if INSERTED.QuantityinHand = 0
rollback transaction
happy every time, happy every where

Reza Baiat

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with SQL Statement forumsUID SQL Server 2000 1 August 23rd, 2007 08:08 AM
convert a SQL Statement from MS Access to a SQL Corey Access 6 March 28th, 2007 12:33 PM
SQL Statement??? carswelljr SQL Server 2000 2 August 25th, 2006 12:40 PM
SQL Statement SAMBUSA SQL Language 2 December 1st, 2004 11:10 AM
Help with SQL statement acdsky SQL Language 3 June 18th, 2004 04:53 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.