A puzzle from a migration project: SSMS cannot script every Primary Key and Foreign Key at once. Can you write a script that generates them all?
geometry STBoundary: A Polygon Edge Is a Different Shape
geometry STBoundary returns the edge of a shape as another geometry instance. I inspect that result independently from the source. A polygon’s boundary is not another filled polygon with the same area.
SQL SERVER – Get Last Running Query Based on SPID
How to see the last running query of another session based on its SPID, using @@SPID to find session IDs and DBCC INPUTBUFFER to read the query.
SQL SERVER – Two Methods to Retrieve List of Primary Keys and Foreign Keys of Database
There are two different methods to retrieve the list of Primary Keys and Foreign Keys from the database.
SQL SERVER – Four Different Ways to Find Recovery Model for Database
Four ways to find the recovery model of a database: database properties, Object Explorer Details, sys.databases and DATABASEPROPERTYEX.
SQL SERVER – Restore Sequence and Understanding NORECOVERY and RECOVERY
What is the difference between NORECOVERY and RECOVERY when restoring a database, and what is the right restore sequence? A plain explanation of both.
Decimal Multiplication: Precision Can Reduce the Result Scale
Decimal Multiplication derives a result type from its operand types, and the precision limit can reduce the scale. I inspect three small products. A small numeric value does not necessarily imply a narrowly declared arithmetic result.







