Viewing 15 posts - 1 through 15 (of 17 total)
I added a column that is set aside for a random number, the random number is generated in the trigger to all rows, which then triggers my calculation fire on...
March 23, 2015 at 8:56 am
If a trigger fires, it works assuming people enter the data each week in order ... if they go back and edit a previous week, it breaks the integrity for...
March 20, 2015 at 11:34 am
lag([Occupied Suites]) OVER (ORDER BY campus, building, week)
This is the part I ended up using ... the trigger then takes the value and adds it into the current...
March 16, 2015 at 11:04 am
Below is the source table, the view, and the trigger on the source table.
What I am finding out now (and someone mentioned before with caution :)) is that any retroactive...
March 16, 2015 at 6:22 am
I ended up creating a view using similar logic to MMartins1, then build a trigger on the main table to reference the view. It works nicely. 🙂
Thanks everyone for your...
March 13, 2015 at 10:21 am
Thanks MMartin1, I am trying to use your query in an editable view. The only draw back I saw to the query (which I think I can resolve) is the...
March 13, 2015 at 5:46 am
I keep getting a "Cannot create index on view "TABLE NAME" because it contains a ranking or aggregate window function. Remove the function from the view definition or, alternatively, do...
March 12, 2015 at 1:20 pm
Why? Just put it in a VIEW! Wink
The data is editable by the end-user - they can't directly edit a view can they? If yes, then my problem is solved.
March 12, 2015 at 7:41 am
Thanks Mark, do you know how I would use this as a trigger? The reason i need to use the trigger, is the lightswitch application is just reading the source...
March 12, 2015 at 7:40 am
Any thoughts? I feel like I am really close... 🙁
March 11, 2015 at 11:38 am
CREATE TABLE [dbo].[Census Tracker](
[Campus] [nvarchar](50) NOT NULL,
[Building] [nvarchar](50) NOT NULL,
[Week] [date] NOT NULL,
[Total Suites] [int] NULL,
[Rentable Suites] [int] NULL,
[Occupied Suites] [int] NULL,
[Resident Total] [int] NULL,
[Notes] [nvarchar](500) NULL
)
GO
INSERT INTO [Census Tracker]
VALUES...
March 10, 2015 at 8:14 am
I've made a bit more progress ...
USE [ERDB]
GO
/****** Object: Trigger [dbo].[trig_OccupiedSuites] Script Date: 3/10/2015 10:38:38 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[trig_OccupiedSuites] ON [dbo].[Census...
March 10, 2015 at 8:00 am
After reading some on the syntax and use, I came up with the following.
CREATE TRIGGER dbo.trig_OccupiedSuites
ON [dbo].[MyTable]
AFTER UPDATE
AS
BEGIN
-- Your SQL goes here
...
March 10, 2015 at 6:57 am
Do you have a sample you would be willing to share? (Stored proc working with csv?) I do SSIS CSV imports all the time!! I didn't know i could avoid...
March 9, 2015 at 1:02 pm
Thanks Sean,
That is where I am stumped - i have never created a trigger before. Might you be able to share a sample with the proper syntax? I wills still...
March 9, 2015 at 9:16 am
Viewing 15 posts - 1 through 15 (of 17 total)