Posted in Programming, SQL Server on December 29th, 2008 1 Comment »
I was asked to write a SQL server job to restore nightly a database running on a server onto another server. The database on the original
server was backed-up nightly by a database maintenance plan. So the job I was going to write was to find the latest backup on the original server, copy it […]
Posted in SQL Server on October 9th, 2008 5 Comments »
SQL Server permissions can be granted on server, database, schema, and database object level. In SQL server 2005 the permissions can be controlled at a more granular level compare to SQL Server 2000. For example in SQL 2000 if you want to grant someone the permission to run profiler you have to put it into […]
Posted in Programming, SQL Server on September 23rd, 2008 No Comments »
Different database system has different level of control on the truncate statement.
In Sybase you can grant the truncate
privilege to user. In SQL or Oracle database you can not do that. In Oracle in order to truncate a table you have to have the right to drop any table which is not good in […]
Posted in SQL Server on June 22nd, 2008 No Comments »
In my previous post “What is Fragmentation and How to Defragment a Table Being Used Consistently?” I told you that DBCC INDEXDEFRAG command was the solution to defragment in a 24/7 environment. This is only true for SQL 2000.
In SQL server 2005. There is a new way of dealing with it. When you set up […]
Posted in SQL Server on June 21st, 2008 No Comments »
In a recent problem that I was trouble shooting with, I was told that a store procedure which had been running well for a long time was taking exceptionally long time to run and experienced “lock timeout“. When I used the sp_who or sp_who2 system store procedure to look at the running processes one told […]