----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: VinodK [TLabs, SCT] Message 8 in Discussion Thats nice to hear .... So as per my suggestion above what you can do is to make a hit to the backend and see the primary key first using : exec sp_pkeys '<<TableName>>' Once this is done you can see if the table has more than one column ... That should settle the fact that you willnot create the trigger on first place for the table ... That sounds fine I suppose ... Next in case we get a record then all you need to do is to create a trigger from the middle tier by concatenating the actual value of the column name in the trigger definition itself. Lets assume that we take an example of "Authors" table in "Pubs" database ... Call of sp_pkeys gets you au_id as the Primary key ... Hence in the middle tier concatenate to get a string like "SELECT au_id FROM INSERTED " to access the primary key value in your trigger code rather than using a D-SQL ... This I hope is clear ... We are doing this because we cannot access the Inserted table context outside a trigger using D-SQL ... hence this workaround ... 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]
