How To Create A User In SQL Server Database

How To Create A User In SQL Server Database

As a DBA working with SQL server and managing SQL Server environments, I have created tons of users in SQL server. It is crucial to know how to do this task smoothly. In this article, I will walk you through the simplest approaches I used to follow to create SQL server user. How To Create … Read more

Grant Write Access To Table In SQL Server

Grant Write Access To Table In SQL Server

As a database administrator working in an SQL server, one of my daily activities is to grant different users access to different database objects. In this article, I will walk you through multiple ways to grant write access to SQL server tables. Check out How To Create A User In SQL Server Database before starting. … Read more

Partition Columns For A Unique Index Must Be A Subset Of The Index Key.

Partition Columns For A Unique Index Must Be A Subset Of The Index Key.

Recently, I was trying to create a partitioned table in an SQL server; after executing the SQL script, I got this error. In this article, I will walk you through the solution. I tried executing the SQL script below. The moment I executed the above script, I got this error. Check out the screenshot below for your … Read more

Table Partitioning In SQL Server With Example

table partitioning in sql server with example

As a senior SQL developer working with a reputed MNC, my daily activities involved dealing with large tables, and that’s where table partitioning helped me a lot. In this article, I will walk you through all the complete steps to implementing table partitioning in SQL servers with real-time examples. 1. Creating the Partition Function The … Read more

SQL Server If Object_ID Is Not Null Drop Table

SQL Server If Object_ID Is Not Null Drop Table

As an SQL developer, I often need to drop a table based on certain conditions. After my analysis, I identified that OBJECT_ID IS NOT NULL DROP TABLE, which is a great way to achieve this. In this article, I will walk you through the complete steps to use this pattern. Approach-1: Using a simple If … Read more

SQL Server Create Table 2 Primary Key

SQL Server Create Table 2 Primary Key

Recently, my team was required to create tables with multiple primary keys in SQL Server. We analyzed the requirement and identified a few simple approaches to achieve this. In this article, I will walk you through multiple ways to do this task. Remember that this is known as Composite Primary Key. Before starting, let me … Read more

Cannot Define Primary Key Constraint On Nullable Column In Table

Cannot Define Primary Key Constraint On Nullable Column In Table

Recently, I was working on one critical requirement where I was trying to alter 2 primary keys for a table in SQL server. But after executing the SQL script, I got this error. In this article, I will walk you through the complete steps I followed to fix this issue. I was executing the below … Read more

How To Find Temp Table In SQL Server

How To Find Temp Table In SQL Server

As a senior developer, I used to be required to work with temporary tables. But as you know, the temp table is crucial while working with an SQL server. So, I have identified a few approaches to this. In this article, I will walk you through all those approaches individually. Approach-1: Using the tempdb System … Read more

How To Get Table Count In SQL Server

How To Get Table Count In SQL Server

As a senior SQL developer, I often get the requirement to determine the number of tables in an SQL server database. I analyzed and identified a few approaches to help you achieve this task. I will walk you through all those approaches individually with examples and best practices in this article. Approach-1: Using sys.tables The … Read more