Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
@@IDENTITY not responding
Message
From
25/03/2004 16:15:42
 
 
To
25/03/2004 14:03:01
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00889556
Message ID:
00889785
Views:
16
>Hey Daniel,
>
>Actually, inserting and updating views for multiple tables via INSTEAD OF Triggers is one of the touted improvements in SQL 2K. See BOL Designing INSTEAD OF Triggers.
>

OK, my bad (and proving once again that I don't know it all...). Thanks for the reminder.

>For whatever reason, though, no matter what I try, I am unable to get the @@IDENTITY to respond inside the Trigger. The one small example that is in BOL uses a know value (SSN) as the PRIMARY KEY for the first table, and therefore has it's value to put as a link into the 2nd table.
>
>For security reasons (another touted reason for views), I do not want to have the tables written to directly. So far the only other method that I seem to be able to get to work is just using a stored proc to do the insert, and leave the view non-updateable.
>
>Thanks for your input.

In reading that section I get the impression that ID columns are basically off-limits. It may be that, internally, SQL wraps everything in a transaction. However, you COULD have the INSTEAD OF trigger call an SP to do the update.
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform