Forums (RSS 2.0)" href="http://www.simple-talk.com/community/forums/rss.aspx?ForumID=-1&Mode=0" />
Click here to monitor SSC

Using and Monitoring SQL 2005 Query Notification

Last post 03-10-2010, 2:46 PM by billr578. 50 replies.
Page 2 of 4 (51 items)   < Previous 1 2 3 4 Next >
Sort Posts: Previous Next
  •  10-17-2006, 9:58 AM Post number 2875 in reply to post number 71217

    Excellent

    Wicked walkthough.
  •  10-25-2006, 1:12 PM Post number 3288 in reply to post number 71217

    DTS in SQL Server 2005

    Hi,
    I am new in SQL DBA, i want to create DTS in SQL Server 2005.
    Can you help me.
    Thnx
  •  01-16-2007, 9:34 AM Post number 15707 in reply to post number 71217

    SQL Express

    For those of you using SQL 2005 Express Edition, the Query Notifications feature is not available.
  •  02-19-2007, 7:05 AM Post number 18928 in reply to post number 71217

    Good One but not working in my case

    I have followed all your instruction, but finding problem to make work.

    My Problem : Can't able to Invalidate cache, on changing row in table.

    My code is as under:
    private ArrayList GetEmpDetails()
    {
    if (Cache["EmpDetails"] == null)
    {

    string strCon = System.Configuration.ConfigurationSettings.AppSettings["connStr"].ToString();

    using (SqlConnection con = new SqlConnection(strCon))
    {
    SqlCommand cmd = new SqlCommand("dbo.[pr_Emp_SelectAll]", con);
    con.Open();

    IDataReader dr = cmd.ExecuteReader();
    ArrayList objArr = new ArrayList();

    while (dr.Read())
    {
    Employee objEmp = new Employee();
    objEmp.Name = dr["EmpName"].ToString();
    objEmp.EmpId = int.Parse(dr["EmpId"].ToString());
    objEmp.Salary = double.Parse(dr["EmpSalary"].ToString());
    objArr.Add(objEmp);
    }

    //Create Cache Dependency
    SqlCacheDependency sqlDependencyEmp = new SqlCacheDependency(cmd);


    //clsEmp objEmp = new clsEmp();
    //objEmp.iEmpId = EmpId;
    //DataTable dtEmpDetails = objEmp.SelectOne();

    //Insert Cache
    Cache.Insert("EmpDetails", objArr, sqlDependencyEmp);
    }
    return Cache["EmpDetails"] as ArrayList;
    }
    else
    {
    return Cache["EmpDetails"] as ArrayList;
    }
    }
  •  02-19-2007, 7:06 AM Post number 18929 in reply to post number 71217

    Good One but not working in my case

    I have followed all your instruction, but finding problem to make work.

    My Problem : Can't able to Invalidate cache, on changing row in table.

    My code is as under:
    private ArrayList GetEmpDetails()
    {
    if (Cache["EmpDetails"] == null)
    {

    string strCon = System.Configuration.ConfigurationSettings.AppSettings["connStr"].ToString();

    using (SqlConnection con = new SqlConnection(strCon))
    {
    SqlCommand cmd = new SqlCommand("dbo.[pr_Emp_SelectAll]", con);
    con.Open();

    IDataReader dr = cmd.ExecuteReader();
    ArrayList objArr = new ArrayList();

    while (dr.Read())
    {
    Employee objEmp = new Employee();
    objEmp.Name = dr["EmpName"].ToString();
    objEmp.EmpId = int.Parse(dr["EmpId"].ToString());
    objEmp.Salary = double.Parse(dr["EmpSalary"].ToString());
    objArr.Add(objEmp);
    }

    //Create Cache Dependency
    SqlCacheDependency sqlDependencyEmp = new SqlCacheDependency(cmd);


    //clsEmp objEmp = new clsEmp();
    //objEmp.iEmpId = EmpId;
    //DataTable dtEmpDetails = objEmp.SelectOne();

    //Insert Cache
    Cache.Insert("EmpDetails", objArr, sqlDependencyEmp);
    }
    return Cache["EmpDetails"] as ArrayList;
    }
    else
    {
    return Cache["EmpDetails"] as ArrayList;
    }
    }
  •  02-19-2007, 7:08 AM Post number 18930 in reply to post number 71217

    Even after changing row, it takes data from cache.

    With SqlCacheDepedency with SQL Server 2005, my understanding is we can Invalidate cache when the data in row of a particular table is changed... But it is not working in my case????

    Web.config file code:

    <appSettings>
    <add key="connStr" value="server=192.168.0.28;database=SampleDatabase;uid=sa;pwd=ilink2006;"/>
    </appSettings>
    <connectionStrings>
    <add name="ConnectionString"
    connectionString="server=192.168.0.28;database=SampleDatabase;uid=sa;pwd=ilink2006;"/>
    </connectionStrings>
    <system.web>

    <caching>
    <sqlCacheDependency pollTime="1" enabled="true" >
    <databases>
    <add connectionStringName="ConnectionString" name="SampleDatabase"/>
    </databases>
    </sqlCacheDependency>
    </caching>
  •  02-19-2007, 7:10 AM Post number 18931 in reply to post number 71217

    In SQL Server

    --Enable Broker Service
    use SampleDatabse
    alter database SampleDatabase set ENABLE_BROKER


    --Grant Permission to User "dng"
    use SampleDatabse
    Grant Create Procedure to dng
    Grant Create Queue to dng
    Grant Create Service to dng
    Grant SUBSCRIBE Query Notifications to dng
    Grant receive on QueryNotificationErrorsQueue To dng

    Alter Database SampleDatabase set trustworthy on
  •  03-03-2007, 5:09 PM Post number 19822 in reply to post number 71217

    Drop me a line...

    I didnt get a chance to take a look at your comment, but do drop me a line at sanchan_saxena at hotmail dot com.

    I will see how can I help you.
  •  03-09-2007, 6:01 AM Post number 20380 in reply to post number 71217

    Will Query Notification work with SQL Express Edition...?

    Could you please tell me, whether the Query notification feature works on SQL Express or not? I have trying to figure out for the past two days with no result whatsoever. Some say it's possible and some say it's not possible.

    What is the truth?
  •  03-18-2007, 4:34 PM Post number 20950 in reply to post number 71217

    Not possible wit sql express.

    Notificaiton services is not installed with sql express.
    Therefore it's not possible.

    Not only is it not possible, but who would even want to. There is no reason for it.
    Sql express is client/server same machine data exchange. (used on satellite machines).
  •  04-02-2007, 7:17 AM Post number 21875 in reply to post number 71217

    Your Example is not Complete

    Sir, Your Example is not Complete. Lot of things missing.

    Why we need to set many things for SQL Notification. It should be by default.

    All SQL commands are not working
  •  05-24-2007, 6:03 PM Post number 28678 in reply to post number 71217

    • Jimmy is not online. Last active: 10-29-2008, 4:42 PM Jimmy
    • Not Ranked
    • Joined on 10-24-2006
    • Level 1: Deep thought

    system.data.sqlclient.sqldependency.start

    By placing system.data.sqlclient.sqldependency.start in the global.asax application_load, does that mean ALL QUERIES will register a notification in the broker service?

    So for an examples sake, i have the start() code in my global class load method.
    Now i execute a simple query like SELECT fname FROM dbo.person. I DO NOT create a sqlcachedependency for this sqlcommand. Will a notification be registered for service broker?

    What i need to know is does all queries that run after starting the broker whether it registers a notification or not.
  •  09-10-2007, 1:13 PM Post number 37143 in reply to post number 71217

    Enable Broker Query Wont Complete

    In SQL Server 2005 have a Notification Services folder visible in SQL Mgmt Studio. When I run the query:

    use master
    alter database bersinektron SET ENABLE_BROKER

    It says, "Executing Query" but never finishes the query. Just keeps running. Ive let the query run for over an hour, but still it never finishes. Is there a known error when running this query and how would I fix it to get the query to run so that I can Enable_Broker? thanks.

Page 2 of 4 (51 items)   < Previous 1 2 3 4 Next >
View as RSS news feed in XML