A personal repository of technical notes. - CSC

Windows Search Filtering

Problem
Need to be able to narrow down search results in Windows 7. Unlike Windows XP, there are no boxes to check.

Solution
Use search filters by clicking on filters in search box:
  1. Open the folder to search.
  2. Click in the search box, and then click a search filter. (Ex: Kind:, Date modified:, Type:, Size:)
  3. Click one of the available options.
Use keywords to refine a search:
  • You may filter on a property that does not appear when you click in the search box by using special keywords.
Keyword Examples

filename:~=backup Files and folders whose names contain "backup"
filename:=backup Files and folders named exactly "backup"
filename:~<backup Files and folders whose names begin with "backup"
filename:~>backup Files and folders whose names end with "backup"
filename:~=backup kind:=document Only files that are considered to be "documents" whose names contain "backup"
filename:~=backup kind:folder Only folders whose names contain "backup"
filename:~=ClassLibrary filename:~=dll.refresh Files whose names contain "classlibrary" and end with "dll.refresh"

References
"Advanced Tips for Searching in Windows." Advanced Tips for Searching in Windows. N.p., n.d. Web. 14 Aug. 2012.
<http://windows.microsoft.com/en-gb/windows7/advanced-tips-for-searching-in-windows>.

SQL Join Types

[INNER] JOIN
All matching pairs of rows are returned. Discards unmatched rows from both tables. Default type of join.

LEFT [ OUTER ] JOIN
Specifies that all rows from the left table not meeting the join condition are included in the result set, and output columns from the other table are set to NULL in addition to all rows returned by the inner join.

RIGHT [OUTER] JOIN
Specifies all rows from the right table not meeting the join condition are included in the result set, and output columns that correspond to the other table are set to NULL, in addition to all rows returned by the inner join.

FULL [ OUTER ] JOIN
Specifies that a row from either the left or right table that does not meet the join condition is included in the result set, and output columns that correspond to the other table are set to NULL. This is in addition to all rows typically returned by the INNER JOIN.

See also FULL OUTER JOIN Not Working

CROSS JOIN
Cross joins return all rows from the left table. Each row from the left table is combined with all rows from the right table.

References

joins, using. "Join Fundamentals." MSDN – Explore Windows, Web, Cloud, and Windows Phone Software Development. N.p., n.d. Web. 13 Aug. 2012.
http://msdn.microsoft.com/en-us/library/ms191517%28v=sql.100%29

"Using Joins." MSDN – Explore Windows, Web, Cloud, and Windows Phone Software Development. N.p., n.d. Web. 13 Aug. 2012.
http://msdn.microsoft.com/en-us/library/ms191472%28v=sql.100%29

"Null Values and Joins." MSDN – Explore Windows, Web, Cloud, and Windows Phone Software Development. N.p., n.d. Web. 13 Aug. 2012.
http://msdn.microsoft.com/en-us/library/ms190409%28v=sql.100%29

How to Force SQL Server Job Step to Fail

Problem

Need to force an operating system job type to fail.

Solution

In a .NET application, set the ExitCode of the Environment object to a value other than zero. C#.NET example:

private static void TestSqlJobOutput()
{
       System.Console.WriteLine("Sample Error Message 1"); // Shows up in SQL Server job history log.
       Environment.ExitCode = 1; // Causes SQL Server job step to fail when application ends.
}

How to Write Output to SQL Server Job History Log

Problem

Need to generate custom output in job history of an operating system job type.

Solution

1) Check this box in SQL Server Management Studio: Job Step Properties / Advanced / Include step output in history

2) Generate output in job's executable. C#.NET example:

private static void TestSqlJobOutput()
{
       System.Console.WriteLine("Sample Error Message 1"); // Shows up in SQL Server job history log.
       Environment.ExitCode = 1; // Causes SQL Server job step to fail when application ends.
}