Connecting MS SQL Server in Visual Studio Code || Step-by-Step Tutorial for Beginners

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome to this tutorial in this tutorial we are going to connect Ms SQL inside the visual studio code let's begin first of all you must have SQL Server up and running to connect mssql inside Visual Studio code after that we will run some query and we will fetch the data go to this extension and just type here in the search box Ms SQL because we are going to install the MSS extension so the first one SQL Server from microsoft.com so when you see this you will have this blue color install button so we need to Simply click on it to install this extension we have the features contribution change log dependencies and lot more information if you want to read it so you can go through it here so the installation extension is installed successfully you have this message okay now go back and click here on the Explorer now the next thing we have to do we have to change the language go to the file menu click on the new text file when the text file is open you will have these options click on this select a language when you click on the language this will ask you what kind of language you want to proceed with so we have are looking for the SQL so just type here SQL and you will have just selected so this will connect whatever is required to write the SQL so you will have intelligence ad uh support from that from that extension we have just installed on the bottom you can see that initial installing the SQL tools Services something because this is setting up the visual studio code for our requirement to connect the SQL Okay now click here on the left hand side you will have the ad connection also you can get the same option from the command palette when you go to the command palettes if you are doing first time you will not get this option if you are doing second time you will get the option this will associate this activity and go again to the command palette you will connect to the add connection or from the left hand side or you can go this way as well so both are same so when you have this box you have to give some information here let me show you what information we need first you have to open the SQL Server management Studio Okay so relaunch the SQL Server management Studio because we need the connection information okay this way okay you will have this connect to server window what we need we need the server name so we have the server name and we are using the authentication which is Windows authentication so the same authentic authentication we will use inside the visual studio code so what information first we need just copy the server name from this place and go back to the visual studio code and at this box paste it press enter and then this will ask you the particular database name you want to connect with but we don't have the uh any particular database so do not give anything press enter foreign tication type SQL login or integrated the SQL login is like the SQL authentication and the integrated means the windows authentication because you have seen we are going to proceed with the windows authentication that means we have to select the integrated here at this place click on this and if you if you have set up the management Studio server authentication and you must have the login ID and password so just copy these login ID and password go back here and select the SQL login and then user ID first then give the password I hope this is clear now we are on the Windows authentication site so we will do the same thing in the visual studio code as well okay now here I will select the integrated great now this is asking me to give a name to our connection profile if you have a different different databases connection so in that case you can give a useful name that reflect the purpose of the connection so I'm giving like this Dev connection server one once you do that you will have this message on the right hand side you have to click on the enable trust certificate once you do it you will see the profile is created and connected message after that you will see on the left hand side the connections tab appeared and you have that connection and when you expand this tree you will see the databases and when you expand this database you will have the system database inside the system database you will have the all available databases which are by default available now we are successfully connected to the MS SQL Server now I will show you how to run the query so suppose you want to run some query on this master database do the right click select new query and you will see this Untitled Notepad okay simply type the query like select star from DBU and you will have the intellisense help the auto suggestions will help you to write the query so we are going to fetch the data from the first table here we go and go here click this button or simply press Ctrl shift e to run this query when you execute you will see the results on the right hand side this is quite useful we can arrange this view right now we are able to see on the right hand side we have the option to shift this results on the bottom okay when you click on this icon you have the option to export the table data as a CSV file so give us file name and simply save this table data as a CSV file great now we have the second option if you need this data as a Json format we have simply direct option just click on it and save this data as a Json file the third option is also important you can save this data table data as Excel format great so we have all things in one places it's amazing so guys I will suggest you start using the visual studio code to connect your Ms SQL database there are lots of things you can do here in single place inside the visual studio code if you want to disconnect you can simply do the right click and disconnect the database also you will get the query histories the queries you have executed previously all will appear here and you can see anytime also this will show you the timestamp when you have executed these queries it's amazing I have found this Visual Studio code very useful to connect the MS SQL database or any other databases I hope you guys found this tutorial relevant and useful please hit the like button to appreciate and you can subscribe to learn more and for now thanks for watching Cool ID help
Info
Channel: Cool IT Help
Views: 5,791
Rating: undefined out of 5
Keywords: Use the Visual Studio Code to connect mssql server, how to connect sql server with visual studio code, MS SQL Server, VS Code, T-SQL, Visual Studio Code Extensions, SQL Server Integration, Visual Studio Code SQL Server Extension, SQL Server Authentication, SQL Server Configuration, SQL Server Development, SQL Server Express, SQL Server Security, how to connect sql server to visual studio 2022, visual studio code database connection, sql extension for visual studio code
Id: AvNVxRIMvco
Channel Id: undefined
Length: 8min 38sec (518 seconds)
Published: Fri Jun 30 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.