SQL Server Index

How to list all SQL Server indexes?

How to list all SQL Server indexes? It can be very useful to display all database indexes. Indeed, to have an idea at a glance at how this SQL Server database is optimized with indexes, whether an index is A clustered or a non-clustered one. This query offers you a

SQL Server Stored Procedures

How to create a SQL Server stored procedure ?

How to create a simple SQL Server stored procedure? This example in transact SQL code list all the Customers from the Customers table by using the selection function. This example do not use any where clause to filter the results. Its a simple example to remind the syntax creation for

blank
SQL Server Stored Procedures

How to alter a SQL Server stored procedure?

How to alter an existing stored procedure in a SQL Server database? Simply use the alter command instead of the create command one to modify an existing SQL procedure. In this example let’s add the grouping on months and employees to sum up and group data. Let’s add also a

blank
SQL Server Views

How to create a SQL Server view?

How to create a SQL Server view to display specific columns from an existing table? Consider a view as a virtual table defined by a SQL query. It’s a set of columns and rows from a table. A user defined view is a object managed by a SQL Server developer.

blank
SQL Server Views

How to delete a SQL Server view?

How to delete a SQL Server view from the database? How to drop a view? For a SQL developer it’s a good practice to have a clean database and remove the unused or useless code. Unlike the tables, the views can be deleted from the database using a simple T-SQL

blank
SQL Server Time and Dates

Display full month name from a date

How to display full month name from a date in SQL Server? Which is to say with the complete month names like January, February, March, April, May, etc. written out in full. This query shows you how to get the full month names from the current date or any other date.

blank
SQL Server Strings

Remove line break from text with SQL Server

How to remove SQL Server line break from a text? If you store a string as a variable or a column in SQL Server, then it can contain line breaks. For example, if you export the string to excel, your line will be cut. Indeed, with SSMS, if you select

blank
SQL Server

List tables and disk space in SQL Server

List tables and disk space in SQL Server database can be very convenient especially to analyze the disk usage and the free disk space used by each table. Three different ways, but similar are presented here to display SQL Server tables and disk space used by each table. The third

Blue and grey gearwheels image
SQL Server

SQL Server unpivot query example

How to use a SQL Server unpivot query to transform columns to rows? It’s possible with this simple SQL Server UNPIVOT function example. The T-SQL Unpivot function can do it in one single query. In this example, only the six first months of the year are used as columns, namely

blank
SQL Server

Check last update date on a SQL Server table

How to check the last update date on a SQL Server table? Check the last access and update with a simple SQL query? Thanks to the SQL Server relational database management system tables, a query allows you to display the last changes done. We can apply it to any SQL