This is a Visual Studio Code Extension Pack for developing MSSQL Server Databases.
Now you can configure, develop, execute queries, create procedures, functions, tables and more with Visual Studio Code.
You just need to install some extensions and you can start developing.
The Extension Pack includes all these extensions:
# | Extension Name | Short Description | VS Code Marketplace Link |
---|---|---|---|
1 | SQL Server (mssql) | Develop Microsoft SQL Server, Azure SQL Database and SQL Data Warehouse everywhere | https://marketplace.visualstudio.com/items?itemName=ms-mssql.mssql |
2 | MSSQL Snippets | A lot of useful Microsoft SQL Server Snippets for writing your queries faster. | https://marketplace.visualstudio.com/items?itemName=MEngRBatinov.mssql-snippets |
3 | MSSQL Scripts and Utilities | MSSQL administration, definition and data modification scripts to ease your coding. Automate tasks. Execute your query faster. | https://marketplace.visualstudio.com/items?itemName=MEngRBatinov.mssql-scripts |
-
SQL Server (mssql) is the official Microsoft extension for MSSQL Server. It helps you for:
- Connecting to your server.
- View objects (
Server
,Databases
,Tables
,Views
,Procedures
,Functions
,etc.
) in beautiful object explorer. - Write and Execute queries.
-
MSSQL Snippets is an extension that has a lot of useful MSSQL snippets. You can write your code faster just with writing some minimal letters or phrases. The extension provides all these snippets:
-
SELECT
,SELECT WITH WHERE CLAUSE
,SELECT WITH EXISTS/NOT EXISTS
,SELECT WITH IN/NOT IN
,CTEs
,RECURSIVE CTEs
INSERT INTO
,INSERT WITH SELECT
,INSERT EXEC
,SELECT INTO
UPDATE
,UPDATE WITH JOIN
DELETE
,DELETE TOP(N)
,TRUNCATE
MERGING DATA
INSERT WITH OUTPUT
,UPDATE WITH OUTPUT
,DELETE WITH OUTPUT
,MERGE WITH OUTPUT
UNION
,INTERSECT
,EXCEPT
OFFSET-FETCH
- ALL types of JOINS -
INNER JOIN
,LEFT OUTER JOIN
,RIGHT OUTER JOIN
,FULL OUTER JOIN
,CROSS JOIN
CROSS APPLY
andOUTER APPLY
PIVOT
andUNPIVOT
data-
IF
,IF-ELSE
,IF EXISTS
,IF NOT EXISTS
,CASE
-
-
- DECLARE
INT
,BIGINT
,SMALLINT
,TINYINT
,MONEY
,SMALLMONEY
,DECIMAL
,FLOAT
,REAL
,BIT
,DATE
,DATETIME
,SMALLDATETIME
,DATETIMEOFFSET
,TIME
,CHAR
,VARCHAR
,NVARCHAR
,BINARY
,VARBINARY
,SQL_VARIANT
,XML
,UNIQUEIDENTIFIER
,GEOGRAPHY
,GEOMETRY
,TABLE
- DECLARE
-
TABLES
,VIEWS
,INLINE FUNCTIONS
,SCALAR FUNCTIONS
,MULTISTATEMENT TABLE-VALUED FUNCTIONS
,PROCEDURES
,CLUSTERED INDEXES
,NON-CLUSTERED INDEXES
,PRIMARY KEYS
,FOREIGN KEYS
,CONSTRAINTS
-
-
-
CAST
,TRY_CAST
,CONVERT
,TRY_CONVERT
,PARSE
,TRY_PARSE
-
DATEPART
,DATENAME
,DAY
,MONTH
,YEAR
,DATEFROMPARTS
,DATETIMEFROMPARTS
,DATETIME2FROMPARTS
,DATETIMEOFFSETFROMPARTS
,SMALLDATETIMEFROMPARTS
,TIMEFROMPARTS
,DATEDIFF
,DATEDIFF_BIG
,DATEADD
,EOMONTH
,SWITCHOFFSET
,TODATETIMEOFFSET
,ISDATE
-
DATALENGTH
-
ASCII
,CHAR
,CHARINDEX
,CONCAT
,CONCAT_WS
,DIFFERENCE
,FORMAT
,LEFT
,LEN
,LOWER
,LTRIM
,NCHAR
,PATINDEX
,QUOTENAME
,REPLACE
,REPLICATE
,REVERSE
,RIGHT
,RTRIM
,SOUNDEX
,SPACE
,STR
,STRING_AGG
,STRING_ESCAPE
,STRING_SPLIT
,STUFF
,SUBSTRING
,TRANSLATE
,TRIM
,UNICODE
,UPPER
-
IIF
,CHOOSE
-
ABS
,ACOS
,ASIN
,ATAN
,ATN2
,CEILING
,COS
,COT
,DEGREES
,EXP
,FLOOR
,LOG
,LOG10
,POWER
,RADIANS
,RAND
,ROUND
,SIGN
,SIN
,SQRT
,SQUARE
,TAN
-
ISJSON
,JSON_VALUE
,JSON_QUERY
,JSON_MODIFY
-
APPROX_COUNT_DISTINCT
,AVG
,CHECKSUM_AGG
,COUNT
,COUNT_BIG
,GROUPING
,GROUPING_ID
,MAX
,MIN
,STDEV
,STDEVP
,SUM
,VAR
,VARP
-
-
RANDOM NUMBER
,BLOCK OF COMMENTS
,LINE OF COMMENTS
,GET CURRENT DATE
,GET CURRENT DATETIME
,GET UNIX TIMESTAMP
,TRY-CATCH
,INSERT DELAY
,BEGIN TRANSACTION
,EXECUTE DYNAMIC SQL
-
-
MSSQL Scripts and Utilities is an extension that has a lot of predefined scripts that can be directly executed based on the selected object. The extension includes all these scripts:
-
- Properties
- Server Version
- System Info
- Free cache plan
- Helper Procedures
- Utilities
- SQL Server Monitoring
- Database Mail
-
- CREATE new Table
- DESIGN new Table
- Free cache plan
- Properties
- Query Statistics
- Query to HTML Table
- Query sys.objects for the selected Database
- Search in selected Database
- Tasks
- BackUp/Restore Database
- Online/Offline
- Select tables info
- Shrink Database
- Shrink File
- Helper Procedures
- Utilities
- SQL Server Monitoring
-
- CREATE new Table
- DESIGN new Table
- Drop Table
- Properties
- Table Result to HTML Table
- Query Statistics
- Script As
- INSERT
- UPDATE
- DELETE
- TRUNCATE
- SELECT
- COUNT(*)
- TOP N rows
- Columns
- ADD, ALTER, DROP column
- SELECT column names
- Column names info
- Helper Procedures
- Utilities
- SQL Server Monitoring
-
- DROP View
- Helper Procedures
- Utilities
- SQL Server Monitoring
-
- DROP Procedure
- Helper Procedures
- Utilities
- SQL Server Monitoring
-
- DROP Function
- Helper Procedures
- Utilities
- SQL Server Monitoring
-
- Database Physical Paths
- All Active Queries
- Template for sending e-mail
- All Databases Info
- All Data Types Info
- Object Dependencies
- Foreign Key Info
- Primary Key Info
- sp_help
Table
- Server Info
- Statistics
- Table Permissions
- sp_who
- sp_who2
- System Full Info
- List file and folders
- Current Server Name
-
- All User-Created Statistics
- Average Size of Rows in all Database Tables
- Average Size of Rows in SELECTED Tables
- Fragmentation Info in All Tables
- List All Assemblies in Database
- List Database Object with Space Info
- List Database with Size Info
- Recompile all Programmable Objects
- Refresh all Views in Database
- Server Roles and Permissions in Database
- Tables that don't have Primary Key
- Tables with Identity Columns
- Tables with INSTEAD OF triggers
- Tables with more than N Columns
- Tables with more than N Indexes
- Tables with N Triggers
- Tables with number of rows
- Tables with XML Columns
- Tables without clustered index
- TOP 50 unused indexes
-
- Active Running Queries
- Currently Active Sessions
- All Databases Information
- All Objects in Database Statistics
- Average Read/Write Time per Database
- BackUp Check
- Blocking Sessions and Queries
- Index Maintenance Scripts
- Index Usage Statistics
- IO Waits at Database Level
- IO Waits at File Level
- Last-run Queries
- Wait Events
-
- All Database Statistics
- All Database CPU Resource Usage
- TOP N CPU Queries in Database
- TOP N IO Queries in Database
-
- All Items
- Sent Items
- Event Log
- Failed Items
- Template for sending HTML E-mail
-
- You need to have
VS Code Installed
. - Also you need to install this Extension Pack.
- Install the extension:
- from Marketplace.
- from VS Code
- Open VS Code.
- Select
Extensions
from left panel or pressCtrl + Shift + X
. - Type in
mssql-extensions-starter-pack
. The extension with nameMSSQL Extension Starter Pack
will show.
- You can select the extension and read the overview features if you want.
- Pres
Install
button and you are ready. - By installing
MSSQL Extension Starter Pack
ALL these extensions will be installed:
- from Marketplace.
- Restart of VS Code may be needed.
- After installation you are ready to use it.
- First you need to configure your MSSQL Connection. You can read more about how in the MSSQL Extension Documentation
- When you connect to your MSSQL Server object explorer view with your databases information, tables, views, etc. will be shown.
- Right-click on your server, table, view, procedures, functions and all of the context menu commands will show.
- Just click on your selected command and a script will be loaded.
- There are 2 options for executing:
If script does not need any user information to write down
- it will ask for a valid connection and after selecting one it will be directly executed.If script does need any user information to write down
- placeholders will show what you need to write down and then you can just execute the script.
- Note that all objects are dynamically filled in the script based on your object click. So there is no need to type object information when executing the script.
- To use the snippets just open
.sql
file and start typing some of the prefixes and the snippets will be loaded in context menu. You can select one of them or if you know the exact prefix you can type it and hitTAB button
and the snippet will be inserted in your document.- All available snippets can be seen in the MSSQL Snippets Documentation
Currently there are no known issues.
Update Documentation
First release of extension
Enjoy!,
M. Eng. R. Batinov