How to Run SQL Server Using Visual Studio Code | VS Code SQL Server Extension

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome to my Channel today in this video tutorial we are going to learn about connecting to a cable server in Visual Studio code and running some queries from uh here into our Escape server so for that we need our a an extension called Escape in server extension so is cable server if I search here now this first one which is by Microsoft so we will install this now install this it is installing by the way it is showing you the method of using it here so you can study this now you can see here it is installed now I'll close this uh and close this as well now you can see two icons already here so one is a database project and the other one is is cables or a server if I click on this now it will try to download and install the cable server tools now it is showing it right here that installing a skill server to service to this and Ms cable command will not be available after will be available after installing the service now all the packages are installed and done as you can see here now we will add a connection now to add a connection you can see a plus I can appear here so I'll click on this it will ask me to provide the host name install slash instance now here we are using a local server so you can provide your own server name or you can provide local host or you can only provide a DOT as well because dot also refer to a local server so I if I press enter now you can see it is asking me for a database name but it is saying that it is optional if you do not want to select any database you will be connected to master database so I'll click enter now it is asking me for the authentication type so we are using a Windows authentication not a cable server authentication so we will use integrated and press enter now it is asking me for a display name for this connection it is saying this uh this is optional but I'll provide it so scalar server connection now it will test your profile connection and now it has created our connection now you can see these different databases in it so if I right click on this so you can create a new query here you can disconnect you can remove and you can refresh you can create a project from database now if I expand this step now you can have these databases which we have in our SQL Server all are loaded here now if I right click on this one and if I make this a new query here so it means it is connecting this cro data or if I right click on this and click on new query then it is uh automatically connected to this DB tutorials and then when you execute a query it will be executed on this DB tutorials now I'll go here right click on this connection and new query and now I'll uh use here select DB and I'll go here to this DB name and now if I run this I can run it by two ways either click on display button or right click here and execute query now you can see that it is uh showing us that we are connected to our Master database so I'll close this and now we will create a database here so I'll use a create and data base and then I will use database name as uh test SQL vs and now if I execute this by clicking on this run button now it will try to execute this and and we'll create a database um but it has executed successfully command completed successfully so now I'll right click on this and refresh this and now we will go down and you can see this SQL vs now we will try to create a table inside this so for that I will come here right click on this and new query now here I will use a create and then I will use table or I will use the table so it is automatically showing me here this cable create table so if I double click on this so it will create this query for me so I'll remove uh all the code that is above here so I'll remove this up to here now we're going to create a simple table so here I can change the table name so here I'll use it uh test underscore table and or I'll I will use small text and now I'll remove this uh ID column and we will use these two columns so I'll use a here so here we will provide the column name so I'll use name and then I'll provide the profession or further name so I'll provide location and now our query is created so it will create a table pass in this test SK will we will store your code so if I run this so command successfully complete it so now I'll come here right click on this uh refresh this and I'll go here and expand tables and now you can see this table and here now we will insert some data into it so I'll remove this query so if I use here insert so it is automatically showing me if I show you insert cable insert rows so if I select this now you can insert here so it is saying us to insert two rows but I will insert only one so I'll remove this and here I would use our table name so table name is uh test underscore table so I'll use uh test underscore table and um here I will use the column name so the column name is uh name and here we will provide the column name the second column name which is a profession and I'll remove this this column name because we have only two columns so I'll remove this as well from here up to here now I'll remove this and make this developer and name I'll use single quotes and inside this I will use a m i k and now I'll remove this comma as well now we will execute this and let's see if it is working now if I run this now one row affected now we will select uh the data from this row so from this table so I'll use select so it is saying select is given select so I'll use this so here it is uh providing us the select query which is not perfect so I'll remove Ctrl a base and backspace is and to select uh static from um test underscore payable [Applause] and now if I execute this now you can see in my it has shown us the mik and developer the first record now if we insert other records it will show us that now you can also use a update so far update I will use update and this cable update and it is providing us all the content so I will use update table name test underscore table and here I will set the column name as profession and I will make this teacher and remove this single quotes teacher and remove this and here we will use VR name [Music] equal to this and K now um if I execute this right now so one row affected so now we will go and select the data from this so now I'll use a select direct from test underscore table and now I'll execute this now you can see that the profession is updated to from developer to teacher so I think that's all in this way you can work uh together with the escible server and visual studio code and you can create databases as well as tables and Cube rhythm in Visual Studio code so I think that's all for today I hope you like the video if you like the video please like subscribe and comment thank you
Info
Channel: Programming Guru
Views: 15,431
Rating: undefined out of 5
Keywords: #vs code extensions: mssql and vscode-database, #mssql extension for vs code, #how to connect sql server in visual studio code and installation, #sql server in visual studio code, vs code, visual studio code, vscode, vs code sql server, SQL Server, Visual Studio Code, Microsoft SQL Server, connect to mssql server using visual studio code and queries, SQL SERVER in VS code, Run sql server vs code, sql in vscode, vs code sql, How to Run SQL Server in visual studio code
Id: qW44w4HZoDw
Channel Id: undefined
Length: 12min 23sec (743 seconds)
Published: Tue Nov 15 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.