Whenever we want to loop something we always look for logic like WHILE LOOP or FOR LOOP. Trust me on my word that both of them are cursor when it is about SQL Server.
SQL SERVER – Generate Foreign Key Scripts For Database
Madhaiyan Seenivasan’s stored procedure lets you generate foreign key scripts for a whole database, handy when you drop all foreign keys and add them back.
Filtering on Dates Without Losing the Index
Filtering on dates without losing an index means using searchable ranges; learn half-open boundaries, date and datetime differences, and plan checks.
SQL SERVER – 2008 – Row Constructors – Load Temp Tables From Stored Procedures
Load temp tables from stored procedures with a simple INSERT INTO EXEC instead of a loopback OPENQUERY. Here is the before and after code.
TAN: Keep the Angle Away From Its Undefined Point
TAN reads radians and returns float. These safe angles demonstrate sign and magnitude while explaining why a large finite float near ninety degrees is not a meaningful infinity.
SQL SERVER – SQL Slammer (Computer Worm)
Is there any virus associated with SQL Server? A DBA’s question led me to SQL Slammer, the computer worm that slowed down Internet traffic in January 2003.
PATINDEX and CHARINDEX: Pattern or Literal Search
PATINDEX and CHARINDEX answer different questions. Compare wildcard patterns with literal searches, preserve NULL, and pin collation for digit ranges.







