Showing Posts for SQL

SQL script to kill all processes on a specific database

Michael Roma on Nov 20, 2019

This post shows a SQL script that can be used to kill all processes that are connected to a database. This is useful when you need to take the database down for maintenance.

  • SQL

How to get started with Microsoft SQL Server on Linux using Docker

Michael Roma on Mar 3, 2019

How to get started with Microsoft SQL Server on Linux using Docker

  • Docker
  • SQL

SQL Script to find all SQL Agent Jobs for SQL Reporting Services Subscriptions

Michael Roma on Dec 18, 2016

SQL Script to find all SQL Agent Jobs for SQL Reporting Services Subscriptions, SSRS

  • SQL

SQL Script to find all Indexes that need to be added

Michael Roma on Nov 14, 2013

This SQL script will show all Table Indexes that need to be added based on query history

  • SQL

SQL helper script to generate properties for an Entity Framework model

Michael Roma on Oct 16, 2013

This post shows a T-SQL script that can be used to generate the properties for a class that correspond to to a field in a database table. This can be used with Entity Framework.

  • C#
  • SQL
  • Entity Framework

C# Helper functions to map a DataTable or DataRow to a class object

Michael Roma on Mar 30, 2013

The following methods will allow you to map your DataTable, DataRow results to a class object.

  • C#
  • SQL

How to join a table-valued function in T-SQL

Michael Roma on Jan 30, 2013

Example on how to join a table-valued function in a T-SQL query

  • SQL

How to get date only from datetime in T-SQL

Michael Roma on Nov 25, 2012

The following code snippets are examples of how to return the date only part from a datetime data type.

  • SQL

Counting records in associated tables in Entity Framework

Michael Roma on Aug 14, 2012

The following example shows how to query a table and count records associated in another

  • C#
  • Entity Framework
  • SQL

Using Inheritance in Entity Framework

Michael Roma on Aug 14, 2012

C# Examples on how to use inheritance in Entity Framework

  • C#
  • Entity Framework
  • SQL