Certain conditions are checked with the WHEN Statement when using the CASE Statement, and certain results are returned if the condition is met. We can …
Read More »TSQL
While Loop in SQL Server(TSQL)
By creating a loop, we can perform certain operations as long as this loop continues. We can use While Loop as follows. As long as …
Read More »GOTO Statement in SQL Server(TSQL)
If a specific condition occurs, you can use the GOTO statement to run the code in a given label. The use is as follows. [crayon-676bb7fc63c20024915480/]
Read More »Break and Continue Statements in SQL Server(TSQL)
BREAK Statement: You may want to terminate while loop by using the BREAK statement. You can use it as follows. [crayon-676bb7fc63db7546791488/] Continue Statement: Usually …
Read More »IF…ELSE Statement in SQL Server(TSQL)
If the condition in the IF block is provided, operations between the BEGIN and END blocks are performed. If the condition in the IF block …
Read More »IF Statement in SQL Server(TSQL)
If the condition in the “IF” block is provided, we perform operations between the “BEGIN” and “END” blocks. You can use it as follows. …
Read More »String or binary data would be truncated
When we want to add data to a table, we get this error if the size of the column in the table is smaller …
Read More »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, …
Read More »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 …
Read More »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 …
Read More »