C:\>wmic bios get serialnumber

 

1. Enabling CLR

sp_configure ’show advanced options’, 1;

GO

RECONFIGURE;

GO

sp_configure ‘clr enabled’, 1;

GO

RECONFIGURE;

GO

2. Grant necessary permissions to SQL Server user

In order to use the SqlDependency infrastructure, the sql user must be able to create a procedure, a service and a queue, must be granted REFERENCES permission on the QN contract and must have ’subscribe query notifications’ permission. In adition, for reasons I’m not sure I comprehend, it must have have suficient permissions over the [dbo] schema to be able to create a queue and procedure in it and be able impersonate the queue owner (that is, [dbo]).

GRANT CREATE PROCEDURE TO [SqlUser];

GRANT CREATE SERVICE TO [SqlUser];

GRANT CREATE QUEUE TO [SqlUser];

GRANT REFERENCES ON CONTRACT::[http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification] TO [SqlUser];

GRANT SUBSCRIBE QUERY NOTIFICATIONS TO [SqlUser];

GRANT CONTROL

ON SCHEMA::[dbo] TO [SqlUser];

GRANT IMPERSONATE ON USER::DBO TO [SqlUser];

3. SQL Server account

Service Account for SQL Server

An application will not receive notifications from an instance of SQL Server that uses the Local System account as the service account. For more information, see "Setting Up Windows Service Accounts" in SQL Server Books Online.

Also check that your login account has all necessary permissions under specific database.

4. SQL Queries

Query notifications are supported for SELECT statements that meet the following requirements:

  • The projected columns in the SELECT statement must be explicitly stated, and table names must be qualified with two-part names. Notice that this means that all tables referenced in the statement must be in the same database.
  • The statement may not use the asterisk (*) or table_name.* syntax to specify columns.
  • The statement may not use unnamed columns or duplicate column names.
  • The statement must reference a base table.
  • The projected columns in the SELECT statement may not contain aggregate expressions unless the statement uses a GROUP BY expression. When a GROUP BY expression is provided, the select list may contain the aggregate functions COUNT_BIG() or SUM(). However, SUM() may not be specified for a nullable column. The statement may not specify HAVING, CUBE, or ROLLUP.
  • A projected column in the SELECT statement that is used as a simple expression must not appear more than once.
  • The statement must not include PIVOT or UNPIVOT operators.
  • The statement must not include the INTERSECT or EXCEPT operators.
  • The statement must not reference a view.
  • The statement must not contain any of the following: DISTINCT, COMPUTE or COMPUTE BY, or INTO.
  • The statement must not reference server global variables (@@variable_name).
  • The statement must not reference derived tables, temporary tables, or table variables.
  • The statement must not reference tables or views from other databases or servers.
  • The statement must not contain subqueries, outer joins, or self-joins.
  • The statement must not reference the large object types: text, ntext, and image.
  • The statement must not use the CONTAINS or FREETEXT full-text predicates.
  • The statement must not use rowset functions, including OPENROWSET and OPENQUERY.
  • The statement must not use any of the following aggregate functions: AVG, COUNT(*), MAX, MIN, STDEV, STDEVP, VAR, or VARP.
  • The statement must not use any nondeterministic functions, including ranking and windowing functions.
  • The statement must not contain user-defined aggregates.
  • The statement must not reference system tables or views, including catalog views and dynamic management views.
  • The statement must not include FOR BROWSE information.
  • The statement must not reference a queue.
  • The statement must not contain conditional statements that cannot change and cannot return results (for example, WHERE 1=0).

5. Alter authorization on database

Try to change db owner first to sa.

ALTER AUTHORIZATION ON DATABASE::[CDR] TO [SA];

6. Setup new instance of Service Broker (renew, enable)

DON’T FORGET TO SWITCH DATABASE TO SINGLE_USER MODE BEFORE RUNNING THIS COMMAND!

1) ALTER DATABASE xDB SET NEW_BROKER WITH ROLLBACK IMMEDIATE;

2) ALTER DATABASE xDB SET NEW_BROKER

3) ALTER DATABASE xDB SET ENABLE_BROKER;

Then I checked that it had worked:

SELECT is_broker_enabled FROM sys.databases WHERE name = ‘MyDB’;

7. When using SqlDependency

· Ensure you call SqlDependency.Start(connectionString) before subscribing to any notifications

· Ensure you are not calling SqlDependency.Stop(connectionString) too early, i.e. when some notifications still could be raised

LINKS:

http://msdn.microsoft.com/en-us/library/t9×04ed2(VS.80).aspx

http://msdn.microsoft.com/en-us/library/ms131048.aspx

http://social.msdn.microsoft.com/Forums/en-US/sqlservicebroker/thread/505778e4-be04-4673-892c-917b91872aef/

http://social.msdn.microsoft.com/forums/en-US/sqlservicebroker/thread/bd195da8-93b2-43c6-8f59-674f5fb9d618/

http://www.codeproject.com/KB/database/SqlDependencyPermissions.aspx?msg=2487937#xx2487937xx

http://social.msdn.microsoft.com/Forums/en-US/sqlservicebroker/thread/f5419d1c-e63e-4012-ac7d-857b13fed6b3/

Here is a link to photos from the WPF Workshop given by Readify guys happened in Melbourne last Saturday:

WPF Workshop Photos

It’s relatively unknown HTML tag that works like alternative description when your browser doesn’t support scripting or when JavaScript is disabled. While this one is not so relevant for modern desktop browsers, it becomes relevant again when creating applications for mobile browsers.

Example of use:

<script type=”text/javascript”>
document.write(“Hello World!”)
</script>
<noscript>Your browser does not support JavaScript!</noscript>

There are several important concepts related to new dynamic types in C# 4.0 which could be a bit confusing without correct understanding of boxing/unboxing of value types that happens during the dynamic binding.

Here is good example from Sam Ng’s blog:

public struct S
{
    public int i;
}

public class D
{
    public S s;
    public static void Main()
    {
        dynamic d = new D();
        d.s = default(S);
        d.s.i = 10;
        Console.WriteLine(d.s.i);
    } 

We would intuitively expect the value ‘10′ to be printed in the console. However, the value ‘0′ is printed instead. Core thing is any of the dotted expressions were to bind to a value type, that value will be boxed (and hence a copy would be made), and further dots into it would be made on the copy of the value, and not the initial value as would be expected.

The guys from C# team currently on the way of investigation if it’s reasonable to add any smart compile time logic to handle things like this for dynamic usage. But from my perspective main thing is to understand the reason for this – real value type was unboxed during dotted expression and modified, but wasn’t(!) boxed again.

I’m usually reading all MSDN Architecture Journal articles and I found recently that there is a simple and comfort way to read and store its articles. Architecture Journal Reader is not something new, but I’ve rediscovered it recently and find it really convenient and helpful.

It contains list of all issued journals and detailed table of content for each. Pretty much it looks like newspaper and really intuitive in use and referencing.

architecturejournal

Here is direct link to Download Page – Download Architecture Journal Reader

During last couple of days I had to make lots of TFS tasks with my colleagues in Dev Centre. Part of them was bulk of administrative tasks to assign correct permissions to different areas of the TFS such as Source Control, Share Point, Reports and other. All this areas have independent roles and permissions configuration and it’s not really easy using standard tools to give the same permissions to someone in these different sub-areas. What we’ve discovered was the TFS Administrator tool on CodePlex that allows you easily to manage multiple permission sets for different projects and users. We found this as fast enough way for tasks we have, and I could recommend it to use in such scenarios.

TFS Administrator Screenshot

TFS Administrator Screen shot

I’ve experienced some problems with VPN connections after installing OneCare from Microsoft. As result of diving into configuration I’ve found that there is an option under the Firewall configuration options that denies any VPN connections by default.

In order to fix this you’ll need to go to Advanced settings of Firewall and under the ports and protocols tab put the mark near the VPN networks (IPsec or PPTP) in the checkbox list as shown in the picture below.

VPN setting inside OneCare configuration

VPN setting inside OneCare configuration

If you want to check availablity of some remote host in your powershell script you can use next simple piece of code to do exactly this:$MachineName = “mo-laptop”

$PingStatus = Gwmi Win32_PingStatus -Filter “Address =’$MachineName’” | Select-Object StatusCode

if($PingStatus.StatusCode -eq 0)

{

echo $MachineName

echo “Ping Success”

}

else

{

echo $MachineName

echo “Ping Failed”

}

If you want continue playing with Windows 7 PDC installation after 30-days trial period ended, you can “rearm” it and use for a bit longer period of time using this simple approach:

  1. Install Windows 7 without any product activation key.
  2. After installation is completed, use the Windows 7 for 30 days and wait for the remaining days left to activate Windows counting down to 0, or almost zero.
  3. When the activation grace period (or evaluation trial period) is almost expired or ended, log on to Windows 7 desktop, and open a Command Prompt window (i.e. type Cmd in Start Search and hit Enter).
  4. Type any of the following commands into the command prompt, and then hit Enter:sysprep /generalize

    slmgr.vbs –rearm

    rundll32 slc.dll,SLReArmWindows

    slmgr /rearm

  5. Reboot Windows 7 to enjoy another 30 days of free usage without worrying about activation nor even need to crack Windows 7.
  6. When the activation grace period countdown timer almost running down to 0 again, repeat the ‘rearm’ trick to enjoy another 30 days of Windows 7 for free. User can run the rearm command for maximum of 3 times.

After this you will require to activate it with proper product key or install other trial version, that probably will be released soon.

from http://www.mydigitallife.info/2008/11/06/how-to-rearm-and-extend-free-usage-activation-grace-period-of-windows-7-to-120-days/

Next Page »