----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: VinodK [TLabs, SCT] Message 6 in Discussion Srini, Are you creating the Trigger coed from your middle tier ... Is that what you said ? You can write functions at the backend that can return you the trigger code also ... Like : SELECT 'CREATE TRIGGER trg_' + table_name + ' ON ' + table_name + ' ON INSERT' + CHAR(13) + 'AS' + CHAR(13) + 'IF @@ROWCOUNT = 0 RETURN' + CHAR(13) + 'GO' + CHAR(13) FROM information_schema.tables WHERE table_type = 'BASE TABLE' Now that does allow you with some flexibility ... Another suggestion if you are building the trigger code in the middle tier then you can make two hits to the DB. Once to get the PKID and bind the value with the code and then use the same ... And second hit to create the trigger ... Understand that a trigger is bound to a table and it is better to hardcode the same during creation rather than doing a generic approach for all the tables ... These are my views ... HTH, Vinod Kumar Microsoft India Community Star www.ExtremeExperts.com ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/BDotNet/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
