home *** CD-ROM | disk | FTP | other *** search
/ Delphi Anthology / aDELPHI.iso / install / mdac_typ.exe / RCDATA / CABINET / Sqlsrdme.txt < prev    next >
Text File  |  1999-01-22  |  13KB  |  298 lines

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