Search Results

Search found 2670 results on 107 pages for 'trigger'.

Page 6/107 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • SQL Server 2008 Snapshot Replication Trigger Start

    - by Chris
    I have setup a production server and a staging server. Whenever we are at the point in our release cycle where we want to begin testing on staging I want to copy the production DB over to our staging server. I have setup snapshot replication to do this and have setup the staging server to have a pull subscription to the production DB. I want my continuous integration server to be able to kick off this process. How do I programmatically trigger a snapshot to be created and replicated? If there is a way to trigger this process is there a way to know when it's finished?

    Read the article

  • Property trigger in XAML for IsMouseOver fails to set Border.Background

    - by Mal Ross
    I'm currently trying to create a ControlTemplate for the Button class in WPF, replacing the usual visual tree with something that makes the button look similar to the little (X) close icon on Google Chrome's tabs. I decided to use a Path object in XAML to achieve the effect. Using a property trigger, the control responds to a change in the IsMouseOver property by setting the icon's red background. Here's the XAML from a test app: <Window x:Class="Widgets.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Window.Resources> <Style x:Key="borderStyle" TargetType="Border"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background"> <Setter.Value> <SolidColorBrush Color="#CC0000"/> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> <ControlTemplate x:Key="closeButtonTemplate" TargetType="Button"> <Border Width="12" Height="12" CornerRadius="6" BorderBrush="#AAAAAA" Background="Transparent" Style="{StaticResource borderStyle}" ToolTip="Close"> <Viewbox Margin="2.75"> <Path Data="M 0,0 L 10,10 M 0,10 L 10,0" Stroke="{Binding BorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType=Border, AncestorLevel=1}}" StrokeThickness="1.8"/> </Viewbox> </Border> </ControlTemplate> </Window.Resources> <Grid Background="White"> <Button Template="{StaticResource closeButtonTemplate}"/> </Grid> </Window> Note that the circular background is always there - it's just transparent when the mouse isn't over it. The problem with this is that the trigger just isn't working. Nothing changes in the button's appearance. However, if I remove the Background="Transparent" value from the Border object in the ControlTemplate, the trigger does work (albeit only when over the 'X'). I really can't explain this. Setters for any other properties placed in the borderStyle resource work fine, but the Background setter fails as soon as the default background is specified in the ControlTemplate. Any ideas why it's happening and how I can fix it? I know I could easily replace this code with, for example, a .PNG-based image, but I want to understand why the current implementation isn't working. Thanks! :)

    Read the article

  • 'ORA-01031: insufficient privileges' error received when inserting into a View

    - by Patrick K
    Under the user name 'MY_ADMIN', I have successfully created a table called 'NOTIFICATIONS' and a view called 'V_NOTIFICATIONS'. On the 'V_NOTIFICATIONS' view I have successfully created a trigger and a package that takes what the user attempts to insert into the view and inserts it into the table. The 'V_NOTIFICATIONS' trigger and package also perform the update and delete functions on the table when the user attempts to perform the update and delete functions on the view. I have done this with many views in the project I am currently working on, as many views sit over the top of many different tables, however when attempting to insert a record into this view I receive an 'ORA-01031: insufficient privileges' error. I am able to insert directly into the table using the same code that is in the package, but not into the view. Any help on this would be greatly appreciated.

    Read the article

  • How to configure Farsun USB barcode scanner to not auto-trigger

    - by David Grayson
    At my company we have several USB barcode scanners. I'm not sure exactly what model they are, but I think they are the FG9800 from Farsun because that's what they look like on the exterior. They came with a programming manual that is very similar to this document from the Farsun website. When I scan the "Output Firmware Version" barcode, my scanner types the following into the computer: Farsun V2.00 2011-01-01 Is it possible to configure these scanners so they only read barcodes in response to the trigger button being pressed? I don't want them to automatically read barcodes. Additionally, I want this setting to be remembered while the scanner is turned off. Since this scanner only has a USB port, the only way to configure it that I know of is to scan bar codes from the manual (or make your own). I have tried scanning the configuration bar codes for Single Scan (013300), Single Scan No Trigger (013301), and Laser/CCD Timeout - 5 Seconds (0134005) from this document. Sometimes (but not often) this puts the scanner in to the right mode, where it only scans when the button is pressed. Unfortunately, the scanner seems to always leave this mode when it is power cycled. I have also scanned the "Reset Configuration To Defaults" barcode (0B) many times. We have three different scanners like this and I have not been able to successfully configure any of them. If the things I want are not possible with these Farsun-based scanners, is there some other scanner we can use?

    Read the article

  • DataTable identity column not set after DataAdapter.Update/Refresh on table with "instead of"-trigge

    - by Arno
    Within our unit tests we use plain ADO.NET (DataTable, DataAdapter) for preparing the database resp. checking the results, while the tested components themselves run under NHibernate 2.1. .NET version is 3.5, SqlServer version is 2005. The database tables have identity columns as primary keys. Some tables apply instead-of-insert/update triggers (this is due to backward compatibility, nothing I can change). The triggers generally work like this: create trigger dbo.emp_insert on dbo.emp instead of insert as begin set nocount on insert into emp ... select @@identity end The insert statement issued by the ADO.NET DataAdapter (generated on-the-fly by a thin ADO.NET wrapper) tries to retrieve the identity value back into the DataRow: exec sp_executesql N' insert into emp (...) values (...); select id, ... from emp where id = @@identity ' But the DataRow's id-Column is still 0. When I remove the trigger temporarily, it works fine - the id-Column then holds the identity value set by the database. NHibernate on the other hand uses this kind of insert statement: exec sp_executesql N' insert into emp (...) values (...); select scope_identity() ' This works, the NHibernate POCO has its id property correctly set right after flushing. Which seems a little bit counter-intuitive to me, as I expected the trigger to run in a different scope, hence @@identity should be a better fit than scope_identity(). So I thought no problem, I will apply scope_identity() instead of @@identity under ADO.NET as well. But this has no effect, the DataRow value is still not updated accordingly. And now for the best part: When I copy and paste those two statements from SqlServer profiler into a Management Studio query (that is including "exec sp_executesql"), and run them there, the results seem to be inverse! There the ADO.NET version works, and the NHibernate version doesn't (select scope_identity() returns null). I tried several times to verify, but to no avail. Of course this just shows the resultset coming from the database, whatever happens inside NHibernate and ADO.NET is another topic. Also, several session properties defined by T-SQL SET are different in the two scenarios (Management Studio query vs. application at runtime) This is a real puzzle to me. I would be happy about any insights on that. Thank you!

    Read the article

  • Function call within XAML code?

    - by Matt H.
    I'd like to set a style on all my TextBox controls that does the following when it receives keyboard focus: 1) Change the background color 2) Call .SelectAll() to highlight all text I have this so far: <Style TargetType="TextBox"> <Style.Triggers> <Trigger Property="IsKeyboardFocusWithin" Value="True"> <Setter Property="Background"> <Setter.Value> <SolidColorBrush Color="#FFFFD1D9"/> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> Is there a way to also call .SelectAll() ? Thanks.

    Read the article

  • Who deleted my sql table rows?

    - by vikasde
    I have an SQL table, from which data is being deleted. Nobody knows how the data is being deleted. I added a trigger and know the time, however no jobs are running that would delete the data. I also added a trigger whenever rows are being deleted from this table. I am then inserting the deleted rows and the SYSTEM_USER to a log table, however that doesnt help much. Is there anything better I can do to know who and how the data gets deleted? Would it be possible to get the server id or something? Thanks for any advice. Sorry: I am using SQL Server 2000.

    Read the article

  • Windows OS level file open event trigger

    - by john
    Colleagues, I have need to run a script/program on certain basic OS level events. In particular when a file in Windows is opened. The open may be read-only or to edit, and may be initiated by a number of means, either from windows explorer (open or ), be selected from a viewing or editing application from the native file chooser, or drag-n-drop into an editing or viewing application. Further, i need the trigger to "hold" the event from completing the action until the runtime on the program has completed. The event handler program may return a pass state, or fail state. If fail state has been returned, then the event must disallow the initially requested action. Lastly, I need to add to the file in question a property or attribute that will contain metadata that will be used by the above event trigger handler program to make a determination as to the pass/fail condition that will ultimately determine if the user is permitted to open the file. Please note that this is NOT a windows event log situation, but one at the OS level file open event. thanks very much for your help. regards, j

    Read the article

  • Instead of trigger in SQL Server - looses SCOPE_IDENTITY?

    - by kastermester
    Hey StackOverflow, I am (once again) having some issues with some SQL. I have a table, on which I have created an INSTEAD OF trigger to enforce some buissness rules (rules not really important). This works as intended. My issue is, that now when inserting data into this table, SCOPE_IDENTITY() now returns a NULL value, rather than the actual inserted identity, my guess is that this is because it is now out of scope - but then how do I get this in scope? I am using SQL Server 2008. Per request, here's the SQL: Insert + Scope code INSERT INTO [dbo].[Payment]([DateFrom], [DateTo], [CustomerId], [AdminId]) VALUES ('2009-01-20', '2009-01-31', 6, 1) SELECT SCOPE_IDENTITY() Trigger: CREATE TRIGGER [dbo].[TR_Payments_Insert] ON [dbo].[Payment] INSTEAD OF INSERT AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; IF NOT EXISTS(SELECT 1 FROM dbo.Payment p INNER JOIN Inserted i ON p.CustomerId = i.CustomerId WHERE (i.DateFrom >= p.DateFrom AND i.DateFrom <= p.DateTo) OR (i.DateTo >= p.DateFrom AND i.DateTo <= p.DateTo) ) AND NOT EXISTS (SELECT 1 FROM Inserted p INNER JOIN Inserted i ON p.CustomerId = i.CustomerId WHERE (i.DateFrom <> p.DateFrom AND i.DateTo <> p.DateTo) AND ((i.DateFrom >= p.DateFrom AND i.DateFrom <= p.DateTo) OR (i.DateTo >= p.DateFrom AND i.DateTo <= p.DateTo)) ) BEGIN INSERT INTO dbo.Payment (DateFrom, DateTo, CustomerId, AdminId) SELECT DateFrom, DateTo, CustomerId, AdminId FROM Inserted END ELSE BEGIN ROLLBACK TRANSACTION END END The code did work before the creation of this trigger, also I am using LINQ to SQL in C# and as far as I can see, I have no way of changing SCOPE_IDENTITY to @@IDENITY - is there really no way out of this one?

    Read the article

  • AdornedElement Properties in a Trigger

    - by Chris Nicol
    I have an Adorner in XAML that I'm using for ErrorValidation. Basically I have a grid that I want to display on two conditions (if the "AdornedElement" IsFocused or IsMouseOver). Below is a code snippet where I'm binding - successfully - to the IsFocused of the AdornedElement, but as you can tell that only solves 1/2 the conditions. Now I can't pass another binding into the converter, nor can I create a property that handles both (needs to be XAML only solution). <AdornedElementPlaceholder x:Name="errorAdorner" /> ... <Grid x:Name="ErrorDetails" Visibility="{Binding ElementName=errorAdorner, Path=AdornedElement.IsFocused, Converter={StaticResource BooleanToVisibilityConverter}}" /> ... What I want to do is use triggers to handle this, the only problem is I can't access the AdornedElement's properties on a trigger. Something like this ... <Trigger SourceName="errorAdorner" Property="AdornedElement.IsFocused" Value="True"> <Setter TargetName="ErrorDetails" Property="Visibility" Value="Visible" /> </Trigger> This would also help as part of what I want to do is trigger animations, rather than just setting the visibility. Any help would be great.

    Read the article

  • jQuery .trigger() or $(window) not working in Google Chrome

    - by Jonathan
    I have this jQuery ajax navigation tabs plugin that I created using some help from CSS-Tricks.com and the jQuery hashchange event plugin (detects hash changes in browsers that don't support it). The code is little long to post it here but it goes something like this: Part 1) When a tab is clicked, it gets the href attribute of that tab and add it to the browsers navigation bar like '#tab_name': window.location.hash = $(this).attr("href"); Part 2) When the navigation bar changes (hash change), it gets the href change like this: window.location.hash.substring(1); (substring is to get only 'tab_name' without the '#'), and then call the ajax function to get the info to display. I want to automatically trigger the plugin to load the first tab when the page is accessed, so at the start of the code I put: if (window.location.hash === '') { // If no '#' is in the browser navigation bar window.location.hash = '#tab_1'; // Add #tab_1 to the navigation bar $(window).trigger('hashchange'); // Trigger a hashchange so 'Part 2' of the plugin calls the ajax function using the '#tab_1' added } The probles is that it works in FF but not in Chrome, I mean, everything works but it seems like the $(window).trigger('hashchange'); is not working because it doesnt get the first tab.. Any suggestions??

    Read the article

  • mysql and trigger usage question

    - by dhruvbird
    I have a situation in which I don't want inserts to take place (the transaction should rollback) if a certain condition is met. I could write this logic in the application code, but say for some reason, it has to be written in MySQL itself (say clients written in different languages will be inserting into this MySQL InnoDB table) [that's a separate discussion]. Table definition: CREATE TABLE table1(x int NOT NULL); The trigger looks something like this: CREATE TRIGGER t1 BEFORE INSERT ON table1 FOR EACH ROW IF (condition) THEN NEW.x = NULL; END IF; END; I am guessing it could also be written as(untested): CREATE TRIGGER t1 BEFORE INSERT ON table1 FOR EACH ROW IF (condition) THEN ROLLBACK; END IF; END; But, this doesn't work: CREATE TRIGGER t1 BEFORE INSERT ON table1 ROLLBACK; You are guaranteed that: Your DB will always be MySQL Table type will always be InnoDB That NOT NULL column will always stay the way it is Question: Do you see anything objectionable in the 1st method?

    Read the article

  • How to make quicksilver remember custom trigger

    - by corroded
    I am trying to make a custom trigger for my shell/apple script file to run so I can just launch my dev environment at the push of a button. So basically: I have a shell script(and some apple script included) in ~ named start_server.sh which does 3 things: start up solr server start up memcached start up script/server I have a saved quicksilver command(.qs) that opens up start_server.sh(so start_server.sh, then the action is "Run in Terminal") I created a custom trigger that calls this saved qs command. I did that then tested it and it works. I then tried to double check it so I quit quicksilver and when I checked the triggers it just said: "Open (null)" as the action. I set the trigger again and when i restarted QS the same thing happened again. I don't know why but my old custom trigger to open terminal has worked since forever so why doesn't this one work? Here's a screenie of the triggers after I restart QS: http://grab.by/4XWW If you have any other suggestion on how to make a "push button" start for my server then please do so :) Thanks! As an added note, I have already tried the steps on this thread but to no avail: http://groups.google.com/group/blacktree-quicksilver/browse_thread/thread/7b65ecf6625f8989

    Read the article

  • jQuery trigger mouseover function when page loads with the mouse over the element

    - by Gal V
    Hello all, I have an ASP.NET document, with an Image element within it. I created a mouseover function on this image element and it's working fine. The question is: If the mouse is ALREADY over the element when the document loads itself, the mouseover function doesn't trigger (I need to mouseout and then mouseover again in order to trigger it). Is there any way to check in the $(document).ready function if the mouse is already on top of this element? and if yes- trigger the mouseover function. Thanks all!

    Read the article

  • Data tweaking code runs fine when executed directly - but never stops when used in trigger

    - by MBaas
    I have written some code to ensure that items on an order are all numbered (the "position number" or "item number" has been introduced only recently and we did not want to go and change all related code - as it is "asthetics only" and has no functional impact.) So, the idea is to go and check for an records that jave an itemno of NULL or 0 - and then compute one and assign it. When executing this code in a query window, it works fine. When putting it into an AFTER INSERT-trigger, it loops forever. So what is wrong here? /****** Objekt: Trigger [SetzePosNr] Skriptdatum: 02/28/2010 20:06:29 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TRIGGER [SetzePosNr] ON [dbo].[bestellpos] AFTER INSERT AS BEGIN DECLARE @idb int DECLARE @idp int DECLARE @pnr int SELECT @idp=id,@idb=id_bestellungen FROM bestellpos WHERE posnr IS NULL OR posnr=0 WHILE @idp IS NOT NULL BEGIN SELECT @pnr = 1+max(posnr) FROM bestellpos WHERE id_bestellungen = @idb print( 'idp=' + str(@idp) + ', idb=' + str(@idb) + ', posnr=' + str(@pnr)) UPDATE bestellpos SET posnr=@pnr WHERE id=@idp SELECT @idp=id,@idb=id_bestellungen FROM bestellpos WHERE posnr IS NULL OR posnr=0 END END

    Read the article

  • NHibernate 'IdentifierGenerationException' on an Update trigger

    - by Jan Jongboom
    In my database I have an id column defined as [autonumber] [int] IDENTITY(1,1) NOT NULL which is mapped in my .hbm.xml like: <id name="Id" column="autonumber" type="int"> <generator class="identity" /> </id> When calling session.Save() updates are successful committed to the database. When adding a versioning trigger I however get the error this id generator generates Int64, Int32, Int16 of type IdentifierGenerationException. The trigger is defined as: ALTER TRIGGER [dbo].[CatchUpdates_NVM_FDK_Kenmerken] ON [dbo].[NVM_FDK_Kenmerken] INSTEAD OF UPDATE AS BEGIN SET NOCOUNT ON UPDATE NVM_FDK_Kenmerken SET idIsActive = 0 WHERE internalId IN (SELECT internalId FROM INSERTED) INSERT INTO dbo.NVM_FDK_Kenmerken ( vestigingNummer , internalId , someOtherColumns, dateInserted, idIsActive ) SELECT vestigingNummer, internalId, someOtherColumns, GETDATE(), 1 FROM INSERTED END What am I doing wrong here? When doing manual updates everything works just fine and as expected.

    Read the article

  • Trigger to update data in another DB

    - by Permana
    I have the following schema: Database: test. Table: per_login_user, Field: username (PK), password Database: wavinet. Table: login_user, Field: username (PK), password What I want to do is to create a trigger. Whenever a password field on table per_login_user in database test get updated, the same value will be copied to field password in Table login_wavinet in database wavinet I have search trough Google and find this solution: http://forums.devshed.com/ms-sql-development-95/use-trigger-to-update-data-in-another-db-149985.html But, when I run this query: CREATE TRIGGER trgPasswordUpdater ON dbo.per_login_user FOR UPDATE AS UPDATE wavinet.dbo.login_user SET password = I.password FROM inserted I INNER JOIN deleted D ON I.username = D.username WHERE wavinet.dbo.login_wavinet.password = D.password the query return error message: Msg 107, Level 16, State 3, Procedure trgPasswordUpdater, Line 4 The column prefix 'wavinet.dbo.login_wavinet' does not match with a table name or alias name used in the query.

    Read the article

  • Sql Trigger Trouble

    - by SImon
    Hey guys i cant get this trigger to work, ive worked on it for an hour or so and cant see to figure out where im going wrong, any help would be appreciated CREATE OR REPLACE TRIGGER allergy BEFORE INSERT ON DECLARE med VARCHAR2(20); BEGIN SELECT v.medication RCD.specify INTO med FROM visit v, relcondetails RCD WHERE :new.medication = v.medication AND RCD.specifiy = 'allergies'; IF med = allergies THEN RAISE_APPLICATION_ERROR(-20000, 'Patient Is alergic to this medication'); END IF; END allergy; When put into oracle ERROR at line 6: ORA-04079: invalid trigger specification

    Read the article

  • SQL Trigger dont works...

    - by Gabotron
    Is there a way in which a Trigger is not fired? We have this situation: We have a table and there are rows that are been deleted. We need to know who and/or when these row are deleted. We create this trigger: ALTER TRIGGER [dbo].[AUDITdel_nit] ON [dbo].[Client] FOR DELETE AS Insert into AUDIT select 'Delete', getdate(), 'Row Deleted', SYSTEM_USER, host_name(), (select 'ID Client: ' + convert(varchar(12),Id) from deleted), 'Client' ,APP_NAME() We made somte test: deleting rows vis stored procedures and the deleted rows appears in our AUDIT table. But suddenly today we found a row deleted that dont appears in the AUDIT table... Any idea how it can be done?

    Read the article

  • trigger OS to copy (ctrl+v or Ctrl-x) programicly

    - by Crash893
    I'm working on a program to trigger cut and pastes Pastes i have no problem with (i just dump a string into the clipboard) Cut and or Copys are proving to be a little more difficult The program i have is out of focus and has several hot keys registered with the os ( ctrl+alt+2 ctrl+alt+3 etc) that i want to use to trigger Windows to copy anything that is highlighted in the window that is focused I tried doing a sendkeys SendKeys.Send("^c"); but that seems to work once or twice if at all then stop working. is there a better way to try to trigger windows into coping highlighted content on a different window

    Read the article

  • T-SQL UPDATE trigger help

    - by Tan
    Hi iam trying to make an update trigger in my database. But i get this error every time the triggers trigs. Error MEssage: The row value(s) updated or deleted either do not make the row unique or they alter multiple rows(3rows) and heres my trigger ALTER TRIGGER [dbo].[x1pk_qp_update] ON [dbo].[x1pk] FOR UPDATE AS BEGIN TRY DECLARE @UserId int , @PackareKod int , @PersSign varchar(10) SELECT @PackareKod = q_packarekod , @PersSign = q_perssign FROM INSERTED IF @PersSign IS NOT NULL BEGIN IF EXISTS (SELECT * FROM [QPMardskog].[dbo].[UserAccount] WHERE [Account] = @PackareKod) BEGIN SET @UserId = (SELECT [UserId] FROM [QPMardskog].[dbo].[UserAccount] WHERE [Account] = @PackareKod) UPDATE [QPMardskog].[dbo].[UserAccount] SET [Active] = 1 WHERE [Account] = @PackareKod UPDATE [QPMardskog].[dbo].[User] SET [Active] = 1 WHERE [Id] = @UserId END END END TRY But i only update one row in the table how can it says 3 rows. Please advise.

    Read the article

  • Stored procedure and trigger

    - by noober
    Hello all, I had a task -- to create update trigger, that works on real table data change (not just update with the same values). For that purpose I had created copy table then began to compare updated rows with the old copied ones. When trigger completes, it's neccessary to actualize the copy: UPDATE CopyTable SET id = s.id, -- many, many fields FROM MainTable s WHERE s.id IN (SELECT [id] FROM INSERTED) AND CopyTable.id = s.id; I don't like to have this ugly code in trigger anymore, so I has extracted it to a stored procedure: CREATE PROCEDURE UpdateCopy AS BEGIN UPDATE CopyTable SET id = s.id, -- many, many fields FROM MainTable s WHERE s.id IN (SELECT [id] FROM INSERTED) AND CopyTable.id = s.id; END The result is -- Invalid object name 'INSERTED'. How can I workaround this? Regards,

    Read the article

  • trigger OS to copy (ctrl+c or Ctrl-x) programicly

    - by Crash893
    I'm working on a program to trigger cut and pastes Pastes i have no problem with (i just dump a string into the clipboard) Cut and or Copys are proving to be a little more difficult The program i have is out of focus and has several hot keys registered with the os ( ctrl+alt+2 ctrl+alt+3 etc) that i want to use to trigger Windows to copy anything that is highlighted in the window that is focused I tried doing a sendkeys SendKeys.Send("^c"); but that seems to work once or twice if at all then stop working. is there a better way to try to trigger windows into coping highlighted content on a different window

    Read the article

  • using NEWSEQUENTIALID() with UPDATE Trigger

    - by Ram
    I am adding a new GUID/Uniqueidentifier column to my table. ALTER TABLE table_name ADD VersionNumber UNIQUEIDENTIFIER UNIQUE NOT NULL DEFAULT NEWSEQUENTIALID() GO And when ever a record is updated in the table, I would want to update this column "VersionNumber". So I create a new trigger CREATE TRIGGER [DBO].[TR_TABLE_NAMWE] ON [DBO].[TABLE_NAME] AFTER UPDATE AS BEGIN UPDATE TABLE_NAME SET VERSIONNUMBER=NEWSEQUENTIALID() FROM TABLE_NAME D JOIN INSERTED I ON D.ID=I.ID/* some ID which is used to join*/ END GO But just realized that NEWSEQUENTIALID() can only be used with CREATE TABLE or ALTER TABLE. I got this error The newsequentialid() built-in function can only be used in a DEFAULT expression for a column of type 'uniqueidentifier' in a CREATE TABLE or ALTER TABLE statement. It cannot be combined with other operators to form a complex scalar expression. Is there a workaround for this ? Edit1: Changing NEWSEQUENTIALID() to NEWID() in the trigger solves this, but I am indexing this column and using NEWID() would be sub-optimal

    Read the article

  • Oracle - Trigger to check constraint before insert

    - by user1816507
    i would like to create a simple trigger to check a stored variable from a table. if the value of the variable is '1', then approve the insertion else if the value of the variable is '2', then prompt error message. CREATE OR REPLACE TRIGGER approval BEFORE INSERT ON VIP REFERENCING OLD AS MEMBER FOR EACH ROW DECLARE CONDITION_CHECK NUMBER; BEGIN SELECT CONDITION INTO CONDITION_CHECK FROM MEMBER; IF CONDITION_CHECK = '2' THEN RAISE_APPLICATION_ERROR (-20000, ' UPGRADE DENIED!'); END IF; END; But this trigger disable all the entries even when the condition value is '1'.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >