Viewing 15 posts - 1 through 15 (of 345 total)
Change "<source_db>.dbo.tbl_Users" to "inserted" in the from clause and that should get what you want.
April 1, 2015 at 8:30 am
dkrasnikov (2/28/2013)
Re: #10Even with Technet article to "prove" it, you cannot use HAVING without GROUP BY clause.
Sure you can, if you do it correctly:
select count(AddressID)
from Address
having count(AddressID) > 1
February 28, 2013 at 1:08 pm
Issue a ROLLBACK in the trigger after the CATCH and before the INSERT.
February 18, 2013 at 12:51 pm
As a quick and dirty, I would do this:
with counts as (
select * from
(select count (*) as Col1 from sys.columns where (column_id = 1)) x
cross apply
(Select Count (*) as...
February 18, 2013 at 6:54 am
Mark-545947 (2/14/2013)
toddasd (2/14/2013)
So the trigger itself runs correctly from both sources. And there are no triggers on the tables BACK or BACK_RLFL. The only part left is the guts of...
February 14, 2013 at 2:34 pm
Mark-545947 (2/14/2013)
Both SSMS and SSIS reported 1 record which is the correct result.What's next?
So the trigger itself runs correctly from both sources. And there are no triggers on the tables...
February 14, 2013 at 1:33 pm
Mark-545947 (2/14/2013)
No triggers anywhere else.It has to be some setting issue in SSIS otherwise, why would work from SSMS.
This is driving me crazy.
Take the BACK tables out of the equation....
February 14, 2013 at 1:06 pm
Mark-545947 (2/14/2013)
Here is...
February 14, 2013 at 12:59 pm
This makes more sense:
CREATE TRIGGER [dbo].[ArchiveBACK] ON [dbo].[RLFL]
AFTER INSERT
AS
SET NOCOUNT ON;
INSERT INTO BACK_RLFL
SELECT b.*
FROM BACK b
WHERE b.OrderID in (select i.OrderID from inserted i)
GO
February 14, 2013 at 12:28 pm
Mark-545947 (2/14/2013)
Sure it does for the situation of archiving what is not already there, but now you've introduced a new table, BACK_ARCHIVE. So I see four tables: BACK, RLFL, RLFL_BACK,...
February 14, 2013 at 12:22 pm
Mark-545947 (2/14/2013)
That does not work.
Sure it does for the situation of archiving what is not already there, but now you've introduced a new table, BACK_ARCHIVE. So I see four tables:...
February 14, 2013 at 10:45 am
I was playing around with this, and came up with this as a pretty simple approach:
ALTER TRIGGER [dbo].[ArchiveBACK] ON [dbo].[RLFL]
AFTER INSERT
AS
SET NOCOUNT ON;
INSERT INTO BACK_RLFL
SELECT * FROM INSERTED ...
February 13, 2013 at 1:51 pm
Use cross apply, like so
select * from
(select count (*) as Col1 from sys.columns where (column_id = 1)) x
cross apply
(Select Count (*) as Col2 from sys.columns where (column_id = 2))...
February 13, 2013 at 12:52 pm
Sure, I'll help out.
First, there is no need to capitalize random words in sentences. I can't tell if it is for emphasis or not, but either way, it's not...
February 13, 2013 at 8:21 am
Just initialize the string with that query, like so:
Declare @loopYrbeg int
Declare @loopYrend int
Declare @tablename sysname
Declare @sql varchar(MAX)
Set @loopYrbeg = 2007
Set @sql = 'select * from tableCurrent...
January 25, 2013 at 8:52 am
Viewing 15 posts - 1 through 15 (of 345 total)