<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ajeet</title>
    <description>The latest articles on DEV Community by Ajeet (@appliedk).</description>
    <link>https://dev.to/appliedk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F845000%2Fefc87e56-8161-4778-b0c0-b8feca1dff56.png</url>
      <title>DEV Community: Ajeet</title>
      <link>https://dev.to/appliedk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/appliedk"/>
    <language>en</language>
    <item>
      <title>SQL Server Management Studio (SSMS)</title>
      <dc:creator>Ajeet</dc:creator>
      <pubDate>Mon, 19 Feb 2024 21:49:58 +0000</pubDate>
      <link>https://dev.to/appliedk/sql-server-management-studio-ssms-3b11</link>
      <guid>https://dev.to/appliedk/sql-server-management-studio-ssms-3b11</guid>
      <description>&lt;p&gt;In &lt;a href="https://appliedk.blogspot.com/2023/12/Introduction%20to%20SQL%20Server.html" rel="noopener noreferrer"&gt;previous post&lt;/a&gt;, we learnt basic introduction to SQL Server. In this post we will learn about SSMS (SQL Server Management Studio) software and how to use it. SSMS is a client tool which is used to connect and interact with SQL Server. Before working with SSMS tool, we should be aware that SQL Server is server software. In client server model, client sends request to server and the server software responds to the client request. &lt;strong&gt;We use SSMS as a client tool to interact with SQL server&lt;/strong&gt;. Interaction is for the purpose of management of SQL Server. By using SSMS, we can control different features such as user management, security management, querying different database objects such as system tables, user defined tables, executing stored procedures etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0mdnymoqks68pkfjdwf1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0mdnymoqks68pkfjdwf1.png" alt=" " width="800" height="493"&gt;&lt;/a&gt;&lt;br&gt;
Multiple instances of SSMS client tool can be used to interact with an instance of SQL server. If you have installed SSMS at your PC, you can run multiple instances of SSMS. Each instance of SSMS will have its separate session. In real-world production environment, SSMS client tools will be distributed across different client machines and they can interact with an instance of the SQL server simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fghkchnsndtuaz81671z6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fghkchnsndtuaz81671z6.png" alt=" " width="800" height="493"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Connection with SQL server&lt;/strong&gt;&lt;br&gt;
To interact with SQL server, there must be connection between SSMS and SQL Server. We will learn how we can connect SSMS with SQL server. Needless to say that to connect SSMS with the SQL server, SSMS must be pre-installed on our system. Download SSMS from Microsoft site and install it at your system from this link if you have not installed it.&lt;br&gt;
First of all, check that an instance of SQL Server is running on system because SSMS can connect with SQL Server only if it is running. If instance is running, open SSMS (SQL Server Management Studio); otherwise start an instance of SQL Server on the system. You can check the instance of SQL Server running at your system by opening the Services. If it is not in &lt;strong&gt;Running&lt;/strong&gt; state then start it.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqvcesrrhewaok8asp4gr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqvcesrrhewaok8asp4gr.png" alt=" " width="800" height="315"&gt;&lt;/a&gt;&lt;br&gt;
On running the SSMS, "&lt;strong&gt;Connect to Server&lt;/strong&gt;" dialog box will open up as shown below. You have to fill the correct information to different text box controls to authenticate with SQL Server. Only authenticated user is allowed to login SQL Server because the server is a secure system.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzy705s1wj1gh173i8d9x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzy705s1wj1gh173i8d9x.png" alt=" " width="477" height="315"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Server Type&lt;/strong&gt;:  SQL Server Database Engine&lt;br&gt;
&lt;strong&gt;Server name&lt;/strong&gt;: Enter the server name that you want to connect with. Server name is an IP address or URL. At your local system, local host can be used as server name. Depending upon the instance of SQL Server running on system, you can decide about server name. In production environment, SQL Server will be installed at a server machine. At your local system, server name can be local host or MSSQLLocalDB etc.&lt;br&gt;
&lt;strong&gt;LocalDB&lt;/strong&gt;: At my system, an instance of SQL Server Express LocalDB is running. By default, access to the instance of LocalDB is limited to its owner. According to MSDN, LocalDB is a feature you select during SQL Server Express installation, and is available when you download the media. If you download the media, either choose Express Advanced or the LocalDB package. Visual Studio 2019 and 2022 customers should install SQL Server Express 2019. &lt;br&gt;
The SqlLocalDB.exe can be searched in C:\Program Files\Microsoft SQL Server folder. At my system, it is available at C:\Program Files\Microsoft SQL Server\120\Tools\Binn&amp;gt;SqlLocalDB.exe&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Authentication&lt;/strong&gt;: SQL Server is a secure system which needs correct credentials to connect with. There are different modes to authenticate to SQL Server. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;SQL Server Authentication&lt;/strong&gt;: In this mode, enter valid username and password to connect with SQL server instance. This is known as SQL Server authentication mode to connect with. &lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Windows Authentication&lt;/strong&gt;: You can also use windows authentication mode to connect with SQL server. Connecting SSMS with SQL server using windows authentication is known as trusted connection. The best thing about windows authentication is that user doesn’t have to worry about username and password to connect with SQL Server. If you are using your personal computer then you don't have to worry about username and password, automatically the system will connect with SQL server in the trusted connection mode but in the business environment where active directory is used, the admin has to create different groups and users and so admin has to do some twitching to allow windows authentication to work for a user.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Mixed Authentication&lt;/strong&gt;: There is a third option to connect with SQL Server which is known as mixed mode. In this mode you can use either SQL server authentication or Windows authentication.
I have used windows authentication to login. 
Note that If SQL Server is not running then connection will fail and will throw error as shown below.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr6kl68qa64vc95bys1r1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr6kl68qa64vc95bys1r1.png" alt=" " width="607" height="190"&gt;&lt;/a&gt;&lt;br&gt;
After login, the first step is to explore all objects which are available in SQL Server. SSMS provides &lt;strong&gt;Object Explorer&lt;/strong&gt; window to look at any object of the server. Press F8 to view Object Explorer if it is not visible. In SSMS, Object Explorer window looks like below snapshot.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkx2v1y3tozqfh4vy0b0z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkx2v1y3tozqfh4vy0b0z.png" alt=" " width="534" height="371"&gt;&lt;/a&gt;&lt;br&gt;
Note that if SQL Server is freshly installed then only system databases and system database objects will be visible in Object Explorer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Session in SSMS&lt;/strong&gt;&lt;br&gt;
When SSMS connects with SQL Server, session is created for the login. When user closes SSMS then session terminates for the login.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running SQL Script in SSMS&lt;/strong&gt;&lt;br&gt;
Running SQL script is SSMS is fundamental skill. Press CTRL + N to open a SQL Query editor window. You can also click New Query button in Menu Bar for this. In the editor, write test script SELECT * FROM INFORMATION_SCHEMA.TABLES and press F5 or CTRL+E to execute the script. You can use Execute button to run the script. Before running a script, relevant database must be selected from dropdown. In this example, master database is selected.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flrux6bbeqzfgwbduuuh4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flrux6bbeqzfgwbduuuh4.jpg" alt=" " width="679" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Execution Plan of Query&lt;/strong&gt;&lt;br&gt;
The next skill in SSMS is to get the execution plan of a query. Press CTRL + L to get it. Look at the following result in snapshot for the above query.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9hal3bjktyou60jmm0x.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9hal3bjktyou60jmm0x.jpg" alt=" " width="800" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Query Options&lt;/strong&gt;&lt;br&gt;
Query options can be set using by clicking ‘Query Options’ button in Menu Bar or by using Query &amp;gt; Query Options. Look at the following screenshot.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fje4w0u27sw161iscdjp6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fje4w0u27sw161iscdjp6.png" alt=" " width="459" height="91"&gt;&lt;/a&gt;&lt;br&gt;
On clicking Query Options, we get Query Options dialog box which can be used to set the result or set ANSI settings etc.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjc8z95awkyki0uijb64m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjc8z95awkyki0uijb64m.png" alt=" " width="638" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating projects in SSMS&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; To create a new project, press CTRL+SHIFT+N.&lt;/li&gt;
&lt;li&gt; View all projects in Solution Explorer.
A SQL Server script project has connections and queries apart from many other objects. You can create multiple script files in a project. A snapshot is given below.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flolioennal82f59qi4a2.png" alt=" " width="402" height="437"&gt;
Read more features at the &lt;a href="https://appliedk.blogspot.com/2023/12/SQL%20Server%20Management%20Studio%20SSMS.html" rel="noopener noreferrer"&gt;link&lt;/a&gt;.
In the next post, we will learn about SQL Server &lt;a href="https://appliedk.blogspot.com/2023/12/SQL%20Server%20System%20Databases.html" rel="noopener noreferrer"&gt;System Databases&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>sql</category>
      <category>sqlserver</category>
      <category>tsql</category>
      <category>ssms</category>
    </item>
    <item>
      <title>Introduction to SQL Server</title>
      <dc:creator>Ajeet</dc:creator>
      <pubDate>Sat, 17 Feb 2024 16:03:16 +0000</pubDate>
      <link>https://dev.to/appliedk/introduction-to-sql-server-3b6c</link>
      <guid>https://dev.to/appliedk/introduction-to-sql-server-3b6c</guid>
      <description>&lt;p&gt;In this post we will get basic understanding about SQL Server. Before that we will get understanding about clients and servers and their types in brief.&lt;br&gt;
&lt;strong&gt;Server&lt;/strong&gt; is software that processes the request sent by &lt;strong&gt;client&lt;/strong&gt; software. The machine on which server software is installed is known as &lt;strong&gt;server machine&lt;/strong&gt; and the machine on which client software is installed is known as &lt;strong&gt;client machine&lt;/strong&gt;. When client sends a request to the server then server processes the request, if the server is running, and sends the response back to the client machine. This &lt;strong&gt;request-response cycle&lt;/strong&gt; is known as communication between client and server.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flw6cymxsxhwefz5iqstd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flw6cymxsxhwefz5iqstd.png" alt=" " width="664" height="464"&gt;&lt;/a&gt;&lt;br&gt;
There are different types of &lt;strong&gt;server software&lt;/strong&gt; used for different purposes; for example, database server software, web server software, email server software etc. For each type of server software, we require specific type of &lt;strong&gt;client software&lt;/strong&gt;; for example, for web server we need client software called Browser. Similarly for email server we use email clients. For example, Gmail is an email server running at an IP address. Microsoft Outlook is an email client. Email clients use protocol like IMAP or POP3.&lt;br&gt;
&lt;strong&gt;SQL Server is database software&lt;/strong&gt; developed by Microsoft. In market there is other database software such as MySQL, MS Access, PostgreSQL etc. In this post we will focus on SQL Server and its functionality, irrespective of its versions.&lt;br&gt;
&lt;strong&gt;Database software&lt;/strong&gt; is used to manage different databases created inside the database server and their objects. To understand a &lt;strong&gt;database server&lt;/strong&gt; we should first of all understand what database is.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4tjhu4tuiopko09owat7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4tjhu4tuiopko09owat7.png" alt=" " width="513" height="380"&gt;&lt;/a&gt;&lt;br&gt;
Databases are created and managed by database server. A &lt;strong&gt;database&lt;/strong&gt; is a container to store data. Different types of data can be stored in a database; they are known as &lt;strong&gt;database objects&lt;/strong&gt;. In a database, data is stored, fundamentally, inside tables and to manage the data of tables database server creates other database objects such as stored procedures, index, Rules, Roles etc. You can create N number of databases in SQL Server and each database will have database objects.&lt;br&gt;
Before going ahead we look at the distinction between file database server and client server databases. In a &lt;strong&gt;file server database&lt;/strong&gt;, data is stored in files and retrieved from it. When any change is made to the data then the file is opened by client application and data is written into it. To display existing data, application opens the file and read the data. In case of file database server, multiple users can write to the same data file.&lt;br&gt;
In a &lt;strong&gt;client server database&lt;/strong&gt; data is still stored in files. Access to the files is controlled by a master program known as server. If client application wants to make use of the existing data, the client application sends a request to the server application. The server finds the proper data and sends it back to the client.&lt;br&gt;
Similarly when the client wants to write some data into file then it sends request to the server. The server processes the request and writes the data into the file. So we find that there is a controller program that is database server software which takes the responsibility of reading data from file and writing data into file. The client applications send requests and it is the responsibility of the server to decide processing these requests.&lt;br&gt;
The server software acts as a &lt;strong&gt;gatekeeper of clients' requests&lt;/strong&gt; and enforces different kind of policies such as data integrity, data security, user management etc.&lt;br&gt;
In client server architecture, server software e.g. database server resides at server machine and through the network, client machine communicates with the server machine. The network bandwidth and other such factors affect the communication.&lt;br&gt;
The client server database includes feature of logging of transactions which allows recovery of data on disk failure or network error. This is not available in the file server database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of database&lt;/strong&gt;&lt;br&gt;
There are different types of databases available in the market based on different architectures and principles. There are different database models such as network database model, hierarchical database model, relational database model etc. The latest database model is relational database in which data is managed inside tables.&lt;br&gt;
&lt;strong&gt;OLAP vs. OLTP&lt;/strong&gt;&lt;br&gt;
OLTP database mainly focuses on transactions processing; for example, insertion, deletion and updating of data. OLAP database mainly focuses on static data which are read to analyze the market trend etc. we will discuss about relational database in some other post which is based on relational principles.&lt;br&gt;
&lt;strong&gt;SQL Server is relational database server&lt;/strong&gt;&lt;br&gt;
In a relational database, data are stored in tables based on relational database principles given by EF Codd. SQL Server is a relational database. Its core component is a database engine which is based on relational principles. The SQL Server database engine has query processor to execute a query and storage engine to store data securely. The storage engine uses file manager, lock manager, transaction manager and many utilities programs e.g. DBCC. &lt;br&gt;
The query processor includes programs like Parser, Optimizer, SQL Manager, Database Manager and Query Executor.&lt;br&gt;
Parser parses the SQL script and Optimizer provides query hints to optimize the script execution.&lt;br&gt;
&lt;strong&gt;SQL Server Editions&lt;/strong&gt;&lt;br&gt;
Microsoft provides different editions of SQL Server. &lt;/p&gt;

&lt;p&gt;The SQL Server Enterprise Edition is used in enterprise environment. It includes all features of SQL Server. The SQL Server Developer Edition has fewer features than Enterprise Edition. The SQL Server Express Edition is free edition. &lt;br&gt;
&lt;strong&gt;Versions of SQL Server **&lt;br&gt;
Microsoft has released different versions of SQL Server editions over long period of time. The SQL Server Community is the latest edition.&lt;br&gt;
**Download SQL Server&lt;/strong&gt;&lt;br&gt;
Go to this &lt;a href="https://www.microsoft.com/en-us/sql-server/sql-server-downloads" rel="noopener noreferrer"&gt;link&lt;/a&gt; to download SQL Server latest edition. &lt;/p&gt;

&lt;p&gt;In next &lt;a href="https://appliedk.blogspot.com/2023/12/SQL%20Server%20Management%20Studio%20SSMS.html" rel="noopener noreferrer"&gt;post&lt;/a&gt;, we will learn about SQL Server Management Studio (SSMS).&lt;/p&gt;

</description>
      <category>sql</category>
      <category>sqlserver</category>
    </item>
  </channel>
</rss>
