Extending events with webapps; unable to target referenced webapp

We've a client that makes heavy use of classifications, events (bookings) and webapps. We need to be able to select the next event in one of several classifications, and render out some of the fields from the individual webapp item that is referenced in the booking body. When /Layouts/Booking/list.html contains {tag_body}, the webapp item data is accessible through Liquid:
{module_webapps id="24501" filter="all" collection="allCompanyEventExtenders" template=""}
{module_booking filter="classified" itemid="14606" collection="companyEventsTypeA" template=""}
{module_booking filter="classified" itemid="14609" collection="companyEventsTypeB" template=""}
{module_booking filter="classified" itemid="14610" collection="companyEventsTypeC" template=""}
{% assign nextTypeACompanyEvent = companyEventsTypeA.items[0] %}
{% assign nextTypeBCompanyEvent = companyEventsTypeB.items[0] %}
{% assign nextTypeCCompanyEvent = companyEventsTypeC.items[0] %}
<div>nextTypeACompanyEvent:</div>
<pre><code>{{ nextTypeACompanyEvent | json }}</code></pre>
<div>nextTypeBCompanyEvent:</div>
<pre><code>{{ nextTypeBCompanyEvent | json }}</code></pre>
<div>nextTypeCCompanyEvent:</div>
<pre><code>{{ nextTypeCCompanyEvent | json }}</code></pre>
<div><code>this</code>:</div>
<pre><code>{{ this | json }}</code></pre>
The problem is that the key for the inner webapp item varies based on the number of events in each collection. E.g., the first 'Type A' booking's webapp data is accessible at {{ companyEventsTypeA.items[0]["webapps_0"].items[0] }}, but the key for first 'Type B' event could be {{ companyEventsTypeB.items[0]["webapps_42"].items[0] }}, if there were 42 two other items classified under Type A. This makes the key name unpredictable - we cannot get the webapp data within an arbitrary booking.
Q1: Is there any clean way around this?
Q2: Why suffix the key name instead of using arrays? Surely {{ companyEventsTypeB.items[0].webapps[0].items[0] }} would make more sense...
I have a reduced test-case here.
Please note that the use of javascript is verboten; this must work in a recurring email campaign.
We cannot specify a custom template on the individual webapp item tag in the event's body; it's already being used by the web version. The web version is not compatible with the email layout we need.
Also, this "webapps-in-bookings" approach has been in use for quite some time for this client.

Hi Robert,
Please check this how to where a similar problem was handled through some custom logic,
http://docs.businesscatalyst.com/developers#!/how-tos/liquid/e-commerce-related!dID4
In essence, you will need to loop through all the properties and check the names of the key for some common string, which in your case could be 'webapps_'
Regards,
Abhishek Maurya

Similar Messages

  • Request of one report fails with error: unable to extend tablespace

    Hi All,
    When I submit one request of report, the request end up with error:
    unable to extend temp segment by 128 in tablespace XXXX
    The request costs too much tablespace in short time, but the temp is about 20 G large.
    The sever have been add storage recently, but I don't know whether it is related to the performance issue, because the request had not such issue.
    How do I deal with it ?
    Thanks,
    Xinya

    What report is it ?
    Did you try and search metalink ?
    How to handle 'ORA-01652: unable to extend the temp segment by 128 in tablespace' error messages? (Doc ID 1359238.1)
    R12 Journal Entries Report (XLAJELINESRPT) Has Performance Issue Or Fails With Error: "java.sql.SQLException: ORA-01652: unable to extend temp segment by 128 in tablespace TEMP1" (Doc ID 1141673.1)
    This forum may be the right one for your question - General EBS Discussion

  • Extending EventDispatcher with dynamic event types

    I'm currently trying to write my own class to extend the
    EventDispatcher class. My goal is to create a Service class which
    acts as a switchboard for incoming socket data. Incoming socket
    data is parsed to create an Event which is Dispatched to the
    appropriate Service object which dispatches the event to any
    registered listeners.
    The problem I'm having is that I'm confused about how to
    handle the event types -- the string parameter which is always
    supplied as the first argument to the addEventListener() function.
    In all the examples I've seen, the value supplied is a class
    constant like MouseEvent.CLICK or VideoEvent.READY. In the case of
    my application, I want the developer to define their own Event
    types without having to go and edit my class files. In other words,
    I'd like to use dynamic event types with my class--maybe something
    like the code I've attached.
    I'm not new to Actionscript but am very new to the
    EventDispatcher class. I'm wondering a bit what that first
    parameter really does in a strict programming sense -- i haven't
    seen it explained all that well in the piles of documentation I've
    read on the Adobe site so I don't really know if I need to define
    my own Event class or what and whether I have to define all those
    possible event type constants/strings in advance or what.
    Any help/advice would be much appreciated.

    I have looked it up here:
    Actionscript
    3.0 Language Reference
    and it just says that the first arg to 'addEventListener' is
    "The type of event" with no further explanation at all.
    I have read this:
    Flash
    Quick Starts: Programming With Actionscript 3.0: Event handling
    It doesn't help much either. It tells me I need the
    appropriate event object which makes me wonder DO I NEED MY OWN
    CLASS? For that first ard to addEventListener, it merely says
    "Substitute the appropriate constant". Given that I want to use
    dynamic types (i think so anyway) that is not helpful information
    either. Every single example on that page uses a class constant for
    event type.
    It links to
    this
    which says "First, the name of the specific event you want to
    respond to. Once again, each event is affiliated with a specific
    class, and that class will have a special value predefined for each
    event--sort of like the event's own unique name, which you should
    use for the first parameter." Still no useful detail about what
    that arg does and the insistence on constants.
    The quick start page also has a link title "Handling Events"
    in Programming ActionScript 3.0 but it links to some documentation
    titled "Working with XML". The only discussion of events in that 10
    or so pages is because some user posted a comment.
    I have read this
    entire
    article which is more helpful than anything in the flash docs
    but still doesn't answer all my questions which (AGAIN) are:
    1) What is the real function of the first argument to
    addEventListener? I have not seen a clear explanation anywhere.
    2) Do I need to write my own Event class?
    3) What about dynamic event types that are defined at
    runtime? Are there any pitfalls or risks that arise from using a
    string instead of a predefined constant as the first param to
    addEventListener() ?
    Please stop telling me to read the documentation. I've been
    reading it for days.

  • Obtaining target database via extended events

    I try to gather the database access via extended events.
    It is possible to query a database from a different context and most extended events I see return the context rather then the target database.
    For instance, using the event sp_statement_starting would return master as action databaseid for the following:
    use master
    select * from targetdb.dbo.mytable
    What would be a event candidate or action to obtain the target database, targetdb in this case, instead?
    For trace, the event 114, Audit Schema Object Access Event would do the job but it does not seem to exists in extended events.
    Note: this is sql server 2008 R2 standard so no audit and limitted extended events available.
    Thanks

    Hello Antoine
    always when trying to find out database access I advise using the most basic event that always has to occur for any database access which also cannot be circumvented: lock_aquired, specifically Shared Lock on Database level should help you
    Andreas Wolter (Blog |
    Twitter)
    MCSM: Microsoft Certified Solutions Master Data Platform, MCM, MVP
    www.SarpedonQualityLab.com |
    www.SQL-Server-Master-Class.com

  • Unable to edit "calendar" field of events with invitees

    I am having a couple problems with the "calendar" drop-down field on calendar events.
    This is on a 4S, iOS5, syncing calendars with iCloud.
    If I create an event with an "invitee" (or add an invitee to an existing event), I can no longer change the "calendar" field of that event.  In fact, the "calendar" drop-down doesn't even appear on the iPhone calendar app's "Edit" dialog for events that have an invitee.  I can still change it via the web interface at www.icloud.com, and the change is even pushed to the iPhone.  But on the iPhone itself, I cannot find a way to change the "calendar" field on an event that contains one or more "invitees".
    Second, if I receive an "invitation" from someone else, I cannot find a way specify which of my calendars I want the event on when accepting it.  I would expect it to go to the calendar I have defined as "default" in Settings, but it seems instead to go to the last calendar I created.  And after accepting it, I cannot change it because the "Edit" dialog doesn't display the "calendar" field, as mentioned above.  Again, I can change it via the web interface at www.icloud.com, but cannot find a way to change it directly on the iPhone.
    Am I missing some way to edit/change the "calendar" field of an event with invitees?  Or to select which calendar I want events to be on when I "accept" invitations from others?

    I have the same problem.  I recently updated to iOS5 and set up syncing through iCloud. 
    I was able to add one event into my iphone calendar app, but for the next event that I tried to add, there was no longer the option to choose a calendar and when I tried to add it by tapping "Done," an error message came up: "No calendar is set". and there was no way to select a calendar.
    I was able to add the event on my Google Calendar on my laptop (PC), and it synced automatically, but I wasn't able to add any events from the iphone itself because "no calendar is set". 
    I tried turning off and on the phone and syncing back to my laptop, but the problem persisted.
    I deleted the iCloud account on my iphone, and that seemed to fix the problem; I'm able to add events again from the iphone and it's syncing to my Google Calendar.
    I then signed on to iCloud and setup syncing again, but turned off syncing everything except photostream, documents&data, and find my iphone since everything else would sync to outlook or internet explorer, neither of which I use.
    That might have been the problem.  For PC, iCloud will only sync to Outlook and Internet Explorer, and I don't have Outlook setup (can't connect to my work's email server with my account and the IT guys don't know how to fix it or they're too lazy to troubleshoot) and I only use Firefox and Chrome.  Since iCloud isn't syncing to any calendars on Outlook, there aren't any calendars set...
    I just did this a minute ago and everything seems to be back to normal, including the ability to choose a calendar when adding events.
    I'll have to see if it the problem comes back

  • HT202297 iCloud calendar unable to set events with reminders that work, despite ignoring the error message

    I am using Outlook 2007, Windows 7, updated iCloud Control Panel. 2 office computers and multiple mobile devices are sharing Calendar/Contacts/Tasks. One office computer, and the mobile devices seem to have no issue setting up a new calendar event with a reminder - the reminder goes off as planned, syncs with iCloud, and is picked up by the other office computer and mobile devices.
    My office computer can create iCloud calendar events, but when i attempt to set a reminder it gives me the 'The reminder for xxx will not appear because the item is in a folder that doesn't support reminders. Is this OK?' message. The help section on this site states that I can just ignore that, and the reminders will still be set up and work nonetheless. They don't. I also notice that despite being inside the iCloud calendar, as opposed to the local Outlook calendar on my PC, it still gives me the option to 'Move to iCloud,' as if I wasn't creating the event in iCloud. Yet if I set a new reminder, the event sticks, syncs with iCloud and will pop up on other devices. If I click the 'Move to iCloud' option that oddly appears in the created calendar event, it glitches out and crashes outlook. Tried this multiple times, and, oddly enough, one time it rebooted Outlook and seemed to be creating iCloud calendar events with reminders just fine. The 'Move to iCloud' option had disappeared and the reminders would stick. After the next computer restart, I was back to square one and it would no longer accept calendar reminders and the 'Move to iCloud option was back.
    The reminder seems to the the only function that doesn't work. I've re-installed iCloud Control Panel, restarted all involved applications and the computer. There seems to be a partial disconnect from the iCloud calendar in my Outlook and the iCloud calendar; some functions work fine and sync, some are glitchy and do not function properly, and it is only this one device out of 2 PCs, an iPhone, and an iPad that has issues.
    Any ideas?

    paule54600 wrote:
    yes but if you don't have a gmail calender setup when you install the account for the first time I don't think it sees the calender if you  try to access it later. Either way I can't get it to work on my newly updated droid 2.  How do I "reset" the phone and what will I have to reconfigure once I do that?
    Hi Paul,
       I don't know about your phone, but on my Droid Pro, there is a little round white button underneath the battery, press that with a stylus, or the tip of a pen, then reassemble the phone and turn it on.  That's all there is to it.  I didn't have to re-configure anything.  Check your user manual for your reset button location, it's probably in the section on troubleshooting.

  • Best Way to Capture Stored Procedure Calls through Extended Events?

    I am trying implement Real Simple Solution for Database Monitoring:
    If any of the RPC Calls takes more than 200 milliseconds or more than 10K Reads , I want to compile the list on daily basis and sent out an email to our team. We usually did that through RPC Completed event through Profiler.
    We want to Implement the same through Extended Events but SQL Text is not being captured because we are using SQL Server 2008 R2.
    Whats the best way with Extended Events to Capture:
    RPC Calls with Parameters and Values and Reads, Writes, CPU and Query HASH.
    What we currently have is :
    Has anyone done this using SQL Server 2008 R2 and  please let me know.
    IF EXISTS(SELECT * FROM sys.server_event_sessions WHERE name='LongRunningQueries')
    DROP EVENT SESSION [LongRunningQueries] ON SERVER;
    CREATE EVENT SESSION [LongRunningQueries]
    ON SERVER
    ADD EVENT sqlserver.module_end(
    ACTION (sqlserver.client_app_name, sqlserver.client_hostname, sqlserver.database_id, sqlserver.plan_handle, sqlserver.session_id, sqlserver.sql_text, sqlserver.tsql_stack, sqlserver.username)),
    ADD EVENT sqlserver.rpc_completed(
    ACTION (sqlserver.client_app_name, sqlserver.client_hostname, sqlserver.database_id, sqlserver.session_id, sqlserver.sql_text, sqlserver.username)),
    ADD EVENT sqlserver.sp_statement_completed(
    ACTION (sqlserver.client_app_name, sqlserver.session_id))
    ADD TARGET package0.asynchronous_file_target(
    SET filename='G:\LongRunningQueries.xet', metadatafile='G:\LongRunningQueries.xem')
    WITH (MAX_MEMORY = 4096KB, EVENT_RETENTION_MODE = ALLOW_MULTIPLE_EVENT_LOSS, MAX_DISPATCH_LATENCY = 300 SECONDS, MAX_EVENT_SIZE = 0KB, MEMORY_PARTITION_MODE = NONE, TRACK_CAUSALITY = ON, STARTUP_STATE = ON)
    ALTER EVENT SESSION [LongRunningQueries] ON SERVER STATE = START
    I90Runner

    Hello,
    Please read the following resource.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/d6d51f6e-c01b-4880-abb2-4f0cfd1f4531/extended-event-trace-on-event-rpccompleted-not-capturing-sqltext-action-unable-to-retrieve-sql?forum=sqldatabaseengine
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Extended Event Filter Record for PArticular or ONE database

    Hi Folks,
    If am working with Extended Event .In that am use Adventureworks database which are long running queries.Finally i get a result from all  Database those queries are long running queries. But i want to get the result
    from only one database, anyother database long running queries wont come in result., If possible tell me the ways.,
    Thanks

    In this case you can filter the events based on the database id.
    Reference
    http://blog.sqlauthority.com/2010/03/29/sql-server-introduction-to-extended-events-finding-long-running-queries/
    Mention the sqlserver.database_id parameter while creating the event session
    In the below example, I've created session to monitor the long running events for the database_id =15
    CREATE EVENT SESSION LongRunningQuery
    ON SERVER
    -- Add event to capture event
    ADD EVENT sqlserver.sql_statement_completed
    -- Add action - event property
    ACTION (sqlserver.sql_text, sqlserver.tsql_stack,sqlserver.database_id)
    -- Predicate - time 1000 milisecond
    WHERE sqlserver.sql_statement_completed.duration > 1000 and sqlserver.database_id=15
    -- Add target for capturing the data - XML File
    ADD TARGET package0.asynchronous_file_target(
    SET filename='c:\LongRunningQuery.xet', metadatafile='c:\LongRunningQuery.xem'),
    -- Add target for capturing the data - Ring Bugger
    ADD TARGET package0.ring_buffer
    (SET max_memory = 1096)
    WITH (max_dispatch_latency = 1 seconds)
    --Prashanth

  • Is there a way to delete all events with the same title (not added as reoccurring) without deleting one at a time?

    i currently have a calendar synced that has events scheduled in perpetuity, scheduled as individual events.  I would like to delete all events with the same title.  I do not want to delete the entire calendar nor do I want to go into every event and delete individually.  These were not scheduled by me so I do not know how they were added one by one and go on forever but they are NOT scheduled as reoccurring and thus must be modified individually.
    I can do a search and find all events, is there a way to just delete all events with the same title all at once?
    this is a Microsoft outlook synced calendar and I am seemingly unable to delete the events all at one time from Microsoft as well. 
    Please help!

    If you still have access to the Outlook calendar in Outlook, I would delete them from there. There are a number of ways to do that, but if you open the individual event in Outlook, does it show a repeating pattern? If not, then you may have to delete them individually, but that is not that difficult either. Go into the calendar and then change the view to a list view. From there you can sort the view according to subject. This should bring all of these same appointments together in the list and you can select the group in Outlook and delete them. Once you do that, you can change your view back and then sync the phone. That will remove the events from the phone.

  • Selective XML Index feature is not supported for the current database version , SQL Server Extended Events , Optimizing Reading from XML column datatype

    Team , Thanks for looking into this  ..
    As a last resort on  optimizing my stored procedure ( Below ) i wanted to create a Selective XML index  ( Normal XML indexes doesn't seem to be improving performance as needed ) but i keep getting this error within my stored proc . Selective XML
    Index feature is not supported for the current database version.. How ever
    EXECUTE sys.sp_db_selective_xml_index; return 1 , stating Selective XML Indexes are enabled on my current database .
    Is there ANY alternative way i can optimize below stored proc ?
    Thanks in advance for your response(s) !
    /****** Object: StoredProcedure [dbo].[MN_Process_DDLSchema_Changes] Script Date: 3/11/2015 3:10:42 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- EXEC [dbo].[MN_Process_DDLSchema_Changes]
    ALTER PROCEDURE [dbo].[MN_Process_DDLSchema_Changes]
    AS
    BEGIN
    SET NOCOUNT ON --Does'nt have impact ( May be this wont on SQL Server Extended events session's being created on Server(s) , DB's )
    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
    select getdate() as getdate_0
    DECLARE @XML XML , @Prev_Insertion_time DATETIME
    -- Staging Previous Load time for filtering purpose ( Performance optimize while on insert )
    SET @Prev_Insertion_time = (SELECT MAX(EE_Time_Stamp) FROM dbo.MN_DDLSchema_Changes_log ) -- Perf Optimize
    -- PRINT '1'
    CREATE TABLE #Temp
    EventName VARCHAR(100),
    Time_Stamp_EE DATETIME,
    ObjectName VARCHAR(100),
    ObjectType VARCHAR(100),
    DbName VARCHAR(100),
    ddl_Phase VARCHAR(50),
    ClientAppName VARCHAR(2000),
    ClientHostName VARCHAR(100),
    server_instance_name VARCHAR(100),
    ServerPrincipalName VARCHAR(100),
    nt_username varchar(100),
    SqlText NVARCHAR(MAX)
    CREATE TABLE #XML_Hold
    ID INT NOT NULL IDENTITY(1,1) PRIMARY KEY , -- PK necessity for Indexing on XML Col
    BufferXml XML
    select getdate() as getdate_01
    INSERT INTO #XML_Hold (BufferXml)
    SELECT
    CAST(target_data AS XML) AS BufferXml -- Buffer Storage from SQL Extended Event(s) , Looks like there is a limitation with xml size ?? Need to re-search .
    FROM sys.dm_xe_session_targets xet
    INNER JOIN sys.dm_xe_sessions xes
    ON xes.address = xet.event_session_address
    WHERE xes.name = 'Capture DDL Schema Changes' --Ryelugu : 03/05/2015 Session being created withing SQL Server Extended Events
    --RETURN
    --SELECT * FROM #XML_Hold
    select getdate() as getdate_1
    -- 03/10/2015 RYelugu : Error while creating XML Index : Selective XML Index feature is not supported for the current database version
    CREATE SELECTIVE XML INDEX SXI_TimeStamp ON #XML_Hold(BufferXml)
    FOR
    PathTimeStamp ='/RingBufferTarget/event/timestamp' AS XQUERY 'node()'
    --RETURN
    --CREATE PRIMARY XML INDEX [IX_XML_Hold] ON #XML_Hold(BufferXml) -- Ryelugu 03/09/2015 - Primary Index
    --SELECT GETDATE() AS GETDATE_2
    -- RYelugu 03/10/2015 -Creating secondary XML index doesnt make significant improvement at Query Optimizer , Instead creation takes more time , Only primary should be good here
    --CREATE XML INDEX [IX_XML_Hold_values] ON #XML_Hold(BufferXml) -- Ryelugu 03/09/2015 - Primary Index , --There should exists a Primary for a secondary creation
    --USING XML INDEX [IX_XML_Hold]
    ---- FOR VALUE
    -- --FOR PROPERTY
    -- FOR PATH
    --SELECT GETDATE() AS GETDATE_3
    --PRINT '2'
    -- RETURN
    SELECT GETDATE() GETDATE_3
    INSERT INTO #Temp
    EventName ,
    Time_Stamp_EE ,
    ObjectName ,
    ObjectType,
    DbName ,
    ddl_Phase ,
    ClientAppName ,
    ClientHostName,
    server_instance_name,
    nt_username,
    ServerPrincipalName ,
    SqlText
    SELECT
    p.q.value('@name[1]','varchar(100)') AS eventname,
    p.q.value('@timestamp[1]','datetime') AS timestampvalue,
    p.q.value('(./data[@name="object_name"]/value)[1]','varchar(100)') AS objectname,
    p.q.value('(./data[@name="object_type"]/text)[1]','varchar(100)') AS ObjectType,
    p.q.value('(./action[@name="database_name"]/value)[1]','varchar(100)') AS databasename,
    p.q.value('(./data[@name="ddl_phase"]/text)[1]','varchar(100)') AS ddl_phase,
    p.q.value('(./action[@name="client_app_name"]/value)[1]','varchar(100)') AS clientappname,
    p.q.value('(./action[@name="client_hostname"]/value)[1]','varchar(100)') AS clienthostname,
    p.q.value('(./action[@name="server_instance_name"]/value)[1]','varchar(100)') AS server_instance_name,
    p.q.value('(./action[@name="nt_username"]/value)[1]','varchar(100)') AS nt_username,
    p.q.value('(./action[@name="server_principal_name"]/value)[1]','varchar(100)') AS serverprincipalname,
    p.q.value('(./action[@name="sql_text"]/value)[1]','Nvarchar(max)') AS sqltext
    FROM #XML_Hold
    CROSS APPLY BufferXml.nodes('/RingBufferTarget/event')p(q)
    WHERE -- Ryelugu 03/05/2015 - Perf Optimize - Filtering the Buffered XML so as not to lookup at previoulsy loaded records into stage table
    p.q.value('@timestamp[1]','datetime') >= ISNULL(@Prev_Insertion_time ,p.q.value('@timestamp[1]','datetime'))
    AND p.q.value('(./data[@name="ddl_phase"]/text)[1]','varchar(100)') ='Commit' --Ryelugu 03/06/2015 - Every Event records a begin version and a commit version into Buffer ( XML ) we need the committed version
    AND p.q.value('(./data[@name="object_type"]/text)[1]','varchar(100)') <> 'STATISTICS' --Ryelugu 03/06/2015 - May be SQL Server Internally Creates Statistics for #Temp tables , we do not want Creation of STATISTICS Statement to be logged
    AND p.q.value('(./data[@name="object_name"]/value)[1]','varchar(100)') NOT LIKE '%#%' -- Any stored proc which creates a temp table within it Extended Event does capture this creation statement SQL as well , we dont need it though
    AND p.q.value('(./action[@name="client_app_name"]/value)[1]','varchar(100)') <> 'Replication Monitor' --Ryelugu : 03/09/2015 We do not want any records being caprutred by Replication Monitor ??
    SELECT GETDATE() GETDATE_4
    -- SELECT * FROM #TEMP
    -- SELECT COUNT(*) FROM #TEMP
    -- SELECT GETDATE()
    -- RETURN
    -- PRINT '3'
    --RETURN
    INSERT INTO [dbo].[MN_DDLSchema_Changes_log]
    [UserName]
    ,[DbName]
    ,[ObjectName]
    ,[client_app_name]
    ,[ClientHostName]
    ,[ServerName]
    ,[SQL_TEXT]
    ,[EE_Time_Stamp]
    ,[Event_Name]
    SELECT
    CASE WHEN T.nt_username IS NULL OR LEN(T.nt_username) = 0 THEN t.ServerPrincipalName
    ELSE T.nt_username
    END
    ,T.DbName
    ,T.objectname
    ,T.clientappname
    ,t.ClientHostName
    ,T.server_instance_name
    ,T.sqltext
    ,T.Time_Stamp_EE
    ,T.eventname
    FROM
    #TEMP T
    /** -- RYelugu 03/06/2015 - Filters are now being applied directly while retrieving records from BUFFER or on XML
    -- Ryelugu 03/15/2015 - More filters are likely to be added on further testing
    WHERE ddl_Phase ='Commit'
    AND ObjectType <> 'STATISTICS' --Ryelugu 03/06/2015 - May be SQL Server Internally Creates Statistics for #Temp tables , we do not want Creation of STATISTICS Statement to be logged
    AND ObjectName NOT LIKE '%#%' -- Any stored proc which creates a temp table within it Extended Event does capture this creation statement SQL as well , we dont need it though
    AND T.Time_Stamp_EE >= @Prev_Insertion_time --Ryelugu 03/05/2015 - Performance Optimize
    AND NOT EXISTS ( SELECT 1 FROM [dbo].[MN_DDLSchema_Changes_log] MN
    WHERE MN.[ServerName] = T.server_instance_name -- Ryelugu Server Name needes to be added on to to xml ( Events in session )
    AND MN.[DbName] = T.DbName
    AND MN.[Event_Name] = T.EventName
    AND MN.[ObjectName]= T.ObjectName
    AND MN.[EE_Time_Stamp] = T.Time_Stamp_EE
    AND MN.[SQL_TEXT] =T.SqlText -- Ryelugu 03/05/2015 This is a comparision Metric as well , But needs to decide on
    -- Peformance Factor here , Will take advise from Lance if comparision on varchar(max) is a vital idea
    --SELECT GETDATE()
    --PRINT '4'
    --RETURN
    SELECT
    top 100
    [EE_Time_Stamp]
    ,[ServerName]
    ,[DbName]
    ,[Event_Name]
    ,[ObjectName]
    ,[UserName]
    ,[SQL_TEXT]
    ,[client_app_name]
    ,[Created_Date]
    ,[ClientHostName]
    FROM
    [dbo].[MN_DDLSchema_Changes_log]
    ORDER BY [EE_Time_Stamp] desc
    -- select getdate()
    -- ** DELETE EVENTS after logging into Physical table
    -- NEED TO Identify if this @XML can be updated into physical system table such that previously loaded events are left untoched
    -- SET @XML.modify('delete /event/class/.[@timestamp="2015-03-06T13:01:19.020Z"]')
    -- SELECT @XML
    SELECT GETDATE() GETDATE_5
    END
    GO
    Rajkumar Yelugu

    @@Version : ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Microsoft SQL Server 2012 - 11.0.5058.0 (X64)
        May 14 2014 18:34:29
        Copyright (c) Microsoft Corporation
        Developer Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)
    (1 row(s) affected)
    Compatibility level is set to 110 .
    One of the limitation states - XML columns with a depth of more than 128 nested nodes
    How do i verify this ? Thanks .
    Rajkumar Yelugu

  • Filtering extended event in sql server 2008 r2

    This code has been generated in sql server 2012 (using the graphical interface).
    CREATE EVENT SESSION [backupsmssql] ON SERVER
    ADD EVENT sqlserver.sp_statement_starting(
    ACTION(
    sqlserver.client_app_name,
    sqlserver.client_hostname,sqlserver.nt_username,
    sqlserver.session_nt_username,sqlserver.sql_text,
    sqlserver.username)
    WHERE ([sqlserver].[like_i_sql_unicode_string]([sqlserver].[sql_text],N'%backup database%'))
    WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=OFF)
    If I try to run it on sql server 2008 r2, the filtering part seems to be misinterpreted and the following error is thrown:
    Msg 25706, Level 16, State 8, Line 1
    The event attribute or predicate source, "sqlserver.sql_text", could not be found.
    If I remove the where clause, the statement runs fine even though the sqlserver.sql_text is returned as part of the actions.  So obviously the "sqlserver.sql_text" is existant.  Why would I receive a message it does not exists in the
    where clause?  Was the "like_i_sql_unicode_string" inexistent in 2008 r2 or has the syntax changed in 2012.  How can we filter sql_text in 2008 r2?  I can't seem to find any doc regarding this, help would be appreciated.
    p.s. There is a very similar question here but it has been closed by the moderators and does not answer the question:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/76c2719c-ea02-4449-b59e-465a24c37ba8/question-on-sql-server-extended-event?forum=sqlsecurity

    You are on the right track:
    The differences in the available events and predicates (source and compare) between SQL Server 2008/R2 and 2012 are quite substantial.
    So the LIKE-operator is not available at all under 2008/R2 as a comparison-predicate, and sql_text is also not available as a source-predicate - only as action itself. - One has to realize, that actions really are not automatically also predicates.
    For a complete list of predicates you can query like this:
    SELECT dm_xe_packages.name AS package_name,
    dm_xe_objects.name AS source_name,
    dm_xe_objects.description
    , dm_xe_objects.object_type
    FROM sys.dm_xe_objects AS dm_xe_objects
    INNER JOIN sys.dm_xe_packages AS dm_xe_packages
    ON dm_xe_objects.package_guid = dm_xe_packages.guid
    WHERE
    (dm_xe_packages.capabilities IS NULL OR dm_xe_packages.capabilities & 1 = 0)
    AND (dm_xe_objects.capabilities IS NULL OR dm_xe_objects.capabilities & 1 = 0)
    AND dm_xe_objects.object_type
    IN ( 'pred_source', 'pred_compare')
    ORDER BY dm_xe_objects.object_type
    Unfortunately for your specific filter there is not workaround for Extended Events.
    You would have to resort to another predicate for filtering altogether.
    BUT: if you are on Enterprise Edition, why not use Auditing. There is a Audit-Group for Backup/Restore.
    It would be really simple like the following:
    CREATE SERVER AUDIT SPECIFICATION [Audit_BackupRestores]
    FOR SERVER AUDIT [AuditTarget]
    ADD (BACKUP_RESTORE_GROUP)
    If you are on Standard, you found yet another reason to upgrade to a supported version of SQL Server, I am afraid to say..
    Andreas Wolter (Blog |
    Twitter)
    MCSM: Microsoft Certified Solutions Master Data Platform, MCM, MVP
    www.SarpedonQualityLab.com |
    www.SQL-Server-Master-Class.com

  • Can I use AWT elements in a JSP, and so could I generate events with them?

    This is because I�m doing a simple JSP that showing a button, my JSP is:
    <html>
    <%@ page import="java.awt.*" %>
    <%! Button b = new Button("Hola!!!"); %>
    <% add(b); %>
    </html>
    But when I tried to see the button in the browser, my JSP generates the following:
    Compilation of '/RAID5/weblogic/myserver/classfiles/jsp_servlet/_gep/_alterno/_23_mayo/__mr4.java' failed:
    /RAID5/weblogic/myserver/classfiles/jsp_servlet/_gep/_alterno/_23_mayo/__mr4.java:79: cannot resolve symbol
    probably occurred due to an error in /gep/alterno/23_mayo/mr4.jsp line 7:
    <% add(b); %>
    Could somebody help me please?.....
    Can I use AWT elements in a JSP, and so could I generate events with them?
    Thanks!!!

    There are 2 ways to run a web page dynamically:
    1) Reload the page via use of javascript or some other scripting language.
    2) Use an applet to regularly check a URL for the data
    Remember, as Paul pointed out, JSP's only generate HTML output. AWT components need to run inside a JVM not a just the browser.
    I could recommend an applet but you may have problems with IE6 not supporting java. Otherwise there shouldn't be too much of a prob.
    If you prefer to use an AWT/Swing setup (for example an application) rather than a JSP setup, Webstart is good for delivering online applications which operate standalone or remotely.
    When you consider that the Java-Plugin and the Webstart puligin are about the same size it's just a matter of weighing up who your target clients are and whats easiest.
    Cheers,
    Anthony

  • Best Practice for Monitoring, on VPS 2012 Server Standard. Extended Events or Profiler?

    Hi,
    What tools do you use to determine if you should tweak SQL Server configuration and optimize code route, or simply bump up your virtual resources? Can someone share a bag of Extended Events to monitor at the VPS level?  
    I'm a reasonably decent SQL Developer but never advanced far with DBA efforts. Especially when the mainstream went virtual. Seemed to me that all SQL Servers flexibility with managing disk and memory went out the window now that everything is 'shared', NATed,
    and Plesked. So I basically dropped out of the conversation and built stuff with SSIS and TSQL.
    Now, I'm charged with assessing a bottleneck on a VPS Windows 2012 Standard running SQL 2012 Express. I've read that running profiler and traces are deprecated and I've looked a bit at the servers extended events on the hosted environment. I have not run anything.
    My question: Does it make sense to think in terms of 'levels' in deciding what to monitor? I consider the SQL Server as a level, then the Windows Server, and finally the Virtual Level. What I'm getting at, is sure, I can monitor SQL Server with a profile tool,
    but it won't know SQL is on a VPS. So do I miss something?
    There used to be day when we had a dedicated physical box for SQL Server. We ran traces using profiler and got good clues on how to improve performance. In todays VPS world we can use sliders to increase virtual memory and disk space. What tools do you use
    to determine if you should tweak SQL Server configuration and optimize code route, or simply bump up your virtual resources? Can someone share a bag of Extended Events to monitor at the VPS level?  
    What Extened Events at the VPS level tell me if SQL Server is struggling with the limited 1Gb virtual memory? I realize this is not a direct question but hopefully someone will point this developer in the right direction.
    John

    Hi John,
    From SQL point of view it doesnt really matter whether the box is physical or virtual. So if you feel there is performance issues with sql and you are well versed with sql profiler troubleshooting go ahead with that. If you feel performance is good, then
    you know where to look into.
    I would first prefer to find whether it is really a problem with SQL before trying to troubleshoot sql side and I use perfmon counters to do that.
    Also I would look at the SQL Error log to see if there are any obvious errors.
    I havent used extended events much so leaving that for others to comment on. :)
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • Raise an event with no arguments

    In VB.net I can declare and raise an event like this
    Public Event SomeEvent()
    Public Sub SomeMethod
    RaiseEvent SomeEvent()
    End Sub
    I need to work out how to do this in c# however all of the examples of raising events include event handlers.  This won't work for me as I am raising this event over a COM interface, and so I can't send eventargs or non basic types through the interface
    to the client application.

    OK, Action doesn't work as I end up with the following error
    An exception of type 'System.InvalidCastException' occurred in AdtakerInterfaceSampleCsharp.exe but was not handled in user code
    Additional information: Unable to cast object of type 'System.__ComObject' to type 'System.Action'.
    You asked how to raise an event with no arguments in C# and I gave you the solution for this. You could certainly use an Action to raise an event with no arguments as my sample code clearly demonstrates.
    How to call your specific COM interface is a totally different topic.
    Please start a new thread if you have a new question. You may also want to provide some more details if you want anyone to be able to help you with this. Remember that the forums are for helping solving specific issues though, they are not for anyone to
    write an entire application, class or module for you :)

  • Microsoft sql server extended event log file

    Dears
    Sorry for my below questions if it is very beginner level.
    In my implementation I have cluster SQL 2012 on Windows 2012; I am using MountPoints since I have many Clustered Disks.
    My MountPoint Size is only 3 GB; My Extended event log are growing fast and it is storing in the MountPoint Drive directly (Path: F:\MSSQL11.MSSQLSERVER\MSSQL\Log).
    What is the best practice to work with it? (is it to keep all Extended events? or recirculate? or to shrink? or to store in DB?)
    Is there any relation between SQL truncate and limiting the size of Extended event logs?
    How can I recirculate this Extended Events?
    How can I change the default path?
    How can I stop it?
    and in case I stop it, does this means to stop storing SQL event in Windows event Viewer?
    Thank you

    After a lot of checking, I have found below:
    My Case:
    I am having SQL Failover Cluster Instances "FCI" and I am using Mount-Points to store my Instances.
    I am having 2 Passive Copies for each FCI.
    In my configuration I choose to store the Root Instance which include the logs on Mount-Point.
    My Mount Point is 2 GB Only, which became full after few days of deployment.
    Light Technical Information:
    The Extended Event Logs files are generated Coz I have FCI, in single SQL Installation you will not find this files.
    The File Maximum size will be 100 MB.
    The Files start circulating after it become 10 Full Files.
    If you have the FCI installed as 1 Active 2 Passive, and you are doing failover between the nodes, then you will expect to see around 14 - 30 copy of this file.
    Based on above information you will need to have around 100 MB * 10 Files Per Instance copy * 3 Since in my case I have 1 Active and 2 passive instances which will = 3000 MB
    So in my case My Mount-Point was 2 GB, which become full coz of this SQLDIAG Logs.
    Solution:
    I extended my mount point by 3 GB coz I am storing this logs on it.
    In case you will need to change SQLDIAG Extended Logs Size to 50 MB for example and place to F:\Logs, then you will need below commands:
    ALTER SERVER CONFIGURATION SET DIAGNOSTICS LOG OFF;
    ALTER SERVER CONFIGURATION
    SET DIAGNOSTICS LOG MAX_SIZE = 50 MB;
    ALTER SERVER CONFIGURATION
    SET DIAGNOSTICS LOG PATH = 'F:\logs';
    ALTER SERVER CONFIGURATION SET DIAGNOSTICS LOG ON;
    After that you will need to restart the FCI from SQL Server Configuration Manager or Failover Cluster Manager.
    I wish you will find this information helpful if it is your case.
    Regards

Maybe you are looking for