Here we will discuss different backup strategies and methodologies used to take the table backup in SQL Server with real-life examples. There are different methods of taking backup in SQL server.
The T-SQL engine uses INTO clause to copy the data from one table to another table.
Select * INTO BackUP_TABLE_Name
If the user wants to take a backup of ‘Person.Address’ table and did some operations on same table then the following query is useful.
Select * INTO Person.Address_Backup
This type of option is the most used option in Microsoft SQL to take a backup from one server and restore it to another server. The following steps are used to take a backup of the table in the SQL server.
Step 1: Right-click on the database and choose Tasks –> Generate Scripts.
Step 2: Select the database from which you need to take a backup of the table.
Step 3: You will see the Table/View options on the screen while scrolling down. Select the table in which you want to back up and hit the next button.
Step 4: Click on advance
Step 5: Select ‘Types of data to script’ as ‘Schema and data’ & then click OK
Step 6: Type the backup table name, by default extension, will be’.sql’. Then click ‘Save’ > then ‘Next’
Step 7: Review the summary
Step 8: Click ‘Next’, scripting will start.
Backup done !!
DMV ‘sys.dm_exec_requests’ provides details on all of the processes running in SQL Server.
Wait_Type, Wait_Time, Wait_Resource, SUBSTRING(st.text, (qs.statement_start_offset/2)+1,
WHEN -1 THEN DATALENGTH(st.text)
END - qs.statement_start_offset)/2) + 1) AS statement_text, GetDate() SnapshotDateTime,
ss.PROGRAM_NAME, ss.HOST_NAME, ss.Login_Name
FROM sys.dm_exec_requests AS qs INNER JOIN sys.dm_exec_sessions ss
ON qs.session_id = ss.session_id
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS st
WHERE Wait_Time > 0
ORDER BY Wait_Time DESC
“Please let us know if there…
Please help !!!