15,886,873 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 11265547 (Top 11 by date)
Member 11265547
9-Feb-15 4:45am
View
finally found out how to do it, yes there was a trigger (sorry wasn't aware there was one) so I added the update to the trigger and it works great now.
Thanks everyone for your help.
and sorry I'm fairly new to SQL but its part of my job now so I appreciate the help.
Member 11265547
9-Feb-15 3:08am
View
The reason I need to change the code before I delete it is because it is causing problems with some software that imports into the database. it is importing the data into the deleted products when there is a duplicate product code instead of the non deleted products.
Member 11265547
6-Feb-15 11:23am
View
this does work but I need it to do both things
Member 11265547
6-Feb-15 10:11am
View
Ok so I tried changing the error message to see if it shows up when i try to delete a product with stock and it did so this is the right procedure!
so maybe i'm putting the code into the wrong part of the code where should I insert (UPDATE Product SET ProductCode = 'D_' + ProductCode WHERE ProductID = @ProductID) in to the procedure
Member 11265547
6-Feb-15 10:02am
View
so 'DELETE FROM Product WHERE ProductID = @ProductID' would delete the product from the table completely?
I thought there was another procedure that handles what happens when a product is deleted but I've not found any yet still looking though, there's 716 to look through, loosing the will!
Member 11265547
6-Feb-15 9:49am
View
I know the UPDATE works because I have used the same thing to change a batch of products
Member 11265547
6-Feb-15 9:41am
View
I know its not working because when I search through the deleted products and the product code does not have the 'D_' prefix.
Member 11265547
6-Feb-15 9:39am
View
yes
Member 11265547
6-Feb-15 9:25am
View
You may just have made me realized I've done something stupid, It looks like there may be a second procedure for deleting products because this one like you say does not update the 'delete' field.
I'm looking for another one now!
Member 11265547
6-Feb-15 9:21am
View
yes it is a string
Member 11265547
6-Feb-15 9:09am
View
sorry, the update doesn't happen but no error is thrown up!
thanks
Show More