home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / os / system / sqlsrdme.txt < prev    next >
Text File  |  1998-07-14  |  12KB  |  269 lines

  1. ****************************************************************
  2.                       MICROSOFT(R) SQL SERVER
  3.                 MICROSOFT SQL SERVER ODBC DRIVER
  4.                     SETUP README, VERSION 3.6
  5. ****************************************************************
  6.  
  7. (c) 1998 Microsoft Corporation. All rights reserved.
  8.  
  9. This file describes using the version 3.6 Microsoft SQL Server
  10. ODBC driver with version 6.5 or earlier Microsoft SQL Servers.
  11.  
  12. The topics covered are:
  13.  
  14. 1. Overview
  15. 2. Installing Instcat.sql on the server
  16. 3. Obtaining the SQL Server Client Net-Libraries
  17. 4. Documentation sources regarding using ODBC with SQL Server
  18. 5. Using the driver in a development environment
  19. 6. Compatability issues
  20.  
  21. ****************************************************************
  22. 1. Overview
  23.  
  24. The version 3.6 Microsoft SQL Server ODBC driver is a Win32(R)
  25. ODBC version 3.6 driver.  It can be used with applications
  26. written to either the ODBC 2.X or ODBC 3.X APIs.  The driver
  27. works with Microsoft SQL Server version 4.21a or later.  The
  28. driver runs on  either Windows 95 or Windows NT (version 4.0
  29. or later).
  30.  
  31. A new version of the Win32 SQL Server Client Configuration
  32. utility is also installed with the version 3.6 SQL Server ODBC
  33. driver.  This SQL Server Client Configuration utility can be
  34. used with Microsoft SQL Server version 4.21a or later and the
  35. Client Net-Libraries that come with those versions of SQL
  36. Server.
  37.  
  38. ****************************************************************
  39. 2. Installing Instcat.sql on the server
  40.  
  41. The SQL Server ODBC driver uses a set of system stored
  42. procedures, known as catalog stored procedures, to obtain
  43. information from the SQL Server system catalog.  Each version
  44. of the Microsoft SQL Server ODBC driver is developed to work
  45. with a specific version of the catalog stored procedures.  The
  46. Instcat.sql file included with the version 3.6 SQL Server ODBC
  47. driver includes minor updates to the catalog stored procedures
  48. that upgrade the procedures to the versions used by this
  49. driver.  The SQL Server system administrator must use the
  50. Instcat.sql script to upgrade the catalog stored procedures
  51. to ensure the proper operation of the driver.  Upgrading the
  52. catalog stored procedures does not affect the operation of
  53. older SQL Server clients.  This must be done for all
  54. versions of Microsoft SQL Server from 4.21a to 6.5.
  55.  
  56. To upgrade the catalog stored procedures, the system
  57. administrator runs a script using the isql utility. (See the
  58. instructions below.)  Before making any changes to the master
  59. database, the system administrator should back it up.  To run
  60. isql, your computer must be installed as a client workstation
  61. for Microsoft SQL Server.
  62.  
  63. At a command prompt, use the isql utility to run the Instcat.sql
  64. script.  For example:
  65.  
  66. C:> ISQL /Usa /Psa_password /Sserver_name /ilocation\Instcat.Sql
  67.  
  68. where
  69. sa_password 
  70.     Is the system administrator's password.
  71. server_name 
  72.     Is the name of the server on which SQL Server resides.
  73. location 
  74.     Is the full path of the location of Instcat.Sql.
  75.  
  76. The Instcat.sql script generates many messages.  Most of these
  77. indicate how many rows were affected by the Transact-SQL
  78. statements issued by the script.  Most of these messages can be
  79. ignored, although the output should be scanned for messages that
  80. indicate an execution error.  When Instcat.sql is run against a
  81. version 6.0 SQL Server, the message that says the object
  82. sp_MS_upd_sysobj_category does not exist can be ignored.  The
  83. last message should indicate that Instcat.sql completed
  84. successfully.  The Instcat.sql script fails when there is not
  85. enough space available in the master database to store the
  86. catalog stored procedures or to log the changes to existing
  87. procedures.
  88.  
  89. ****************************************************************
  90. 3. Obtaining the SQL Server Client Net-Libraries
  91.  
  92. The Microsoft SQL Server ODBC driver uses the Microsoft SQL
  93. Server Client Net-Libraries to communicate with the server.
  94. The version 3.6 SQL Server ODBC driver also uses the SQL Server
  95. Client Configuration utility to manage the Net-Library
  96. associated with an ODBC data source.
  97.  
  98. The version 3.6 SQL Server ODBC driver installs only one
  99. Net-Library, the Win32 named pipe Net-Library Dbnmpntw.dll.
  100.  
  101. You can use the version 3.6 SQL Server ODBC driver with older
  102. Win32 Net-Libraries.  If a Net-Library other than the named pipe
  103. Net-Library is needed to connect to SQL Server, you can use
  104. the Net-Library that came with your version of Microsoft SQL
  105. Server.  You can get the SQL Server Net-Libraries by installing
  106. the Win32 SQL Server Client utilities for your version of
  107. Microsoft SQL Server.
  108.  
  109. The version of the SQL Server Client Configuration utility
  110. installed with the version 3.6 SQL Server ODBC driver can be
  111. used with the Client Net-Libraries from SQL Server 4.21a or
  112. later.
  113.  
  114. ****************************************************************
  115. 4. Documentation sources regarding using ODBC with SQL Server
  116.  
  117. The version 3.6 Microsoft SQL Server ODBC driver complies with
  118. existing SQL Server 6.5 documentation for driver-specific
  119. information.  For documentation of driver-specific features, 
  120. see SQL Server manuals and Books Online.
  121.  
  122. The version 3.6 Microsoft SQL Server ODBC driver also complies
  123. with additional driver-specific information in the technical
  124. note "Using ODBC with Microsoft SQL Server," which is available
  125. on the Microsoft Web site at:
  126.  
  127. http://www.microsoft.com/sql/reskit.htm
  128.  
  129. The Sqlsodbc.hlp file that ships with the version 3.6 SQL Server
  130. ODBC driver contains only context-sensitive help for the
  131. SQL Server ODBC Data Source wizard.  The Drvssrvr.hlp file that
  132. shipped with earlier versions of the Microsoft SQL Server ODBC
  133. driver contained driver-specific information for older versions 
  134. of the driver.  The information contained in the older versions 
  135. of Drvssrvr.hlp is duplicated in the SQL Server 6.5 manual 
  136. "Programming ODBC for Microsoft SQL Server."
  137.  
  138. ****************************************************************
  139. 5. Using the driver in a development environment
  140.  
  141. The Microsoft SQL Server ODBC driver uses driver-specific
  142. parameters for several ODBC function calls.  #defines for these
  143. driver-specific parameters and driver-specific C and C++
  144. programming structures are contained in the include file
  145. Odbcss.h.
  146.  
  147. The version 3.6 SQL Server ODBC driver works with the
  148. Odbss.h file provided in the following sources:
  149.  
  150. SQL Server Service Pack 2 (SP2) or later.
  151.     The service pack can be downloaded from the Microsoft
  152.     Web site at http://www.microsoft.com/sql/ServicePak.htm.
  153.  
  154. ODBC 3.0 SDK.
  155.     The ODBC 3.0 SDK is part of the Microsoft Developer
  156.     Network Professional edition.  The SDK can be
  157.     downloaded from the Microsoft Web site at
  158.     http://www.microsoft.com/odbc.  The SDK is also
  159.     available from Microsoft Press(R) in the "Microsoft ODBC
  160.     3.0 Software Development Kit and Programmer's
  161.     Reference."
  162.  
  163. ****************************************************************
  164. 6. Compatability issues
  165.  
  166. The version 3.6 SQL Server ODBC driver displays a new wizard
  167. when adding or configuring data sources in either the ODBC
  168. Administrator utility or when an application calls
  169. SQLConfigDataSource and asks the driver to prompt the user for
  170. information.  Click the Help button in the wizard to access the
  171. wizard documentation.
  172.  
  173. In the version 2.65 SQL Server ODBC driver that shipped with
  174. SQL Server 6.5, the SQL_COPT_SS_PERF_QUERY_INTERVAL
  175. worked in seconds instead of the milliseconds it was documented
  176. to use (see Knowledge Base article Q157753).  In the version 3.6
  177. SQL Server ODBC driver, SQL_COPT_SS_PERF_QUERY_INTERVAL has 
  178. been changed to work in milliseconds as documented.
  179.  
  180. The following changes affect only applications written using
  181. the ODBC 3.X API.  They do not affect applications written
  182. using the ODBC 2.X API.  These changes should not impact
  183. the result set processing in most ODBC applications.
  184.  
  185. In prior versions of the SQL Server ODBC driver, contiguous
  186. PRINT or RAISERROR statements in a batch or stored procedure
  187. return their messages together, in one result set.  In the
  188. version 3.6 SQL Server ODBC driver, the messages for each
  189. SQL statement are returned as separate result sets.  You must
  190. call SQLMoreResults in between each message to be positioned
  191. on the message for the next SQL statement.  The messages from
  192. a single SQL statement, such as a DBCC statement, are all
  193. returned in a single result set, and there is no need to call
  194. SQLMoreResults in between each message.
  195.  
  196. In prior versions of the SQL Server ODBC driver, a run-time
  197. error or a RAISERROR with a severity of 11 or higher on the
  198. first statement in a batch or stored procedure always caused
  199. either SQLExecute, SQLExecDirect, or SQLParamData to return
  200. SQL_ERROR.  In the version 3.6 SQL Server ODBC driver,
  201. SQLExecute, SQLExecDirect, or SQLParamData returns SQL_ERROR
  202. only if no other statements are executed after the first
  203. statement.  If any other statements are executed after the
  204. first, even a simple RETURN statement with no return value, 
  205. SQLExecute or SQLExecDirect returns SQL_SUCCESS_WITH_INFO.  After
  206. processing the SQL_SUCCESS_WITH_INFO messages using 
  207. SQLGetDiagRec, call SQLMoreResults to be positioned on the 
  208. next result set.
  209.  
  210. When prior versions of the driver encountered an error on the
  211. first statement of a batch or stored procedure, the statement
  212. handle was available for use with another SQL statement after
  213. SQLExecute or SQLExecDirect returned SQL_ERROR.  When the 3.6
  214. driver returns SQL_SUCCESS_WITH_INFO, the statement is not free
  215. to process another SQL statement until SQLMoreResults returns
  216. SQL_NO_DATA or until all result sets following the RAISERROR 
  217. have been closed.  If no result set follows the error message,
  218. then SQLCloseCursor cannot be called; SQLFreeStmt(SQL_CLOSE)
  219. or SQLMoreResults must be called to free the statement handle
  220. to process another SQL statement:
  221.  
  222. CREATE PROCEDURE TestPrc @Parm1 as
  223. IF (@Parm1 IS NULL)
  224. BEGIN
  225.     RAISERROR ('Parm1 cannot be NULL', 11, 1)
  226.     RETURN
  227. END
  228. SELECT * FROM sysusers WHERE suid = @Parm1
  229. GO
  230.  
  231. Execute the following:
  232.  
  233. SQLExecDirect(hstmt, "{ call TestPrc (NULL) }", SQL_NTS);
  234.  
  235. When using an older version of the SQL Server ODBC driver or
  236. if the application uses the ODBC 2.X API, SQLExecDirect
  237. returns SQL_ERROR.  After SQLGetDiagRec returns SQL_NO_DATA or
  238. SQLError returns SQL_NO_DATA_FOUND, the statement handle is
  239. free to execute another SQL statement.
  240.  
  241. When using the version 3.6 SQL Server ODBC driver from an
  242. application written to the ODBC 3.X API, SQLExecDirect
  243. returns SQL_SUCCESS_WITH_INFO.  After SQLGetDiagRec returns
  244. SQL_NO_DATA, the statement handle cannot be used to process
  245. another SQL statement until SQLMoreResults returns
  246. SQL_NO_DATA or SQLFreeStmt(SQL_CLOSE) is called.
  247.  
  248. In prior versions of the SQL Server ODBC driver, SQLExecute,
  249. SQLExecDirect, or SQLParamData returns SQL_SUCCESS when an
  250. application executes a searched UPDATE or DELETE statement
  251. that affects no rows.  For this case, the version 3.6 driver
  252. still returns SQL_SUCCESS to applications written with the
  253. ODBC 2.X API, but it returns SQL_NO_DATA to applications
  254. written with the ODBC 3.X API.  If either the ODBC 2.X
  255. application that receives SQL_SUCCESS or the ODBC 3.X
  256. application that receives SQL_NO_DATA then calls SQLRowCount,
  257. SQLRowCount returns a count of zero.
  258.  
  259. ODBC 3.X more clearly defines the way results are returned
  260. than ODBC 2.X. Earlier versions of the SQL Server ODBC driver
  261. returned the values of output parameters and return codes when
  262. the ODBC 2.X functions SQLFetch or SQLExtendedFetch returned
  263. SQL_NO_DATA on the last result set returned by a stored
  264. procedure. The version 3.6 driver retains this behavior when
  265. called by ODBC 2.X applications.  When the version 3.6 driver
  266. is called by ODBC 3.X applications, however, the driver does not
  267. return output parameters or return codes until SQLMoreResults
  268. returns SQL_NO_DATA.
  269. ****************************************************************