Most of the times, I use the following scripts to get list of triggers SELECT sysobjects.name AS trigger_name ...
INFORMATION_SCHEMA is a quick way to get around a database. Hope this helps. Generate list of all table and columns in the table. Select * ...
How i came across the problem. I created a new DB and was creating table using the following script, use MemDB go --CRATE A MEMORY OP...
It is quiet easy to bring a single database offline in MS SQL Server, rather than bringing the whole database down. There is a bit of diff...
Use the following query to alter a column from NULL to NOT NULL. ALTER TABLE [MaKAS].[dbo].[PMI_Result] ALTER COLUMN [Processed] bit NOT ...
I was trying to restore a database back up on SQL Server 2008 R2 Enterprise. Error was thrown on attempting to restore the database as'...
USE Master_S DECLARE @I int SET @I = 56 While (@I <= 109) BEGIN Delete from Master_S.dbo.RSource where RSourceID = @I SET @I +=1 ...
1. Open SQL Management Studio. Click Tools -> Options from the drop down menu dialog box. 2. In the Options dialog box on the left sid...
We can do table level back up in Management Studio. Select the database --> Right Click database and select option TASKS. Select opti...
I work on Oracle in most of my projects, but this time we are using MS SQL Server for a project. In Oracle it was easy to get table descrip...
SQL multiple inserts are lengthy and time consuming. Today my team lead guided me how to make it less painful. We can use UNION ALL. Instea...
I was trying to export data from one database table to another using cursor, but there are better ways to do this and to improve performance...
Came across this error while restoring backup files to a new database. The error was thrown as i was restoring backup on another existing ...
DECLARE @StartDate datetime, @EndDate datetime SELECT @StartDate='2003-02-03 01:00', @EndDate='2013-09-24 16:30' Select * ...