All Questions
121 questions
0
votes
1
answer
363
views
SQL Server insert trigger not firing using EF Core
I have this insert trigger which handles duplicate key insert attempts:
-- Create trigger to not throw in case of duplicate mapping attempt
CREATE TRIGGER dbo.BlockDuplicates_Product_Category_Mapping
...
1
vote
1
answer
218
views
Invalid object name 'inserted' inside trigger
I'm using EF Core and for payment table I define the following trigger that is valid, but when I am using my app, while inserting the new payment the context returns error on save:
Microsoft....
0
votes
1
answer
201
views
Automatically load newly inserted rows (SQL Server database) in ASP.NET webforms front-end?
I have a SQL Server database with one table and I am doing operations using Entity Framework 6 in C#.
I have a jQuery in my frontend which calls a method in the C# backend and loads the data from the ...
0
votes
1
answer
1k
views
How to catch SQL Server trigger in C# code
I have to create an external service for existing database which is working with ERP system.
Edit: service will be running on the same machine where SQL Server is running.
Service has to listen for a ...
0
votes
1
answer
507
views
primary key set by INSTEAD OF INSERT throwing error in entity framework (ASP.NET framework c#)
I'm just starting out with .NET and have been trying to perform CRUD operations on a table. The table has a trigger on it which sets the primary key. Now, the read, update and delete operations work ...
-2
votes
1
answer
247
views
Instead Of Insert trigger doesn't work for my insert via C# code
I have the following trigger:
CREATE TRIGGER insert_or_update_AccountNews
ON AccountNews
INSTEAD OF INSERT
AS
BEGIN
SET NOCOUNT ON;
DECLARE
@AccountNumber bigint,
@NewsId int,
...
0
votes
2
answers
397
views
Is there a way to trigger a stored procedure at the end of all the insert/delete on an entity
My application is using Entity frame work and There is one table called t_details which holds multiple records. When the application gets saved, this entity gets deleted and added.
I also have a sql ...
0
votes
2
answers
86
views
SQL Server trigger on insert
When I try to insert a new record into the table I created the trigger on it does not create.
This is after I activated the trigger. When I deactivate it then repeated the insert, it goes through. ...
1
vote
1
answer
3k
views
How to emulate a SQL trigger in Entity Framework Core (code first)?
Entity Framework does not support triggers. Is there something that reproduces their behavior?
I'm not interested in inserting SQL queries in my code.
I have this question because I have a case which ...
-2
votes
1
answer
288
views
How to trigger VBA code in Access when underlying SQL table is updated?
Background
We have a legacy MS Access application that uses MS SQL tables as the backend, and prints a report (product label) on demand based on a user action. This works as expected, and we'd prefer ...
0
votes
1
answer
2k
views
Delete Trigger for Audit Table SQL Server Database
I am using Mircosoft SSMS for my sql server and ASP.NET CORE for my website.
The query below is my Delete Trigger. However, whenever I try to delete something in my website, this error pops up: "...
1
vote
1
answer
78
views
Get back the record private key serial number of the table modified after calling Trigger?
On SQL Server, how can I get back the record private key serial number of the table changed after calling a Trigger?
If I make changes to a table (INSERT, UPDATE, DELETE), I would need the primary key ...
0
votes
0
answers
891
views
Reset the context in Entity Framework Core when using database triggers
I'm using Entity Framework Core database first (2.2.6). There is an instead of insert trigger attached to the Car table in the SQL Server database.
This trigger generates an Id based on some business ...
0
votes
1
answer
88
views
Insert data manually in a safe way?
I have a trigger which needs to fill a table with hundreds of rows, I need to type every single insert manually (it is a kind of pre-config table).
This table has an Int FK to an Enum Table. The Enum ...
2
votes
1
answer
708
views
Why does my SQL Server trigger write two records with the same time stamp from different transactions?
I have a SQL Server table with an integer Status column. My code updates the Status of a record and then, milliseconds later, updates it again to a different value.
This table has a trigger which ...