Showing posts with label Microsoft. Show all posts
Showing posts with label Microsoft. Show all posts

Friday, June 07, 2013

Microsoft SQL Select Date Range

Select an arbitrary range of dates in Microsoft SQL, which can be joined against data with date gaps using a LEFT OUTER JOIN on the date range table.

DECLARE @DateStart datetime = '01-01-2013';
DECLARE @DateEnd   datetime = DATEADD(day, 29, @DateStart);

WITH DateRange(Day) AS (
    SELECT    @DateStart AS [Day]
    UNION ALL
    SELECT    DateRange.Day + 1
    FROM      DateRange
    WHERE     DateRange.Day < @DateEnd
)
SELECT    CONVERT(date, DateRange.Day) AS [Date]
FROM      DateRange

Monday, October 08, 2012

Microsoft SQL Failover Partner

Connection String
The SQL Native Client data providers introduced a new connection string keyword to support some of the new features in SQL Server 2005. The failover partner keyword is used to specify the second partner of the database mirroring session in the connection string. SQL Native Client connects to whichever server is the principal at the time the connection is made.

Following is an example connection string:

Data Source=SQLA\INST1;Failover Partner=SQLB\INST1;Initial Catalog=DBMTest;Integrated Security=True

For more information on connection attributes when using SQL Native Client with ADO.NET, OLE DB, and ODBC, see Using Connection String Keywords with SQL Native Client in SQL Server 2005 Books Online.

The syntax of the failover partner keyword is slightly different from one connection method to another:

  • OLE DB: FailoverPartner (no space between “Failover” and “Partner”)
  • ODBC: Failover_Partner (underscore between “Failover” and “Partner”)
  • ADO.NET: Failover Partner (one space between “Failover” and “Partner”)
  • JDBC: failoverPartner (no space between “failover” and “Partner”)

Note: Keywords are not case sensitive. Make sure there is no white space before or after the keyword, before or after the semi-colons, and before or after the equal to operator in the connection string.

Source: http://technet.microsoft.com/en-us/library/cc917713.aspx#EDAA

Monday, November 15, 2010

Microsoft SQL Insert Identity

Insert an identity into a table:

At any time, only one table in a session can have the IDENTITY_INSERT property set to ON. If a table already has this property set to ON, and a SET IDENTITY_INSERT ON statement is issued for another table, Microsoft® SQL Server™ returns an error message that states SET IDENTITY_INSERT is already ON and reports the table it is set ON for.

If the value inserted is larger than the current identity value for the table, SQL Server automatically uses the new inserted value as the current identity value.

Example:

-- Create products table.
CREATE TABLE products
(id int IDENTITY PRIMARY KEY, product varchar(40))
GO

-- Inserting values into products table.
INSERT INTO products (product) VALUES ('screwdriver')
INSERT INTO products (product) VALUES ('hammer')
INSERT INTO products (product) VALUES ('saw')
INSERT INTO products (product) VALUES ('shovel')
GO

-- Create a gap in the identity values.
DELETE products
WHERE product = 'saw'
GO

SELECT *
FROM products
GO

-- Attempt to insert an explicit ID value of 3;
-- should return a warning.
INSERT INTO products (id, product)
VALUES (3, 'garden shovel')
GO

-- SET IDENTITY_INSERT to ON.
SET IDENTITY_INSERT products ON
GO

-- Attempt to insert an explicit ID value of 3
INSERT INTO products (id, product)
VALUES (3, 'garden shovel')
GO

SELECT *
FROM products
GO

-- Drop products table.
DROP TABLE products
GO

Source: Microsoft Developer Network

Friday, August 13, 2010

Microsoft SQL MD5 Support

Microsoft SQL includes support for the MD5 hashing algorithm:

SELECT SUBSTRING(master.dbo.fn_varbintohexstr(HASHBYTES('MD5', 'String to MD5')), 3, 32);

Tuesday, July 13, 2010

New Microsoft Outlook Social Connectors Released

Microsoft has released Outlook Social Connectors for Facebook and Windows Live Messenger, both social connectors include 32 bit and 64 bit versions. Additionally LinkedIn and MySpace recently updated their social connectors; however, they have not yet released 64 bit versions.

Outlook Social Connectors bring all of your social networks into Microsoft Outlook.

Wednesday, February 24, 2010

Microsoft Outlook Social Connector

Outlook Social Connector 32 bit (Beta) is now available for download:

Stay up-to-the-minute with the people in your networks by accessing everything from e-mail threads to status updates in one single, centralized view.

Download Outlook Social Connector 32 bit (Beta)

Friday, February 13, 2009

Microsoft Excel Workbook Links

Opening certain Excel or Comma Separated Value (CSV) files in Excel may (correctly or incorrectly) produce the following error message:

This workbook contains one or more links that cannot be updated.

Depending on how the file was opened (either through the GUI or programmatically), the following message box may appear:

image

Clicking the "Edit Links..." button opens the following window:

image

Selecting just about any option continues loading the file; however, if the files was accessed programmatically, user intervention is required through the GUI (even when the application has set Application.DisplayAlerts = false).

To disable the automatic update of Workbook links in Microsoft Excel 2007, which suppresses the prompt:

  • Open Excel
  • Click on the Microsoft Office button (in the upper left corner of the application)
  • Click "Excel Options" near the bottom of the menu
  • Select "Trust Center" tab
  • Click the "Trust Center Settings..." button
  • Select "External Content" tab
  • Select "Disable automatic update of Workbook Links"
  • Click "OK" button to close the "Trust Center" window
  • Click "OK" button to close the "Excel Options" window

Addition information pertaining the issue is available through Microsoft's support website:

Saturday, January 03, 2009

MySQL ISNULL() Function

If you are familiar with Microsoft SQL you may have used the ISNULL() function; the equivalent function in MySQL is IFNULL().

In Microsoft SQL, the syntax is as follows:

SELECT ISNULL(NULL, 'Some Value')

In MySQL, the syntax is as follows:

SELECT IFNULL(NULL, 'Some Value')

Saturday, October 04, 2008

Microsoft to Ship jQuery with Visual Studio

Microsoft has announced they will be shipping the JavaScript jQuery library with Visual Studio. From the jQuery Blog:

We have two pieces of fantastic, albeit serendipitous, news today: Both Microsoft and Nokia are taking the major step of adopting jQuery as part of their official application development platform. Not only will they be using it for their corporate development but they will be providing it as a core piece of their platform for developers to build with.

This is important news for developers because they will now be able to standardize on the jQuery library for all JavaScript development.

Sunday, September 28, 2008

Windows Live ID Web Authentication SDK

Recently I have been researching Single Sign-On options to streamline the user's experience. One interesting provider I found is Windows Live ID Web Authentication, which allows visitors to logon to a website using their Hotmail or Windows Live account. Microsoft describes the Windows Live ID Web Authentication SDK as follows:

The Windows Live™ ID Web Authentication software development kit (SDK) gives you a platform-neutral way to bring the power of the Windows Live ID authentication service to your own Web site.

According to Microsoft the benefits include:

  • Ability to use Windows Live gadgets and controls to incorporate authenticated Windows Live services into websites
  • HTTP-based, platform-neutral interface for implementing Windows Live ID authentication in existing websites, even if they are hosted by third-parties
  • Freedom from the technical details of authentication
  • Huge user base: any of the millions of users who have a Windows Live ID can login to Windows Live ID Web Authentication websites

Download Windows Live Web Authentication SDK 1.1

Manage Windows Live Web Authentication Websites

Saturday, September 27, 2008

Windows Live Messenger

To remove advertisements from Windows Live Messenger without installing a patch or crack:

  1. Run "Notepad.exe"
    Note: In Windows Vista, run "Notepad.exe" as an Administrator by right-clicking on the shortcut and selecting "Run as administrator"

  2. Open the host file
    "C:\Windows\System32\drivers\Etc\host"

  3. Add the following lines to the bottom of the file:
    127.0.0.1    rad.msn.com
    127.0.0.1    rad.live.com

  4. Save the file and restart Windows Live Messenger
    (if it was already running)

To restore advertisements in Windows Live Messenger:

  1. Run "Notepad.exe"
    Note: In Windows Vista, run "Notepad.exe" as an Administrator by right-clicking on the shortcut and selecting "Run as administrator"

  2. Open the host file
    "C:\Windows\System32\drivers\Etc\host"

  3. Remove the following lines from the file:
    127.0.0.1    rad.msn.com
    127.0.0.1    rad.live.com

  4. Save the file and restart Windows Live Messenger
    (if it was already running)

Windows Live Alerts

Microsoft recently released a new version of Windows Live Alerts, which provides several exciting new features:

Windows Live Alerts enables customers to instantly connect to the information that they care most about via Windows Live Messenger, Mobile, and Hotmail.

When you update your blog or other RSS feed, Windows Live Alerts will automatically send a headline to all subscribed readers. The power of Windows Live Alerts is that users can choose where and when to receive alerts.

Learn about the new RSS feature of Windows Live Alerts.

Subscribe to Windows Live Alerts for this website by clicking on the following button (you can unsubscribe at any time by visiting alerts.live.com):

Tuesday, July 01, 2008

WPF TransitionContainer Control

The following video demonstrates the Microsoft WPF TransitionContainer control, which provides animated transitions between ViewStates:

The TransitionContainer control was written by Pavan Podila.

WPF ElementFlow Control

The following videos demonstrate the Microsoft WPF ElementFlow control, which supports CoverFlow, Carousel, and many other ViewStates:

The ElementFlow control was written by Pavan Podila.

Tuesday, June 17, 2008

XNA Animation Library

XNAnimation is a skeletal animation library for XNA. The library allows developers to easily manipulate, playback, interpolate and blend animations. See the following video for a demonstration:

Sunday, June 15, 2008

XNA Creators Club Tour

Checkout the following video for a quick introduction to Community Games Beta on Xbox Live. The video covers the following topics:

Dream. Build. Play. 2008

Microsoft is holding another "Dream. Build. Play." competition for aspiring game developers. The games must target the Xbox 360 platform. Prizes includes the following:
  • First Prize $40,000 (USD)
  • Second Prize $20,000 (USD)
  • Third Prize $10,000 (USD)
  • Fourth Prize $5,000 (USD)

This year all entrants will receive a free 12-month XNA Creators Club trial membership.

The entry deadline is September 23, 2008.

Saturday, May 31, 2008

Multi-Touch Technology

According to a News.com article, Microsoft plans to include a multitouch interface in Windows 7. The really exciting news is the multitouch interface should work with existing touchscreen hardware as demonstrated on a Dell laptop in the following video: