SQL Server User Education

SQL Server documentation team blog

  • SQL Server 2008 February CTP Books Online Now Available

    Hi everybody,

     I realize it has been quite awhile since my last post, sorry about that. We on the SQL Server team have been very busy lately, with the joint SQL Server/Visual Studio/Windows Server Launch coming up next week. As part of that, we have been working on making improvements and updates to the CTP documentation that was released back in November. The February CTP update was released yesterday, so please download it and try it out! The English version of the SQL Server 2008 February CTP Books Online is available from the Microsoft Download Center at:

    http://www.microsoft.com/downloads/details.aspx?FamilyID=19db0b42-a5b2-456f-9c5c-f295cdd58d7a&DisplayLang=en.

    To access other language versions, use the Change Language control on that page.

    Thanks, and enjoy!

    Tai Yee
    SQL Server User Education

  • Localized SQL Server 2005 JDBC Driver 1.2 Released!

    Hi everybody, welcome back from the holidays. Hope you all are ready to jump back into the world of SQL Server content and documentation! We had one release over the holidays that may not have gotten much notice while folks were celebrating and taking vacation. Localized versions of the SQL Server 2005 JDBC Driver 1.2 are now available for download from the Microsoft Download Center. Documentation for this release is included with the driver download, and it is also available in the MSDN Library. Here are all the urls:

    Chinese (Simplified)
    Download Center
    http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&FamilyID=c47053eb-3b64-4794-950d-81e1ec91c1ba
    MSDN Library
    http://msdn2.microsoft.com/zh-cn/library/bb418498.aspx

    Chinese (Traditional)

    Download Center

    http://www.microsoft.com/downloads/details.aspx?displaylang=zh-tw&FamilyID=c47053eb-3b64-4794-950d-81e1ec91c1ba

    MSDN Library

    http://msdn2.microsoft.com/zh-tw/library/bb418498.aspx

     

    French

    Download Center

    http://www.microsoft.com/downloads/details.aspx?displaylang=fr&FamilyID=c47053eb-3b64-4794-950d-81e1ec91c1ba

    MSDN Library

    http://msdn2.microsoft.com/fr-fr/library/bb418498.aspx

     

    German

    Download Center

    http://www.microsoft.com/downloads/details.aspx?displaylang=de&FamilyID=c47053eb-3b64-4794-950d-81e1ec91c1ba

    MSDN Library

    http://msdn2.microsoft.com/de-de/library/bb418498.aspx

     

    Italian

    Download Center

    http://www.microsoft.com/downloads/details.aspx?displaylang=it&FamilyID=c47053eb-3b64-4794-950d-81e1ec91c1ba

    MSDN Library

    http://msdn2.microsoft.com/it-it/library/bb418498.aspx

     

    Japanese

    Download Center

    http://www.microsoft.com/downloads/details.aspx?displaylang=ja&FamilyID=c47053eb-3b64-4794-950d-81e1ec91c1ba

    MSDN Library

    http://msdn2.microsoft.com/ja-jp/library/bb418498.aspx

     

    Korean

    Download Center

    http://www.microsoft.com/downloads/details.aspx?displaylang=ko&FamilyID=c47053eb-3b64-4794-950d-81e1ec91c1ba

    MSDN Library

    http://msdn2.microsoft.com/ko-kr/library/bb418498.aspx

     

    Spanish

    Download Center

    http://www.microsoft.com/downloads/details.aspx?displaylang=es&FamilyID=c47053eb-3b64-4794-950d-81e1ec91c1ba

    MSDN Library

    http://msdn2.microsoft.com/es-es/library/bb418498.aspx

     

    Swedish

    Download Center

    http://www.microsoft.com/downloads/details.aspx?displaylang=sv&FamilyID=c47053eb-3b64-4794-950d-81e1ec91c1ba

    MSDN Library

    (Swedish version of MSDN Library doesn’t exist yet)

    thanks, and Happy New Year!

    Tai Yee
    Microsoft SQL Server User Education

  • New Utilities for SQL Server Released

    The Microsoft SQL Server support team uses several internally-written utilities to make it easier to work on a typical customer support case. These utilities may also be useful to database developers and system administrators who work with Microsoft SQL Server 2000 and Microsoft SQL Server 2005. To learn more about these utilities, see the blog entry on the SQL Server http://blogs.msdn.com/psssql/archive/2007/12/18/rml-utilities-for-microsoft-sql-server-released.aspx.

    Tai Yee
    SQL Server User Education

  • Try the puzzle!

    our old friend and comrade Buck Woody has come up with a fun and challenging puzzle. Great way to spend some time on a Friday and test your knowledge. Check out his puzzle on his blog at http://blogs.msdn.com/buckwoody/archive/2007/12/10/puzzle-of-the-month-this-one-with-prizes.aspx.

    Have a great weekend everybody!

    Tai Yee
    SQL Server User Education

  • Use the correct "Data Sources (ODBC)" service

    On an 64-bit operating system (Itanium or x64), Windows installs two versions of the "Data Sources (ODBC)" service: a 32-bit version and a 64-bit version.  A 32-bit native (non-CLR) data application that will run under WOW64 needs to use a data source that was created with the 32-bit "Data Sources (ODBC)" service.

    If you will build and run an application as a 32-bit application on a 64-bit operating system, you must create the ODBC data source with the ODBC Administrator in %windir%\SysWOW64\odbcad32.exe.

    David Schwartz
    SQL Server User Education

  • SQL Server 2005 Books Online -- latest release now available for download

    Well, it's been a long time coming. We finally got the technical issues resolved and have completed testing on the SQL Server 2005 Books Online release that we published to the MSDN and TechNet Libraries in September. The downloadable version is now available on the Microsoft Download Center at: http://www.microsoft.com/downloads/details.aspx?FamilyID=be6a2c5d-00df-4220-b133-29c1e0b6585f&DisplayLang=en. Next steps for us are to finish work on the localized versions and publish those to both MSDN/TechNet Libraries and the Download Center.

     Happy Holidays!

    Tai Yee
    Microsoft SQL Server User Education

  • November CTP of SQL Server 2008 does not install SQL Server Native Client SDK files by default

    To develop data access applications with SQL Server Native Client, you have to manually run sqlncli.msi to install sqlncli.h and sqlncli.lib.  sqlncli.msi is on your installation media.

    This installation bug in the November SQL Server CTP is schedule to be fixed in the next CTP. 

    David Schwartz
    SQL Server User Education

  • SQL Server 2008 CTP (November 2007) Available Now

    I am pleased to announce that the SQL Server 2008 Community Technology Preview (CTP) for November 2007 is now available. The SQL Server development team uses your feedback to help refine and enhance product features. Download the CTP today and share your feedback.

    This CTP is available in two downloadable formats: an image file that you can use to burn your own DVD and a self-extracting executable file that will allow you to download and install without a DVD burner (the Express version of the package is only available in this format). All CTP software automatically expires after 180 days.

    The SQL Server 2008 CTP release includes a CTP version of the Books Online product documentation. You can also download SQL Server 2008 CTP Books Online separately. And don't forget to check out the SQL Server 2008 CTP Readme file as well.

    Tai Yee
    Microsoft SQL Server User Education

  • Using OLE DB Extensions in SQL Server Native Client 10.0 (SQL Server 2008) to Change the Password of a SQL Server Authentication User Account

    The SQL Server Native Client team received some feedback asking for a code sample that shows how to use OLE DB extensions in SQL Server Native Client to change a password for a SQL Server Authentication user account. 

     Here's the code.  Note that before you run this code, you need to modify it to enter the name of the user, the old password, and the new password:

    David Schwartz
    SQL Server User Education

    =====================================

     void InitializeAndEstablishConnection();

    #define STATUSDUMP(status)  case status : wprintf(L"status"); break;

    #define UNICODE
    #define DBINITCONSTANTS
    #define INITGUID

    #include <assert.h>
    #include <windows.h>
    #include <stdio.h>
    #include <stddef.h>
    #include <IOSTREAM>
    #include <cguid.h>
    #include <oledb.h>
    #include <oledberr.h>

    #include <SQLNCLI.h>

    LPMALLOC pMalloc = NULL;
    IDBInitialize * pIDBInitialize = NULL;
    HRESULT hr;

    void DumpErrorInfo (IUnknown* pObjectWithError, REFIID IID_InterfaceWithError);
    void DumpErrorInfo (IUnknown* pObjectWithError, REFIID IID_InterfaceWithError, BOOL &has_sql_errors);

    int main() {
       // All the initialization activities in a separate function.
       InitializeAndEstablishConnection();

       if ( FAILED( pIDBInitialize->Uninitialize() ) )
          // Uninitialize is not required, but fails if an interface was not released.
          printf("Problem uninitializing.\n");

       pIDBInitialize->Release();
       CoUninitialize();
    };

    void InitializeAndEstablishConnection() {
       IDBProperties * pIDBProperties = NULL;
       const ULONG nInitProps = 4;
       DBPROP InitProperties[nInitProps];
       const ULONG nSSInitProps = 1;
       DBPROP SSInitProperties[nSSInitProps];

       const ULONG nPropSet = 2;
       DBPROPSET rgInitPropSet[nPropSet];

       // Initialize the COM library.
       CoInitialize(NULL);
       CoGetMalloc(1, &pMalloc);

       CLSID clsid;
       CLSIDFromProgID(L"SQLNCLI10", &clsid);

       // Obtain access to the SQLOLEDB provider.
       hr = CoCreateInstance( clsid, NULL, CLSCTX_INPROC_SERVER, IID_IDBInitialize, (void **) &pIDBInitialize);
       if (FAILED(hr))
          printf("Failed in CoCreateInstance().\n");

       // Initialize the property values needed to establish the connection.
       for (int i = 0; i < nInitProps; i++)
          VariantInit(&InitProperties[i].vValue);

       // Specify database name.
       InitProperties[0].dwPropertyID = DBPROP_INIT_CATALOG;
       InitProperties[0].vValue.vt = VT_BSTR;
       // Change the following line to use any database on your server
       InitProperties[0].vValue.bstrVal = SysAllocString(L"master");
       InitProperties[0].dwOptions = DBPROPOPTIONS_REQUIRED;
       InitProperties[0].colid = DB_NULLID;

       InitProperties[1].dwPropertyID = DBPROP_AUTH_USERID;
       InitProperties[1].vValue.vt = VT_BSTR;
       // Modify the following line to add the user ID of a SQL Authentication account on your server
       InitProperties[1].vValue.bstrVal = SysAllocString(L"");
       InitProperties[1].dwOptions = DBPROPOPTIONS_REQUIRED;
       InitProperties[1].colid = DB_NULLID;

       InitProperties[2].dwPropertyID = DBPROP_AUTH_PASSWORD;
       InitProperties[2].vValue.vt = VT_BSTR;
       // Modify the following line to add the new SQL Authentication password
       InitProperties[2].vValue.bstrVal = SysAllocString(L"");
       InitProperties[2].dwOptions = DBPROPOPTIONS_REQUIRED;
       InitProperties[2].colid = DB_NULLID;

       InitProperties[3].dwPropertyID = DBPROP_INIT_DATASOURCE;
       InitProperties[3].vValue.vt = VT_BSTR;
       InitProperties[3].vValue.bstrVal = SysAllocString(L"(local)");
       InitProperties[3].dwOptions = DBPROPOPTIONS_REQUIRED;
       InitProperties[3].colid = DB_NULLID;

       SSInitProperties[0].dwPropertyID = SSPROP_AUTH_OLD_PASSWORD;
       SSInitProperties[0].vValue.vt = VT_BSTR;
       // Modify the following line to specify the existing SQL Authentication password
       SSInitProperties[0].vValue.bstrVal = SysAllocString(L"");
       SSInitProperties[0].dwOptions = DBPROPOPTIONS_REQUIRED;
       SSInitProperties[0].colid = DB_NULLID;

       rgInitPropSet[0].guidPropertySet = DBPROPSET_DBINIT;
       rgInitPropSet[0].cProperties = nInitProps;
       rgInitPropSet[0].rgProperties = InitProperties;

       rgInitPropSet[1].guidPropertySet = DBPROPSET_SQLSERVERDBINIT;
       rgInitPropSet[1].cProperties = nSSInitProps;
       rgInitPropSet[1].rgProperties = SSInitProperties;

       // Set initialization properties.
       hr = pIDBInitialize->QueryInterface( IID_IDBProperties, (void **)&pIDBProperties);

       if (FAILED(hr))
          printf("Failed to obtain IDBProperties interface.\n");

       hr = pIDBProperties->SetProperties( nPropSet, rgInitPropSet);

       if (FAILED(hr))
          printf("Failed to set initialization properties.\n");

       pIDBProperties->Release();

       // establish connection to the data source.
       DWORD now = GetTickCount();

       if ( FAILED(pIDBInitialize->Initialize()) ) {
          printf("Problem in initializing.\n");
          DumpErrorInfo(pIDBInitialize, IID_IDBInitialize);
       }

       DWORD tookms = GetTickCount() - now;
       printf("Connection took %d ms.\n", tookms);
    }

    // DumpErrorInfo queries SQLOLEDB error interfaces, retrieving available status
    // or error information. This version is called when SQL Server errors are not expected.
    void DumpErrorInfo (IUnknown* pObjectWithError, REFIID IID_InterfaceWithError) {
       BOOL has_sql_errors;
       DumpErrorInfo (pObjectWithError, IID_InterfaceWithError, has_sql_errors);
    }

    // DumpErrorInfo queries SQLOLEDB error interfaces, retrieving available status
    // or error information. This version is called when an SQL Server error could occur.
    void DumpErrorInfo (IUnknown* pObjectWithError, REFIID IID_InterfaceWithError, BOOL &has_sql_errors ) {
       // Interfaces used in the example.
       IErrorInfo * pIErrorInfoAll = NULL;
       IErrorInfo * pIErrorInfoRecord = NULL;
       IErrorRecords * pIErrorRecords = NULL;
       ISupportErrorInfo * pISupportErrorInfo = NULL;
       ISQLErrorInfo * pISQLErrorInfo = NULL;
       ISQLServerErrorInfo * pISQLServerErrorInfo = NULL;

       // Number of error records.
       ULONG nRecs;
       ULONG nRec;

       // Basic error information from GetBasicErrorInfo.
       ERRORINFO errorinfo;

       // IErrorInfo values.
       BSTR bstrDescription;
       BSTR bstrSource;

       // ISQLErrorInfo parameters.
       BSTR bstrSQLSTATE;
       LONG lNativeError;

       // ISQLServerErrorInfo parameter pointers.
       SSERRORINFO * pSSErrorInfo = NULL;
       OLECHAR * pSSErrorStrings = NULL;

       // Hard-code an American English locale for the example.
       DWORD MYLOCALEID = 0x0409;

       has_sql_errors = 0;

       // Only ask for error information if the interface supports it.
       if (FAILED(pObjectWithError->QueryInterface(IID_ISupportErrorInfo, (void**) &pISupportErrorInfo)))  
          wprintf(L"SupportErrorErrorInfo interface not supported\n");
       else if (FAILED(pISupportErrorInfo->InterfaceSupportsErrorInfo(IID_InterfaceWithError)))  
          wprintf(L"InterfaceWithError interface not supported\n");


       // Do not test the return of GetErrorInfo. It can succeed and return
       // a NULL pointer in pIErrorInfoAll. Simply test the pointer.
       GetErrorInfo(0, &pIErrorInfoAll);

       // Test to see if it's a valid OLE DB IErrorInfo interface exposing a list of records.
       if (pIErrorInfoAll != NULL)  {
          if (SUCCEEDED(pIErrorInfoAll->QueryInterface(IID_IErrorRecords, (void**) &pIErrorRecords))) {
             pIErrorRecords->GetRecordCount(&nRecs);

             // Within each record, retrieve information from each of the defined interfaces.
             for (nRec = 0; nRec < nRecs; nRec++) {
                ULONG errorno = nRecs - nRec - 1;
                // From IErrorRecords, get the HRESULT and a reference to the ISQLErrorInfo interface.
                pIErrorRecords->GetBasicErrorInfo(errorno, &errorinfo);
                pIErrorRecords->GetCustomErrorObject(errorno,IID_ISQLErrorInfo, (IUnknown**) &pISQLErrorInfo);

                // Display the HRESULT, then use the ISQLErrorInfo.
                wprintf(L"HRESULT:\t%#X\n", errorinfo.hrError);

                if (pISQLErrorInfo != NULL) {
                   pISQLErrorInfo->GetSQLInfo(&bstrSQLSTATE, &lNativeError);
                   // Display SQLSTATE and native error values.
                   wprintf(L"SQLSTATE:\t%s\nNative Error:\t%ld\n", bstrSQLSTATE, lNativeError);

                   // SysFree BSTR references.
                   SysFreeString(bstrSQLSTATE);

                   // Get the ISQLServerErrorInfo interface from
                   // ISQLErrorInfo before releasing the reference.
                   pISQLErrorInfo->QueryInterface(IID_ISQLServerErrorInfo, (void**) &pISQLServerErrorInfo);

                   pISQLErrorInfo->Release();
                }

                // Test to ensure the reference is valid, then get error information from ISQLServerErrorInfo.
                if (pISQLServerErrorInfo != NULL) {
                   pISQLServerErrorInfo->GetErrorInfo(&pSSErrorInfo, &pSSErrorStrings);

                   // ISQLServerErrorInfo::GetErrorInfo succeeds even when it
                   // has nothing to return. Test the pointers before using.
                   if (pSSErrorInfo) {
                      // Display the state and severity from the returned
                      // information. The error message comes from
                      // IErrorInfo::GetDescription.
                      wprintf(L"Error state:\t%d\nSeverity:\t%d\n", pSSErrorInfo->bState, pSSErrorInfo->bClass);
                      wprintf(L"Procedure:\t%s\nLine:\t%d\n", pSSErrorInfo->pwszProcedure, pSSErrorInfo->wLineNumber);

                      has_sql_errors++;

                      // IMalloc::Free needed to release references on returned values.
                      pMalloc->Free(pSSErrorStrings);
                      pMalloc->Free(pSSErrorInfo);
                   }

                   pISQLServerErrorInfo->Release();
                }

                if (SUCCEEDED(pIErrorRecords->GetErrorInfo(errno, MYLOCALEID, &pIErrorInfoRecord))) {
                   // Get the source and description (error message) from the record's IErrorInfo.
                   pIErrorInfoRecord->GetSource(&bstrSource);
                   pIErrorInfoRecord->GetDescription(&bstrDescription);

                   if (bstrSource != NULL) {
                      wprintf(L"Source:\t\t%s\n", bstrSource);
                      SysFreeString(bstrSource);
                   }

                   if (bstrDescription != NULL) {
                      wprintf(L"Error message:\t%s\n", bstrDescription);
                      SysFreeString(bstrDescription);
                   }

                   pIErrorInfoRecord->Release();
                }
             }

             pIErrorRecords->Release();
          }
          else {
             // IErrorInfo is valid; get the source and
             // description to see what it is.
             pIErrorInfoAll->GetSource(&bstrSource);
             pIErrorInfoAll->GetDescription(&bstrDescription);

             if (bstrSource != NULL) {
                wprintf(L"Source:\t\t%s\n", bstrSource);
                SysFreeString(bstrSource);
             }

             if (bstrDescription != NULL) {
                wprintf(L"Error message:\t%s\n", bstrDescription);
                SysFreeString(bstrDescription);
             }
          }

          pIErrorInfoAll->Release();
       }
       else
          wprintf(L"GetErrorInfo failed.\n");

       if (pISupportErrorInfo != NULL)
          pISupportErrorInfo->Release();
    }

     

  • Feedback aliases for MDAC


    Hi,

    My name is David Schwartz.  I am a technical writer in the SQL Server product group and I maintain the documentation for Windows Data Access Components, formerly known as Microsoft Data Access Components (MDAC).

    If MDAC users have any documentation comments, you can send them to mdacdoc@microsoft.com.

    There is also an alias just for ADO comments and questions:  adodoc@microsoft.com.

    I look forward to reading your e-mails about your ADO, ODBC, and OLE DB experiences, including documentation comments.

    David Schwartz
    Microsoft SQL Server User Education

  • Microsoft Sync Framework CTP Is Live!

    Microsoft has now posted the first Community Technology Preview (CTP) release of Microsoft Sync Framework. Sync Framework is a comprehensive synchronization platform that enables collaboration and offline data access for applications, services and devices with support for any data type, any data store, any transfer protocol, and network topology. Documentation is available as a download and as part of the MSDN Library. Your feedback is greatly appreciated.

     

    Tai Yee

    Microsoft SQL Server User Education

  • Let Us Know What You Think of the New Design for the SQL Server TechCenter

    A new design for the SQL Server TechCenter has now been released. This design was based on the ones currently being piloted on the Visual Basic Developer Center and Visual C# Developer Center. When visiting the site, be sure to use the Rating Control near the top right of the page to tell us how much or how little you like the new design. One star = hate it, five stars = love it. 

    Also, we would very much like to hear your thoughts and comments about this design. Please comment here with any feedback, positive or negative, we want it all!

    Tai Yee
    Microsoft SQL Server User Education

  • Did You Know? It's in the Books Online!

    For those of you who don't know Kalen Delaney, she is a longtime SQL Server expert. In fact, she wrote the book on the SQL Server Storage Engine. I recently came across Kalen's blog, and one post in particular that I wanted to share:

     Did You Know? It's in the Books Online!

    I wanted to crosslink to this blog post because it fits with our theme of providing tips and tricks on SQL Server Books Online, in this case, how to remove an unwanted Help collection so that its topics do not clutter up your Search results.

    Tai Yee
    Microsoft SQL Server User Education

  • Two New Releases for the Data Platform

    I am pleased to announce that two new releases for which the SQL Server User Education team provided documentation are now available.

    The first is the SQL Server 2005 JDBC Driver 1.2, which is available for download at http://www.microsoft.com/downloads/details.aspx?FamilyID=c47053eb-3b64-4794-950d-81e1ec91c1ba&DisplayLang=en. Documentation for this release is included with the download package, and is also available in the MSDN Library and TechNet Library. This release is currently available in English only. Localized language versions of this release are expected to be available in December.

    The second is the SQL Server 2005 Driver for PHP Community Technology Preview (CTP) for October 2007, available at http://www.microsoft.com/downloads/details.aspx?FamilyID=85f99a70-5df5-4558-991f-8aee8506833c&DisplayLang=en. Documentation on this release is included in the form of two Microsoft Word documents and a readme.txt file that are extracted when you run the download package. This release is currently available in English only.

    Please feel free to send us any feedback on the documentation!

    Tai Yee
    Microsoft SQL Server User Education

  • Eliminate Extranneous Search Results

    Ever gone to a search engine like Google or Live Search, and noticed there is a lot of clutter in your search results, making it difficult to find the content you really need? Now, with the SQL Server 2005 Books Online Scoped Search Macro, you can filter out all pages from the Search except for those in the Books Online. This is very useful to target your Search to just the SQL Server documentation, and not any other random Web pages that mention SQL Server. Try the Scoped Search today and be sure to send us feedback to let us know how you liked it!

     You can find the SQL Server 2005 Books Online Scoped Search at: http://search.live.com/macros/sql_server_user_education/booksonline/.

    Tai Yee
    Microsoft SQL Server User Education

More Posts Next page »

©2005 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
Microsoft
Page view tracker