Insert same rows multiple times in table
Sometimes you need to insert same row multiple times in a table. There are many ways to do that but here we will see one… Read More »Insert same rows multiple times in table
![]()
A Series of SQL Server basics to advanced level SQL Interview questions and answers that are commonly asked in interivew.
Sometimes you need to insert same row multiple times in a table. There are many ways to do that but here we will see one… Read More »Insert same rows multiple times in table
![]()
In this article you will see how to compare column names in two table. Assume that, you have two tables and you are asked to… Read More »How to compare column names in two tables in SQL
![]()
You may have faced a situation where you are asked to find values in a column with leading or trailing spaces or remove the leading… Read More »How to find leading and trailing spaces in SQL Server ?
![]()
How to search for string within xml column in SQL table? As you can see here we have a sample table having categories and products… Read More »Search string in xml
![]()
Sometimes, you need to show range of numbers or may be asked to generate a range of numbers between two numbers in SQL Server. Well,… Read More »Generate a range of numbers between two numbers in SQL Server
![]()
Assume you have a table containing alphabetic, numeric, alphanumeric strings, and special characters, and you need to retrieve only the alphanumeric strings from that data.… Read More »How to fetch alphanumeric string from table
![]()
SQL Server indexes are used by queries to find data values quickly in tables and views. Basically it speed up the queries performance. You can… Read More »Difference between clustered index and non clustered index
![]()
SQL Server update statement is used used to modify an existing records in a table, you can also update records in table based on some… Read More »How to Update from Select Statement in SQL
![]()
Sometimes, you need to store multi language or multilingual data in any table column. Inserting a multilingual data into column without following some basics rules,… Read More »Insert multi language data in table
![]()
Sometimes, you want to store the result of a stored procedure into table or temp table instead of returning the output. Storing output of stored… Read More »How to insert the result of a stored procedure into table
![]()
Sometimes you need to format a date in specific format such as format a date time string YYYY-MM-DD hh:mm:ss. mmm to date MM:DD:YY. SQL Server… Read More »Date and Time Conversions in SQL Server
![]()
Sometime you are required to validate the row counts for each tables in database. So getting a row counts for each tables either through using… Read More »Get Row Counts for all tables in SQL Server
![]()
There are various in-built system catalog views, or metadata functions that you can use to check the existence of column in SQL Server tables. To… Read More »Check if column Exists or not in SQL Server Table
![]()
You can script a table from database using a SQL Server Management Studio. SQL Server Management allows you to script out tables from database using… Read More »Script table in SQL Server
![]()
You can generate a database scripts including the schema and the data by using the Generate Scripts option available in SQL Server Management Studio (SSMS),… Read More »Generate Database Scripts With Data in SQL Server
![]()
Table Value Constructor (TVC) allows to group multiple rows of data in a single DML statement. It can be used as a part of either… Read More »Table Value Constructor
![]()
Selecting a top n records for each category from any table, can be done easily using row_number function which generates a sequential integer to each… Read More »How to get TOP N records for each category
![]()
The IDENT_CURRENT function returns the last IDENTITY value generated for any specific table or view on an identity column in any session and any scope.… Read More »IDENT_CURRENT Function
![]()
How to find and separate the numbers, letters and special characters from string? Suppose you a column in table which contains a mix words which… Read More »Separate numbers, letters and special characters from string
![]()
Xp_readerrorlog is a SQL Server extend stored procedure allows you read the contents of the SQL Server error log files. It allows you to read… Read More »How to Read SQL Server error logs using the xp_readerrorlog
![]()