Feed on
Posts
Comments

Archive for the ‘SQL Query’ Category

I love active participation from my readers. Just a day ago I wrote article about SQL SERVER - Simple Use of Cursor to Print All Stored Procedures of Database. I just received comment from Jerry Hung who have improved on previously written article of generating text of Stored Procedure.
DECLARE @procName VARCHAR(100)
DECLARE @getprocName CURSOR
SET @getprocName = CURSOR FOR
SELECT [...]

Read Full Post »

Organizations across the globe are being inundated with regulatory requirements. They also have a strong need to better manage their IT systems to ensure they are operating efficiently and staying secure. Microsoft is often asked to provide guidance and technology to assist organizations struggling with compliance. The SQL Server 2008 Compliance Guidance white paper was [...]

Read Full Post »

SQLAuthority Blog reader YordanGeorgiev has submitted very interesting SP, which uses cursor to generate text of all the Stored Procedure of current Database. This task can be done many ways, however, this is also interesting method.
USE AdventureWorks
GO
DECLARE @procName VARCHAR(100)
DECLARE @getprocName CURSOR
SET @getprocName = CURSOR FOR
SELECT s.name
FROM sysobjects s
WHERE type = ‘P’
OPEN @getprocName
FETCH NEXT
FROM @getprocName INTO @procName
WHILE @@FETCH_STATUS = [...]

Read Full Post »

MVP Open day 2008 is one of the best event happened so far. I have previously written about this event in detail on this blog.
SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa - Link List
SQLAuthority News - Author Visit - South Asia MVP Open Day 2008 - Goa - [...]

Read Full Post »

Yesterday was our last day at South Asia MVP Open Day. For three days continuously we are having great time along with fellow MVP. Every MVP was having great time because the way whole event was planned. We had plenty of time for networking as well lots of interesting sessions were going on.
Most of the [...]

Read Full Post »

At MVP Open Day we were promised that we will have 8 to 8 action packed day but we all observed much longer hours where we all MVP’s were busy with activity. I will say instead of 8 AM to 8 PM we actually had fun from 8 AM to 2 AM (next day).
Day 2 [...]

Read Full Post »

It is great fun! Perfect Event and Great start.
Yesterday I wrote about agenda of South Asia MVP Open Day 2008 which is at Hotel Kenilworth Resorts, Goa. November 15 - Day 1 of Open Day started with plain journey and ended with Goan Team Party at beach with fellow MVP.
I have more than hundreds of [...]

Read Full Post »

Today is very exciting day as I will start my trip to South Asia MVP Open Day 2008 - Goa. Yesterday I wrote about my visit. I will be attending South Asia MVP Open Day 2008 on November 15 - 17, 2008 at Hotel Kenilworth Resorts, Goa. Those who have asked how can they meet [...]

Read Full Post »

I will be attending South Asia MVP Open Day 2008 on November 15 - 17, 2008 at Hotel Kenilworth Resorts, Goa. I am very excited as this will be my first Open Day event after being MVP. Microsoft Most Valuable Professionals (MVPs) are exceptional technical community leaders from around the world who are awarded for [...]

Read Full Post »

Yesterday I wrote about SQLAuthority News - Download RML Utilities for SQL Server. I received many emails where different developers requested how to find additional help regarding RML Utilities. Few users reported that they are not able to install RML Utilities because of some reporting service pre-requisite.
If RML Utilities are not being installed due to [...]

Read Full Post »

The RML utilities allow you to process SQL Server trace files and view reports showing how SQL Server is performing. For example, you can quickly see:
Which application, database or login is using the most resources, and which queries are responsible for that
Whether there were any plan changes for a batch during the time when the [...]

Read Full Post »

SQL Server stores history of all the taken backup forever. History of all the backup is stored in msdb database. Many times older history is no more required. Following Stored Procedure can be executed with parameter which takes days of history to keep. In following example 30 is passed to keep history of month.
USE msdb
GO
DECLARE [...]

Read Full Post »

Today we will see quick script which will check integrity of all the database of SQL Server.
EXEC sp_msforeachdb ‘DBCC CHECKDB(”?”)’
Above script will return you lots of messages in resultset. If there are any errors in resultset they will be displayed in red text. If everything is black text there is no error. Typical output of [...]

Read Full Post »

SQL Server 2008 Books Online is updated on 31 October 2008. I always bookmark latest BOL for my easy reference.
Getting Started: New and Updated Topics (31 October 2008)
Analysis Services - Multidimensional Data: New and Updated Topics (31 October 2008)
Database Engine: New and Updated Topics (31 October 2008)
Integration Services: New and Updated Topics (31 October 2008)
Analysis [...]

Read Full Post »

It was not possible to connect SQL Server 2008 to Visual Studio 2005 so far. Microsoft has released Service Pack once it is installed SQL Server 2008 can be connected to Visual Studio 2005.
Download Microsoft Visual Studio 2005 Service Pack 1 Update for Microsoft SQL Server 2008 Support
For connecting SQL Server 2008 to Visual Studio [...]

Read Full Post »

Yesterday I received following questions on blog. Ashish Agarwal asked following question.
Hi Pinal,
Can we refresh a database (like we do by right clicking database node in object explorer and clicking on refresh) thru SQL Query?
If yes, can you please tell me the query?
Thanks,
Ashish Agarwal
Answer to above question is NO. It is not possible to do [...]

Read Full Post »

I just received following screen shot from one of the regular reader of SQLAuthority.com blog. He pointed out important milestone for our blog. We have crossed 5 millions visitors. In less than 2 years SQLAuthority.com blog has been visited by 5 millions visitors. I even missed the anniversary our blog. On November 1st 2008 SQLAuthority.com [...]

Read Full Post »

Quite often it happens that SQL Server Management Studio’s Dropdown box is cluttered with many different SQL Server’s name. Sometime it contains the name of the server which does not exist or developer does not have access to it. It is very easy to clean the list and start over.

Delete mru.dat file from following location.
For [...]

Read Full Post »

I have received following question nearly 10 times in last week though emails. Many users have received following error while connecting to the database. This error happens when database is dropped for which is default for some of the database user. When user try to login and their default database is dropped following error shows [...]

Read Full Post »

Microsoft has published following three security related white papers. I suggest to all my readers to read them. Read the summary know what is covered in those  white papers.

Engine Separation of Duties for the Application Developer - Separation of duties is an important consideration for databases and database applications. By properly defining schemas and roles, [...]

Read Full Post »

Older Posts »