-->APPLIES TO: SQL Server (Linux only) Azure SQL Database Azure SQL Data Warehouse Parallel Data Warehouse
This article shows how to use the mssql extension for Visual Studio Code to develop SQL Server databases. Because Visual Studio Code is cross-platform, you can use mssql extension on Linux, macOS, and Windows.
SQLPro for MSSQL 1.0.316 - Database management studio for Microsoft SQL Server. Download the latest versions of the best Mac apps at safe and trusted MacUpdate Download, install, or update SQLPro for MSSQL for Mac from MacUpdate. OK, yes, restore, but I can't find in SQL OS where to start a restore on a database I'm connected to. I have a.bak and a connection to a Db but I cannot see how to restore. Any help appreciated. Aimersoft DVD Studio Pack for Mac is the most powerful multimedia conversion software for Mac OS X users that includes THREE outstanding tools: Aimersoft DVD Ripper for Mac, Aimersoft Mac Video Converter and Aimersoft Mac DVD Copy.
Install and start Visual Studio Code
Visual Studio Code is a cross-platform, graphical code editor that supports extensions.
- Download and install Visual Studio Code on your machine.
- Start Visual Studio Code.NoteIf Visual Studio Code does not start when you are connected through an xrdp remote desktop session, see VS Code not working on Ubuntu when connected using XRDP.
Install the mssql extension
The mssql extension for Visual Studio Code lets you connect to a SQL Server, query with Transact-SQL (T-SQL), and view the results.
- In Visual Studio Code, select View > Command Palette, or press Ctrl+Shift+P, or press F1 to open the Command Palette.
- In the Command Palette, select Extensions: Install Extensions from the dropdown.
- In the Extensions pane, type mssql.
- Select the SQL Server (mssql) extension, and then select Install.
- After the installation completes, select Reload to enable the extension.
Create or open a SQL file
The mssql extension enables mssql commands and T-SQL IntelliSense in the code editor when the language mode is set to SQL.
- Select File > New File or press Ctrl+N. Visual Studio Code opens a new Plain Text file by default.
- Select Plain Text on the lower status bar, or press Ctrl+K > M, and select SQL from the languages dropdown.NoteIf this is the first time you have used the extension, the extension installs supporting SQL Server tools.
If you open an existing file that has a .sql file extension, the language mode is automatically set to SQL.
Connect to SQL Server
Ms Sql Studio Mac
Follow these steps to create a connection profile and connect to a SQL Server.
- Press Ctrl+Shift+P or F1 to open the Command Palette.
- Type sql to display the mssql commands, or type sqlcon, and then select MS SQL: Connect from the dropdown.NoteA SQL file, such as the empty SQL file you created, must have focus in the code editor before you can execute the mssql commands.
- Select the MS SQL: Manage Connection Profiles command.
- Then select Create to create a new connection profile for your SQL Server.
- Follow the prompts to specify the properties for the new connection profile. After specifying each value, press Enter to continue.
Connection property Description Server name or ADO connection string Specify the SQL Server instance name. Use localhost to connect to a SQL Server instance on your local machine. To connect to a remote SQL Server, enter the name of the target SQL Server, or its IP address. To connect to a SQL Server container, specify the IP address of the container's host machine. If you need to specify a port, use a comma to separate it from the name. For example, for a server listening on port 1401, enter <servername or IP>,1401
.
As an alternative, you can enter the ADO connection string for your database here.Database name (optional) The database that you want to use. To connect to the default database, don't specify a database name here. Authentication Type Choose either Integrated or SQL Login. User name If you selected SQL Login, enter the name of a user with access to a database on the server. Password Enter the password for the specified user. Save Password Press Enter to select Yes and save the password. Select No to be prompted for the password each time the connection profile is used. Profile Name (optional) Type a name for the connection profile, such as localhost profile. After you enter all values and select Enter, Visual Studio Code creates the connection profile and connects to the SQL Server.TipIf the connection fails, try to diagnose the problem from the error message in the Output panel in Visual Studio Code. To open the Output panel, select View > Output. Also review the connection troubleshooting recommendations. - Verify your connection in the lower status bar.
As an alternative to the previous steps, you can also create and edit connection profiles in the User Settings file (settings.json). To open the settings file, select File > Preferences > Settings. For more information, see Manage connection profiles.
Sql On Mac
Create a SQL database
- In the new SQL file that you started earlier, type sql to display a list of editable code snippets.
- Select sqlCreateDatabase.
- In the snippet, type
TutorialDB
to replace 'DatabaseName': - Press Ctrl+Shift+E to execute the Transact-SQL commands. View the results in the query window.TipYou can customize the shortcut keys for the mssql commands. See Customize shortcuts.
Create a table
- Delete the contents of the code editor window.
- Press Ctrl+Shift+P or F1 to open the Command Palette.
- Type sql to display the mssql commands, or type sqluse, and then select the MS SQL: Use Database command.
- Select the new TutorialDB database.
- In the code editor, type sql to display the snippets, select sqlCreateTable, and then press Enter.
- In the snippet, type
Employees
for the table name. - Press Tab to get to the next field, and then type
dbo
for the schema name. - Replace the column definitions with the following columns:
- Press Ctrl+Shift+E to create the table.
Insert and query
- Add the following statements to insert four rows into the Employees table.While you type, T-SQL IntelliSense helps you to complete the statements:TipThe mssql extension also has commands to help create INSERT and SELECT statements. These were not used in the previous example.
- Press Ctrl+Shift+E to execute the commands. The two result sets display in the Results window.
View and save the result
- Select View > Editor Layout > Flip Layout to switch to a vertical or horizontal split layout.
- Select the Results and Messages panel headers to collapse and expand the panels.TipYou can customize the default behavior of the mssql extension. See Customize extension options.
- Select the maximize grid icon on the second result grid to zoom in to those results.NoteThe maximize icon displays when your T-SQL script produces two or more result grids.
- Open the grid context menu by right-clicking on the grid.
- Select Select All.
- Open the grid context menu again and select Save as JSON to save the result to a .json file.
- Specify a file name for the JSON file.
- Verify that the JSON file saves and opens in Visual Studio Code.
If you need to save and run SQL scripts later, for administration or a larger development project, save the scripts with a .sql extension.
Sql Server Studio Mac
Next steps
If you're new to T-SQL, see Tutorial: Write Transact-SQL statements and the Transact-SQL Reference (Database Engine).
For more information on using or contributing to the mssql extension, see the mssql extension project wiki.
For more information on using Visual Studio Code, see the Visual Studio Code documentation.
Featured Database Articles
slideshows
Updated January 28, 2016 / Posted July 29, 2015
By Rob Gravelle
Top 10 MySQL GUI Tools
Many third parties create rich applications to facilitate database management, database development and database administration. Here are ten outstanding graphical interfaces for MySQL.Workbench
Manufacturer: Sun Systems/OracleWebsite: http://dev.mysql.com/downloads/workbench/Price: FREELicense: GPL LicenseSupported platforms: Microsoft Windows,Mac OS X and LinuxMySQL Workbench is avisual database design tool that integrates SQL development, administration, databasedesign, creation and maintenance into a single development environment. It isthe successor to DBDesigner 4 from fabFORCE.net and replaces the MySQL GUITools Bundle. The current version is 6.3, the earliest version being 5.0, which emphasized the fact thatMySQL Workbench was developed as the successor to DBDesigner4.Navicat for MySQL
Manufacturer: NavicatWebsite: http://www.navicat.com/en/products/navicat_mysql/mysql_overview.htmlPricing: As follows:* Enterprise version (Windows) ispackaged with Report Builder and Data Modeling Tool, and 2 Navicat ReportViewer licenses.
# Enterprise version (Mac and Linux) includes the Data Modeling Tool feature.A 14 day trial version isavailable.License: Available under Commercial orNon-commercial licenses.Supported platforms: Microsoft Windows,Mac OS X, Linux, and iOSNavicat for MySQL is both a databaseadministration and development tool. It works with any MySQL database serverfrom version 3.21 or above, and supports most of the latest MySQL featuresincluding triggers, stored procedures, functions, events, views, and usermanagement.Features in Navicat are sophisticated enough to cater to professionaldevelopers’ specific needs, yet easy to learn for users who are new to MySQL.Sequel Pro
Manufacturer: The Sequel Pro Project (opensource)Website: http://www.sequelpro.com/Price: FREE (donations accepted via PayPal)License: GNU GPL 2.0Supported platforms: Mac OS X 10.6 SnowLeopard or newerSequel Pro is a FREE open-source application. It is thesuccessor of the CocoaMySQL Mac databasemanagement application. CocoaMySQL was the brainchild of Lorenz Textor, whowas the main developer of CocoaMySQL from its early beginnings in 2003.Sequel Pro is an application used to manage MySQL databases(locally or over the Internet). It lets you add and remove databases andtables, change fields and indexes, view and filter table content, add, edit andremove rows, perform custom queries, and dump tables or entire databases.It is compatible with MySQL 3.x, 4 or 5 and nowcomes in 5 additional languages, including Russian, German, Swedish, French andJapanese.HeidiSQL
Manufacturer: Ansgar BeckerWebsite: http://www.heidisql.com/Price: FREE (donations accepted via PayPal)License: GNU General Public LicenseSupported platforms: Windows XP, Vista,7, 8, 10 (can be run on any Linux with Wine)HeidiSQL, previouslyknown as MySQL-Front, is a FREE and open sourceclient developed by German programmer Ansgar Becker and a few othercontributors in Delphi. To manage databases with HeidiSQL, users mustlogin to a local or remote MySQL server with acceptable credentials, creating asession. Within this session users may manage MySQL Databases within theconnected MySQL server, disconnecting from the server when done. Its featureset is sufficient for most common and advanced database, table and data recordoperations but remains in active development to move towards the fullfunctionality expected in a MySQL Frontend.A version written in Java, jHeidi, which isdesigned to work on Mac and Linux computers, also exists. Unfortunately, theproject has been discontinued since March 2010.phpMyAdmin
Manufacturer: The phpMyAdmin Project (onSourceforge)Website: http://www.phpmyadmin.net/home_page/Price: FREE (donations accepted via PayPal)License: GNU GeneralPublic License, version 2Supported platforms: Microsoft Windows,Mac OS X and Linux, PHP 4 - 5 and MySQL 3 - 5phpMyAdmin is a FREE software tool written in PHPintended to handle the administration of MySQL over the Internet. phpMyAdminsupports a wide range of operations with MySQL, the most frequently used beingthe managing of databases, tables, fields, relations, indexes, users,permissions. You still have the ability to execute SQL statements directly aswell.Tobias Ratschiller, then an IT consultant andlater founder of the software company Maguma, started to work on a PHP-basedweb front-end to MySQL in 1998, inspired by Peter Kuppelwieser'sMySQL-Webadmin. He gave up the project (and phpAdsNew, of which he was also theoriginal author) in 2000 because of lack of time. By that time, phpMyAdmin hadalready become one of the most popular PHP applications and MySQLadministration tools, with a large community of users and contributors. Inorder to coordinate the growing number of patches, a group of three developers,Olivier Müller, Marc Delisle and Loïc Chapeaux, registered the phpMyAdminproject at SourceForge.net and took over the development in 2001.SQLyog
Manufacturer: Webyog Inc.Website: https://www.webyog.com/product/sqlyogLicense: A full range of licensing options are available ranging from one to unlimited user commercial licenses with one year of free upgrades.Supported platforms: Windows 2000, XP, Vista, 7, 10There have been many complaints that MySQL Workbench hangsor fails to respond when put under a heavy load. SQLyog is a more robustproduct with many additional tools. It’s available in three major versions:Professional, Enterprise and Ultimate. The main difference between the threeversions is the number of included features. These include data migration,profiling, visual designers, analysis, batch scripting, backup scheduler, user manager,and database copy tools.At this time, SQLyog is only available for the Windows platform, but, some of the community uses it on MacOS, Ubuntu, Debian, Fedora and Mageia using WINE.A single user license costs $99 for the Professional Ed, $199 for the Enterprise Ed, and $299 for the Ultimate Ed. Multi-user packages are also available. A 14-day trial version of SQLyog is available for download from the Webyog's website.Updated: April 28, 2017SQLWave
Manufacturer: NerocodeWebsite: http://www.sqlwave.com/Price: $99.00 USDLicense: shareware. See http://www.sqlwave.com/Content/Other/license.txtfor more details.Supported platforms: Windows XP, Vista, 7, 8, 10Nerocode SQLWave is a MySQL GUIClient tool designed to automate and simplify the database development process.It also provides an easier way to explore and maintain existing databases,design compound SQL statements, query and manipulate data in different ways. MySQL4.x - 6.x compliant.A 30 day trial version isavailable.dbForge Studio
Manufacturer: devartWebsite: http://www.devart.com/dbforge/mysql/studio/Price: FREE for express edition, $59.95(non-commercial standard edition), $124.95 (non-commercial professional edition),$119.95 (commercial standard edition), $249.95(commercial professional edition)License: Commercial and non-commerciallicenses available. Subscriptions are also offered as an efficient andquickest way to deliver product upgrades and technical support.Supported platforms: Windows XP/7/8/8.1/10dbForge Studio for MySQL offers visual MySQL development andadministration.There are three editions: Express, Standard, andProfessional:Express is a FREE application that provides basicfunctionality for working with schema objects, user accounts, SQL scripts, andqueries.Standard includes additional tools for databaseadministrators and developers, such as a debugger, Query Builder, codetemplates, object search, various export and maintenance wizards.Professional is the most full-featured version andadds the following functionality: database projects, accurate comparison andsynchronization of database structures (schema comparison) or database content(data comparison), debugging stored procedures and scripts, complex querycreation.Other tools from dbForge include:- Schema Compare for MySQL
- Data Compare for MySQL
- Query Builder for MySQL
- Fusion for MySQL
DBTools Manager
Manufacturer: DBTools SoftwareWebsite: http://www.dbtools.com.br/EN/dbmanagerpro/Price: Standard Edition is FREE. Enterprise is$69.90 USD for a single license. Discounts are available for multiplelicenses.License: Standard Edition is licensed understandard freeware conditions. The enterprise version is licensed per unitsold.Supported platforms: Windows 2000, XP, Vista, 7Standard Edition
Specially designed for personal use, it has a minimumset of features that makes it ideal for new database users to perform basicdatabase management. You can use this edition for FREE for non commercial use.For commercial use you can purchase a license which will provide additionalfeatures.Enterprise Edition
Designed for Enterprise use, it is more suited for DBAs and developerslooking for an integrated application for database management. You can try itbefore purchasing. The Enterprise Edition trial version comes with all featuresenabled, so that you can try them all for 20 days and make your purchasingdecision based on the full experience.Both include Support for MySQL 3, 4 and 5.MyDB Studio
Manufacturer: H2LSoft,IncWebsite: http://www.mydb-studio.comPrice: FREELicense: freewareSupported platforms: Windows, XP, Vista, 7, 8, 10Our final entry is another studio containing a completecollection of tools for MySQL Server administration. Developers willappreciate its ability to create/edit/drop database objects, DBsynchronization, and data export/import. DBAs can also use MyDB Studio toperform database migration, as well as backups and restores. It supports SSHtunneling to secure your connections, which allows you to connect even if yourhost doesn't allow you remote access connection, user and privilege management,and PHP script creation.Conclusion
Runner-Ups
Of course not every beloved MySQL product could make it onthe list. Here are a few more for your consideration:I am confident that you will find a product to suit yourneeds in this group. They are in no particular order, so feel free to try anythat catches your eye. I should also point out that I received absolutely nofinancial compensation from any of these companies. My assessment of eachproduct is based on my unbiased opinion. As such, my top ten list may divergeslightly from the general consensus.
A few things have changed in the database landscape since our Top 10 MySQL GUI Tools list was compiled--in particular the emergence of cloud services. Keep that in mind when searching for the right MySQL admin tool.
Most relational databases, with the notable exception of MS Access, are comprised of two distinct components: the back-end, where the data is warehoused, and the front-end, a user interface for communicating with the data component. This type of design is quite clever, as it parallels the two tier programming model that separates the data layer from the user interface and allows the makers of the database software to focus on their product’s strongest suit: data storage and management. It also opens the door for third parties to create rich applications to interact with various databases. Such products include Embarkedaro Rapid SQL and Oracle SQL Developer. Here are ten outstanding graphical interfaces for MySQL.