Daily Archives: April 8, 2013

Getting all the table names from Database

I was creating some POC on migrating the data from Sql Server to MongoDB that time i faced this problem how to get all table names from a particular database in sql server 2008 and i came up with this query SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = ‘BASE TABLE’ After executing this query you […]

How to increase the performance of Stored Procedure

To increase the performance of stored procedure we need follow certain steps Ref:http://www.SqlAuthority.com 1. Include SET NOCOUNT ON statement CREATE PROC dbo.ProcName AS SET NOCOUNT ON; –Procedure code here SELECT column1 FROM dbo.TblTable1 — Reset SET NOCOUNT to OFF SET NOCOUNT OFF; GO 2. Use schema name with object name SELECT * FROM dbo.MyTable — […]