MICROSOFT SQL SERVER CONNECTIVITY FEATURE PACK COMPONENTS
Microsoft® SQL Server® 2012 Native Client
Microsoft SQL Server Native Client (SQL Server Native Client) is a single dynamic-link library (DLL) containing both the SQL OLE DB provider and SQL ODBC driver. It contains run-time support for applications using native-code APIs (ODBC, OLE DB and ADO) to connect to Microsoft SQL Server 2005, 2008, 2008 R2, and SQL Server 2012. SQL Server Native Client should be used to create new applications or enhance existing applications that need to take advantage of new SQL Server 2012 features. This redistributable installer for SQL Server Native Client installs the client components needed during run time to take advantage of new SQL Server code name ‘Denali’ features, and optionally installs the header files needed to develop an application that uses the SQL Server Native Client API.
Yet another tidbit. Default stored proc parameter sizing.
The old parameter passing to the stored procedures is done with array of const and variants. No issues with that, until my xml logging feature had the mother of all stack traces, and exceeded 9k bytes in total xml size, upon which the assignment of TFDParam.Value complained that TFDParam.Size was 8002 bytes, and the size of the string was bigger than that.
I recently discovered that some of the few queries that we have that return a large rowset, would max out at 50 rows.
It turns out that TFDQuery.FetchOptions.Mode defaults to fmOnDemand, which means that the query first returns a default of 50 rows, and then fetches 50 more as you MoveNext past the 50 first. Other options are fmAll, fmExactRecsMax, fmManual.
Since we still are in the “make it work” and not in the “make it fast” stage, I switched to using fmAll.
Interestingly, RowCount by default also returns 50 even if the query actually matches more rows. and there is a TFDQuery.FetchOptions.RecordCountMode setting that can be modified, as well: cmFetched, cmVisible, cmAll.
This differs from ADO TQuery, which will retrieve all rows and the full record count by default.
TFDDataSet has the same settings, and there are numerous other tweakable parameters that I need to explore for both of these components..
Migrating to FireDAC from ADO – Stored Proc Param Type
Found an interesting little deviation today.
In a MSSQL stored proc with an TinyInt parameter, the insert statement suddenly complained that it could not insert the param with NULL value (as per constraint).
After a lot of tracing, I was certain that we passed a 0 and not a NULL – and the only plausible reason was that I could see, was that the code was setting the param value, before setting the param datatype – so I rearranged the assignments to ensure that value was the last thing to be set.
Save the pastebin document as xmld_XMLDoc_Summary.xml in
XE..XE5 – RAD Studiocode_templatesDelphi
XE6… – EmbarcaderoStudiocode_templatesDelphi
… or wherever your standard Delphi directory is.
Create a blank line above a class method or property in the interface declaration, then type xmld and fill in the blanks. If you need more than one line, add a line break and /// at the beginning of next line.