Call now: (800) 766-1884  


 SQL Server Tips
 SQL Server Training

 SQL Server Consulting
 SQL Server Support
 SQL Server Remote DBA

 SQL Server Scripts
 Scripts Menu




  SQL Server Tips by Gama and Naughter


Before we describe this function we must first explain what is known as a “NetBIOS Message Alias”. If you are familiar with sockets programming then you can think of it as an end point e.g. Port 80 on machine X. In NetBIOS, a simple string of up to 15 characters identifies these end points. By default a number of these message aliases will already be defined by Windows as it starts up. Normally you will have the current user, the current machine and the current domain or workgroup. You can see all the currently defined names by issuing the following from a command prompt: “nbtstat –N”. To add a name using the command line, you can use “NET NAME NameToAdd /ADD”. Allowing you to add new names to the list will allow you to customize the “From” parameter of XP_NET_SEND which is described later. This XP takes a single string parameter, which is the name of the message alias to add. The underlying SDK function used in this XP is “NetMessageNameAdd”. Because this function only accepts UNICODE strings, we use the XP_PT_UNICODETEXT and XP_UNICODETEXT macros supplied by the XP++ framework to handle the Unicode string manipulation. The following code snippet shows how we declare the 1 input string parameter for this XP and then obtain this parameter as a UNICODE string prior to using it in the call to “NetMessageNameDel”:


BOOL CNetAddNameExtendedStoredProcedure::Run()
//Validate our parameters

//Get the parameters
wchar_t* pszMessageName = XP_UNICODETEXT(m_pParameterData[ADD_MESSAGE_NAME_INDEX].m_Data);

The above book excerpt is from:

Super SQL Server Systems
Turbocharge Database Performance with C++ External Procedures

ISBN: 0-9761573-2-2
Joseph Gama, P. J. Naughter  


Burleson Consulting Remote DB Administration







Burleson is the America's Team

Note: The pages on this site were created as a support and training reference for use by our staff of DBA consultants.  If you find it confusing, please exit this page.

Errata?  SQL Server technology is changing and we strive to update our SQL Server support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:and include the URL for the page.

Burleson Consulting
SQL Server database support


Copyright © 1996 -  2013 by Vaaltech Web Services. All rights reserved.

Hit Counter