Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
| Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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 November 18th, 2004, 06:38 PM
Authorized User
Points: 457, Level: 7
Points: 457, Level: 7 Points: 457, Level: 7 Points: 457, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: Burbank, CA, USA.
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Arsi
Default

Ok. I changed it to:

ALTER TRIGGER [Update_DB] ON [dbo].[ProjectInfo]
FOR INSERT, UPDATE
AS
If UPDATE(ProjectName)
IF EXISTS (SELECT * FROM INSERTED)
    UPDATE ProjectStatus..ProjectInfo2
    SET ProjectName = i.ProjectName
    FROM DELETED d, ProjectStatus..ProjectInfo2 t, INSERTED i
    WHERE d.ProjectName = t.ProjectName
ELSE
INSERT ProjectStatus..ProjectInfo2 (ProjectName)
VALUES (ProjectName)
RETURN

But its still not working. This is the error I am getting:
Server: Msg 128, Level 15, State 1, Procedure Update_DB, Line 13
The name 'ProjectName' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.

What can I do? The bolded part is the problem.

*******(*)*******




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find the last update time of a table dsekar_nat SQL Server 2000 4 July 27th, 2006 06:40 PM
why not UPDATE all instead of 10 at a time? gilgalbiblewheel Classic ASP Databases 0 April 21st, 2005 11:46 AM
UpDATE IN VB FROM TWO DATABASES akash VB How-To 5 April 20th, 2005 03:44 AM
Access Databases won't update through code wwwaynes Access ASP 2 October 3rd, 2004 03:33 PM
SQL2000 Date/Time field update Lucian Ion Dreamweaver (all versions) 9 January 2nd, 2004 09:14 PM





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