- Visual Studio For Mac Os X
- Visual Studio And Sql Server
- Sql Server Visual Studio Code
- Visual Studio For Mac Open Sql Database Files Require
Turn Visual Studio Code into a powerful editor for Transact-SQL (T-SQL) development with the mssql extension available in the VS Code Marketplace. The mssql extension is optimized to work with SQL Server running on-premises, in any cloud, Azure SQL Database, and Azure SQL Data Warehouse. DB Browser for SQLite is a high quality, visual, open source tool to create, design, and edit database files compatible with SQLite. It is for users and developers wanting to create databases, search, and edit data.
Visual Studio Code è un editor grafico di codice per Linux, macOS e Windows.Visual Studio Code is a graphical code editor for Linux, macOS, and Windows.Supporta estensioni, tra cui l'estensione mssql per l'esecuzione di query su Microsoft SQL Server, database SQL di Azure e SQL Data Warehouse.It supports extensions, including the mssql extension for querying Microsoft SQL Server, Azure SQL Database, and SQL Data Warehouse.In questa guida introduttiva si usa Visual Studio Code per connettersi a un database SQL di Azure e quindi eseguire query e inserire, aggiornare ed eliminare dati con istruzioni Transact-SQL.In this quickstart, you'll use Visual Studio Code to connect to an Azure SQL database and then run Transact-SQL statements to query, insert, update, and delete data.
PrerequisitiPrerequisites
un database SQL di Azure.An Azure SQL database.Per creare e quindi configurare un database in Database SQL di Azure è possibile usare una di queste guide introduttive:You can use one of these quickstarts to create and then configure a database in Azure SQL Database:
Database singoloSingle database Istanza gestitaManaged instance CreateCreate PortalePortal PortalePortal CLICLI CLICLI PowerShellPowerShell PowerShellPowerShell ConfigurareConfigure Regola del firewall IP a livello di serverServer-level IP firewall rule Connettività da una VMConnectivity from a VM Connettività da localeConnectivity from on-site Caricare i datiLoad data Adventure Works caricato in base alla guida introduttivaAdventure Works loaded per quickstart Ripristinare Wide World ImportersRestore Wide World Importers Ripristinare o importare Adventure Works dal file BACPAC ottenuto da GitHubRestore or import Adventure Works from BACPAC file from GitHub Importante
Gli script in questo articolo sono scritti in modo da usare il database Adventure Works.The scripts in this article are written to use the Adventure Works database.Con un'istanza gestita, è necessario importare il database Adventure Works in un database dell'istanza oppure modificare gli script di questo articolo in modo da usare il database Wide World Importers.With a managed instance, you must either import the Adventure Works database into an instance database or modify the scripts in this article to use the Wide World Importers database.
Visual Studio For Mac Os X
Installare Visual Studio CodeInstall Visual Studio Code
Assicurarsi di aver installato l'ultima versione di Visual Studio Code e di aver caricato l'estensione mssql.Make sure you have installed the latest Visual Studio Code and loaded the mssql extension.Per indicazioni sull'installazione dell'estensione mssql, vedere Installare Visual Studio Code e mssql for Visual Studio Code (mssql per Visual Studio Code).For guidance on installing the mssql extension, see Install VS Code and mssql for Visual Studio Code .
Configurare Visual Studio CodeConfigure Visual Studio Code
Mac OSMac OS
Per macOS è necessario installare OpenSSL, che è un prerequisito per .NET Core usato dall'estensione mssql.For macOS, you need to install OpenSSL, which is a prerequisite for .NET Core that mssql extension uses.Aprire il terminale e immettere i comandi seguenti per installare brew e OpenSSL.Open your terminal and enter the following commands to install brew and OpenSSL.
Linux (Ubuntu)Linux (Ubuntu)
Non è necessaria alcuna configurazione speciale.No special configuration needed.
WindowsWindows
Non è necessaria alcuna configurazione speciale.No special configuration needed.
Ottenere informazioni di connessione SQL ServerGet SQL server connection information
Ottenere le informazioni di connessione necessarie per connettersi al database SQL di Azure.Get the connection information you need to connect to the Azure SQL database.Nelle procedure successive saranno necessari il nome completo del server o il nome host, il nome del database e le informazioni di accesso.You'll need the fully qualified server name or host name, database name, and login information for the upcoming procedures.
Accedere al portale di Azure.Sign in to the Azure portal.
Passare alla pagina Database SQL o Istanze gestite di SQL.Navigate to the SQL databases or SQL managed instances page.
Nella pagina Panoramica verificare il nome completo del server accanto a Nome server per un database singolo o accanto a Host per un'istanza gestita.On the Overview page, review the fully qualified server name next to Server name for a single database or the fully qualified server name next to Host for a managed instance.Per copiare il nome del server o il nome host, passare il puntatore su di esso e selezionare l'icona Copia.To copy the server name or host name, hover over it and select the Copy icon.
Impostare la modalità linguaggio SQLSet language mode to SQL
In Visual Studio Code impostare la modalità di linguaggio su SQL per abilitare i comandi mssql e T-SQL IntelliSense.In Visual Studio Code, set the language mode to SQL to enable mssql commands and T-SQL IntelliSense.

Aprire una nuova finestra di Visual Studio Code.Open a new Visual Studio Code window.
Premere CTRL+N.Press Ctrl+N.Verrà aperto un nuovo file di testo normale.A new plain text file opens.
Selezionare Testo normale nell'angolo inferiore destro della barra di stato.Select Plain Text in the status bar's lower right-hand corner.
Nel menu a discesa Seleziona modalità linguaggio visualizzato selezionare SQL.In the Select language mode drop-down menu that opens, select SQL.
Connettersi al databaseConnect to your database
Usare Visual Studio Code per stabilire una connessione al server di database SQL di Azure.Use Visual Studio Code to establish a connection to your Azure SQL Database server.
Importante
Prima di continuare, assicurarsi di avere a disposizione le informazioni di accesso e del server.Before continuing, make sure that you have your server and sign in information ready.Se dopo aver iniziato a immettere le informazioni del profilo di connessione si sposta lo stato attivo da Visual Studio Code, sarà necessario iniziare di nuovo la creazione del profilo.Once you begin entering the connection profile information, if you change your focus from Visual Studio Code, you have to restart creating the profile.
In Visual Studio Code premere CTRL+MAIUSC+P o F1 per aprire il riquadro comandi.In Visual Studio Code, press Ctrl+Shift+P (or F1) to open the Command Palette.
Selezionare MS SQL:Connect (MS SQL: Connetti) e premere INVIO.Select MS SQL:Connect and choose Enter.
Selezionare Create Connection Profile (Crea profilo di connessione).Select Create Connection Profile.
Seguire le istruzioni per specificare le proprietà di connessione del nuovo profilo.Follow the prompts to specify the new profile's connection properties.Dopo aver specificato ogni valore, premere INVIO per continuare.After specifying each value, choose Enter to continue.
ProprietàProperty Valore consigliatoSuggested value DescrizioneDescription Nome serverServer name Nome completo del serverThe fully qualified server name Ad esempio, mynewserver20170313.database.windows.net.Something like: mynewserver20170313.database.windows.net. Nome databaseDatabase name mySampleDatabasemySampleDatabase Database a cui connettersi.The database to connect to. autenticazioneAuthentication Account di accesso SQLSQL Login Questa esercitazione usa l'autenticazione SQL.This tutorial uses SQL Authentication. Nome utenteUser name Nome utenteUser name Nome utente dell'account amministratore del server usato per creare il server.The user name of the server admin account used to create the server. Password (SQL Login) (Password - Account di accesso SQL)Password (SQL Login) PasswordPassword Password dell'account amministratore del server usato per creare il server.The password of the server admin account used to create the server. Save Password? (Salvare la password?)Save Password? Sì o NoYes or No Selezionare Sì se non si vuole immettere la password ogni volta.Select Yes if you do not want to enter the password each time. Immettere un nome per questo profiloEnter a name for this profile Nome di profilo, ad esempio mySampleProfileA profile name, such as mySampleProfile Un profilo salvato velocizza la connessione agli accessi successivi.A saved profile speeds your connection on subsequent logins. Se l'operazione ha esito positivo, viene visualizzata una notifica che informa che il profilo è stato creato e connesso.If successful, a notification appears saying your profile is created and connected.
Eseguire query sui datiQuery data
Eseguire l'istruzione SELECT Transact-SQL seguente per eseguire una query per individuare i primi 20 prodotti per categoria.Run the following SELECT Transact-SQL statement to query for the top 20 products by category.
Nella finestra dell'editor incollare la query SQL seguente.In the editor window, paste the following SQL query.
Premere CTRL+MAIUSC+E per eseguire la query e visualizzare i risultati ottenuti dalle tabelle
Product
eProductCategory
.Press Ctrl+Shift+E to run the query and display results from theProduct
andProductCategory
tables.
Inserire datiInsert data
Eseguire l'istruzione INSERT Transact-SQL seguente per aggiungere un nuovo prodotto nella tabella SalesLT.Product
.Run the following INSERT Transact-SQL statement to add a new product into the SalesLT.Product
table.
Sostituire la query precedente con questa.Replace the previous query with this one.
Premere CTRL+MAIUSC+E per inserire una nuova riga nella tabella
Product
.Press Ctrl+Shift+E to insert a new row in theProduct
table.
Aggiornare i datiUpdate data
Eseguire l'istruzione UPDATE Transact-SQL seguente per aggiornare il prodotto aggiunto.Run the following UPDATE Transact-SQL statement to update the added product.
Sostituire la query precedente con questa:Replace the previous query with this one:
Premere CTRL+MAIUSC+E per aggiornare la riga specificata nella tabella
Product
.Press Ctrl+Shift+E to update the specified row in theProduct
table.
Eliminare i datiDelete data

Eseguire l'istruzione DELETE Transact-SQL seguente per rimuovere il nuovo prodotto.Run the following DELETE Transact-SQL statement to remove the new product.
Sostituire la query precedente con questa:Replace the previous query with this one:
Premere CTRL+MAIUSC+E per eliminare la riga specificata nella tabella
Product
.Press Ctrl+Shift+E to delete the specified row in theProduct
table.
Passaggi successiviNext steps
- Per connettersi ed eseguire query con SQL Server Management Studio, vedere Guida introduttiva: Usare SQL Server Management Studio per connettersi a un database SQL di Azure ed eseguire query sui dati.To connect and query using SQL Server Management Studio, see Quickstart: Use SQL Server Management Studio to connect to an Azure SQL Database and query data.
- Per connettersi ed eseguire query con il portale di Azure, vedere Guida introduttiva: Usare l'editor di query SQL del portale di Azure per connettersi ed eseguire query sui dati.To connect and query using the Azure portal, see Quickstart: Use the SQL Query editor in the Azure portal to connect and query data.
- Per un articolo di MSDN Magazine sull'uso di Visual Studio Code, vedere il post di blog Crea un IDE di database con estensione MSSQL.For an MSDN magazine article on using Visual Studio Code, see Create a database IDE with MSSQL extension blog post.
[wp_ad_camp_1]
I try to look for some tools to open a sample database attached with application development sample on the net. I have found that the file has an extension .sdf. It make me strange at first because I do not really know what that file extension would be. Would that possible a database file or just a flat file? It is exactly as what I thought, it is an extension file for an SQL Server Compact Edition. A sample of Northwind.sdf (SQL Compact Edition 3.5) file can be download from my backup here.
Microsoft SQL Server Compact (SQL CE) is a compact relational database produced by Microsoft for applications that run on mobile devices and desktops. Prior to the introduction of the desktop platform, it was known as SQL Server for Windows CE and SQL Server Mobile Edition
This guide is provide the step on how to open the file content using either extension is Visual Studio or standalone application call LINQPad. I made these to share with you all in case that you need to see the data, schema of that SQL Compact Edition look like.
Currently there are two possibility to open .sdf (SQL Compact Edition):
- Using Visual Studio toolbox
It is support in Visual Studio 2015, 2013, 2012, 2010. You need to download SQL Server Compact/SQLite Toolbox from Microsoft or from my backup and install it into your PC.
Here are the step to integrated into Visual Studio:
- Download SQL Server Compact/SQLite Toolbox for Visual Studio
You can download toolbox for Visual Studio from Microsoft Web site or from my own copy of SqlCeToolbox.4.5.0.3.vsix in case of previous link does not works.
- Install toolbox extension
Before installing it is a must to close your Visual Studio if you are currently open first otherwise you can not see the change effect to your IDE, then double click on the file you have just downloaded to proceed to the setup process.
- Install SQL Server Compact runtime
The Toolbox requires one of these SQL Server Compact runtime MSIs to be installed, if you want to connect to a SQL Server Compact database file:
Download 3.5 SP2 – installed with VS 2010
Download 4.0 SP1 – installed with VS 2012 (No runtimes are installed with VS 2013 and VS 2015)
- Open Visual Studio to see toolbox extension being installed
Once the toolbox is installed, now it is ready for the feature of opening *.sdf file extension in Visual Studio. What is mac studio fix powder (shivering white) used for.
It is time to try it out by your self from Northwind.sdfcompact edition sample in Visual Studio 2012.
- Right click on Data Connections to create new connection
- Click on Add SQL Server Compact Edition 3.5 connection…
- Browse to the sample file which you just downloaded
- Finally, you can view the content of .sdf(SQL Server Compact Edition 3.5)
- Using LINQPad
Visual Studio And Sql Server
You have already seen the possibility to open SQL Compact Database in Visual Studio using ToolBox. This section I will show you another alternative with a super light weight executable around 15MB which has same capability as SQL Compact Toolbox in opening *.sdf file extension. It is free without expiration for a Standard Edition. That program is call LINQPad.
It’s the most powerful Pinnacle Studio yet See what’s new in Pinnacle Studio 21 – our best just got better! Pinnacle studio 17 patch.
- Where to get LINQPad?
The program is base on .Net Framework, so before being able to use the stand alone program, your PC need to have .Net Framework prior install.
Up-to-Date, there have two version available where you can download it from their official website at www.linqpad.net or with my personal backup LINQPad 4 for .NET Framework 4.0 / 4.5 and LINQPad 5 for .NET Framework 4.6
- How to install?
- By clicking on the file you just download
- Choose where your files will be installed to. I think we just leave it to their default setting
- Associate file extension to be able to open with LINQPad
- Finally stage is to check “Launch LINQPad”, follow by clicking Finich Button
Sql Server Visual Studio Code
- How to open .sdf file?
Note:
If you got error while linking to sample database similar like 'the required DbProvider registration is not present'
or 'Unable to find Requested .Net Framework Data Provider. It may not install'
. You would need to download Microsoft SQL Server Compact 3.5 Service Pack 2 run time for Windows Desktop and install in your PC.
- Click on Add Connection
- Then choose Default(LINQ to SQL)
- Choose provider in our case is
SQL CE 3.5
, then click onBrowse
to search for the sample file that I had mention above (Northwind.sdf). You can click onTest
button to see whether your setting are correctly works. In any case, alert message will be shown. Once the test is running smooth, just click on buttonOk
to go through database exploration. - Finally, we can explore all their tables
Visual Studio For Mac Open Sql Database Files Require
Now, you see it is not complicate if we knew the tools. If you have trouble on following my guideline, please fill free to contact me.