SQL Server Operators – SQL Agent Alert System – Notify Operators

After adding SQL Operators you need to restart SQL Agent

ERROR in SQL Agent Jobs
… NOTE: Failed to notify ‘<operator name>’ via email.

[476] Database Mail is not enabled for agent notifications. Cannot send e-mail to
[475] Database Mail is not enabled for agent notifications.

May have log in SSMS > SQL Server Agent > Error Logs

SOLVED
Credit to:
http://sqlblog.jfperry.com/jpsql/post/2009/04/07/NOTE-Failed-to-notify-7boperator7d-via-email.aspx

This was set up on one of my work servers. For a different company this needed to be set up.

On SQL 2005+ you have to tell SQL Server Agent / Properties / Alert System, which profile that you’d like to enable. Here’s what it does.
e.g. and don’t forget to restart SQL Agent

To set up SQL Server Agent Mail to use Database Mail

  1. In Object Explorer, expand a server.
  2. Right-click SQL Server Agent, and then click Properties.
  3. Click Alert System.
  4. Select Enable Mail Profile.
  5. In the Mail system list, choose Database Mail.
  6. In the Mail profile list, select a mail profile for Database Mail.

Or less likely Transact SQL

USE [msdb]
GO
EXEC master.dbo.xp_instance_regwrite
N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\SQLServerAgent',
N'DatabaseMailProfile',
N'REG_SZ',
N'MyDatabaseProfile'
GO

How do I… open a cmd prompt at a specified location

  1. Create a shortcut to cmd
  2. Change the Start In to the location you desire
  3. There are other methods

http://stackoverflow.com/questions/60904/how-can-i-open-a-cmd-window-in-a-specific-location

How do I… open windows explorer at a pre-set location

Create a shortcut to Windows explorer (probably on your desktop)
Add /e,C:\Windows to the end of the shortcut

http://support.microsoft.com/kb/307856

Windows 7 Homegroup – Blocked by McAffee – Also how to set-up

I set up Windows 7 Homegroup on my PC and was able to see this from my laptop.
However I was unable to see my PC from my laptop.
SOLVED
After some reading decided to remove my almost redundant McAffee from my laptop. As soon as I did this Homegroup started working. As did remote connections to SQL Server.

New Problem 12th July 2012

Not able to see PC HomeGroup folders on laptop. Solution was to set up a Library on PC and then Share with for this library – rather than direct on folder

SQL Server Allow Remote Connections – Including Blocked by McAffee

A lot of websites have the basics of this. Applied steps and still did not work. Steps were

  1. Allow remote connections
  2. Start SQL Browser
  3. Ensure that Protocol for TCP/IP was enabled
  4. For new PC only adjustment to Firewall was addition of inbound port rule. Had to include Private network.

SOLVED However removed McAffee from the server (laptop) and remote connection worked immediately. Think this was the deciding ultimate solving step. Other Links http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx http://support.microsoft.com/kb/914277 http://www.dummies.com/how-to/content/how-to-open-a-port-in-the-windows-7-firewall.html http://www.sevenforums.com/system-security/58817-remote-access-sql-server-express-2008-windows-7-a.html

For remote connection over the internet also need to use port forwarding on the router.

Entity Framework possible feedback to Microsoft Connect – IBindingListView

 

https://connect.microsoft.com/data/feedback/details/704105/entity-framework-winforms-datagridview-support-for-bindingsource-filter-sort-and-column-heading-sort

 

Entity Framework WinForms DataGridView support for BindingSource.Filter .Sort and column heading Sort

Entity Framework looks useful and I have limited use of it in my code. Also several developers have expressed to me how they have found it useful.

I currently use a lot of WinForms databinding using DataSets and BindingSource. Out of the box I get column header sorting. Also it is a simple matter to set BindingSource.Filter and BindingSource.Sort as strings. I have used this feature to provide a lot of data-driven filter and sort strings for UI quick filter and sort which works very well.

However when I use Entity Framework the column header sort and BiningSource.Filter and .Sort properties do not work. My understanding is that this is because EF does not support IBindingListView. Although it might but not out of the box. Please advise or consider implementing this in future editions of Entity Framework.

Thank you

Stephen, UK

Transact SQL for disable and enable Trigger

 

DISABLE TRIGGER Product.updateProducts ON Product.Products;

UPDATE Product.Products…

ENABLE TRIGGER updateProducts ON Product.Products;

Policy Management in SQL Server

After reading help this is quite easy

Spreadsheets (Excel) compared to Database

Triangle of Solution

Based on number of times used:

  1. 1-5 use a piece of paper
  2. 5-20 use a spreadsheet
  3. 20+ use a database

 Spreadsheets Disadvantages

  1. Data should be stored once and only once. Using spreadsheets often creates multiple out of date files
  2. VLookup is far inferior to SQL links
  3. Some problems are very difficult to solve in comparison with similar solution in database transact sql
  4. Limited or no programmatic power dependent on developer
  5. Out of systems – suggests refactor not found
  6. Out of security control
  7. Unable to unit test
  8. Unstructured data
  9. A little knowledge is a dangerous thing
  10. Spreadsheets exported from a database – just adds another step – NOT combine, reduce, eliminate

 Spreadsheet Advantages

  1. More people can prepare them
  2. Users can demonstrate requirements by attempting to build what they want . Form of tracer bullet
  3. Possibly more print control
    1. offset by users knowledge of how to use Context Menu in grids
    2. why are they printing anyway – why not two screens – are they avoiding IT – find it easier to work with paper

Spreadsheets Interesting

  1. For users showing advanced spreadsheet skills. Could promote move to SQL Express of other. Or MS Access using ODBC. Or Reporting.
  2. Could direct them to request views for plugging in

Real-life Examples

  1. Model in Database exported to Spreadsheet
    • Created a model.
    • User downloaded to spreadsheet and then edits some data.
    • Model is blind to changes.
    • Also Model then changed in database and spreadsheet is out of date.
    • Also spreadsheet is not used for a few days so data in it becomes a little out of date.
  2. User wants to export to excel – to print out a stock driven demand. This is a step that was removed before in order to save time.

AMD HD6770 Secondary Screen Flicker

Problem
Open google and run mouse over menu. Second screen flickers with a horizontal line across it.

SOLVED

  1. Catalyst Control Center
  2. Performance
  3. Enable AMD Overdrive check box. Uncheck this. Apply.

Reported in several websites