Choose a SQL Server client driver by application stack: ODBC, current OLE DB, Microsoft.Data.SqlClient, or JDBC, then test security defaults.
SQL SERVER – 2005 Limiting Result Sets by Using TABLESAMPLE – Examples
TABLESAMPLE returns a random sample of rows by percent or row count. My examples show why the same query returns a different number of rows each time.
SQL SERVER – 2005 Replace TEXT with VARCHAR(MAX) – Stop using TEXT, NTEXT, IMAGE Data Types
Is VARCHAR(MAX) big enough to hold TEXT? Yes. TEXT, NTEXT and IMAGE will be deprecated, so replace TEXT with VARCHAR(MAX) and use the new MAX data types.
SQL SERVER – Stored Procedure to display code (text) of Stored Procedure, Trigger, View or Object
Need to display code of a stored procedure, trigger, view or function? The system stored procedure sp_helptext prints the text of any unencrypted object.
SQL SERVER – Disadvantages (Problems) of Triggers
Triggers or stored procedures? The disadvantages (problems) of triggers I shared with my team: hard to see, hard to debug, and they can slow things down.
SQL SERVER – 2005 Retrieve Configuration of Server
To retrieve the full configuration of server options in SQL Server 2005, turn on show advanced options and run sp_configure. Change any option the same way.
Composite Keys: Match Complete Pairs Instead of Separate Lists
Composite keys need a complete pair match when the allowed values are defined together. I don’t split the components into independent lists. Doing so can admit combinations that were never allowed.







