sqlserver.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Tue, 07 Feb 2023 00:39:25 +0200
changeset 2554 c83fb8d3809f
parent 2553 11f741239f16
child 2560 e023a7bbaf3b
permissions -rw-r--r--
Removed unrelated data.


============
 SQL Server
============
.. contents::
   :local:

Informational schema
====================

::

  SELECT * FROM sys.tables;
  SELECT * FROM sys.views;
  SELECT * FROM sys.indexes;

  SELECT * FROM information_schema.tables;

Table stats
===========

Individual table::

  EXEC sp_spaceused NAME;

All tables in a schema::

  sp_msforeachtable 'EXEC sp_spaceused [?]';

List collations
===============

::

  SELECT name, description FROM sys.fn_helpcollations();