Category: MSSQL

15 Jan by dbtut

Must declare the scalar variable “@variable”

  If there is a variable in the script we run and we have not declared this variable, we will get this error. For example, with the help of the following script, let’s create a table named “databaseandlogins” in the “TestDB” database. [crayon-5c3e6c40ead90234676694/] Then try to add data to this table as follows. [crayon-5c3e6c40ead97856941721/] When […]
15 Jan by dbtut Tags: , , , ,

How To Find and Change Owner of All Databases in an Instance in SQL SERVER

  Sometimes, we can receive the below error. SSPI handshake failed with error code 0x8009030c, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext failed. The Windows error code indicates the cause of failure. The logon attempt failed   [CLIENT:] The reason for this error may be that […]
15 Jan by dbtut

How To Solve Errors in DPM Backup(Failed Backups in DPM)

  DPM (Data Protection Manager) is Microsoft’s software for backup. Before reading this article, I recommend you to read other articles related to DPM on our website. If you type DPM in the search bar, the related articles will appear. You can open the DPM Administration Console and come to the Monitoring tab as shown […]
14 Jan by dbtut Tags: ,

UNION and UNION ALL Operators in SQL Server(TSQL)

  With UNION and UNION ALL Opertors, we can merge multiple sql statement’s result in a single result set. When we merge two SQL statements with the UNION operator, duplicate records are listed once in the result set. When we merge two SQL statements with the UNION ALL operator, all results are listed. If there […]
14 Jan by dbtut

Testing SQL Server Database Connection

  Sometimes the application owners can come to you because the application cannot connect to the database. In this case, a DBA must first test the connection from the application server to the database. It is very easy to test this connection if you have SSMS (SQL Server Management Studio) on the application server. You […]
13 Jan by dbtut Tags: , , , , , , , , , , , , ,

SQL Server Conditions and Loops(TSQL)

  In this article, we will examine the loops and conditions we use in TSQL. Conditions in TSQL: IF Statement in SQL Server: You can use it as follows. [crayon-5c3e6c40eb862743056160/] IF…ELSE Statement in SQL Server: You can use it as follows. We’re running the same IF … ELSE Statement twice by changing the parameter value. […]
13 Jan by dbtut

SQL Server Data Types(TSQL)

It is a very critical step to correctly determine SQL Server Data Types when designing tables to prevent unnecessary growth of the database. The space that data types allocate on the disk is different. For example, suppose you have a column in your table that will contain numbers. If the value of this column will […]
13 Jan by dbtut

Declare Variables in SQL Server(TSQL)

  In this article I will describe how to declare variables in TSQL. We can declare variables in a few different ways. • Declare a single variable • Declare multiple variables at once • Set values when declaring variables • Set values when declaring multiple variables at once Declaring g a single variable: [crayon-5c3e6c40eba9e543483784/] We […]
11 Jan by dbtut Tags: , , , , , , , , ,

ALTER TABLE Statement in SQL Server(TSQL)

We can perform the following operations with ALTER TABLE Statement. Add a column to a table Delete a column from a table Change the data type of a column Increase or decrease the size of a column Switch Partition Enable or disable Constraints or triggers In this article I will describe the above items through […]