3 Ways to Count the Number of System Tables in a SQL Server Database

Here’s an article that presents three ways to quickly determine how many system tables are in the current database in SQL Server.

All three options use the COUNT() function while querying the sys.objects system catalog view. They all result in the same output, so you really don’t need to go past the first option. But I’ll list them anyway.

Continue reading

11 Ways to Return Foreign Keys in a SQL Server Database using T-SQL

This article presents eleven different approaches to retrieving foreign key information in SQL Server. Some of these will be more useful than others, depending on the situation.

Some of these methods can be modified to return further information. For example, you could perform joins on various system views to return more data.

Continue reading

What is a Table?

A database table is a structure that organises data into rows and columns – forming a grid.

Tables are similar to a worksheets in spreadsheet applications. The rows run horizontally and represent each record. The columns run vertically and represent a specific field. The rows and columns intersect, forming a grid. The intersection of the rows and columns defines each cell in the table.

Continue reading