.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

checking for database objects that don't compile

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :Sql Server

It has always struck me that SQL server doesnt have a way in which I can run automated tests or checks on the database to weed out objects that no longer work/compile/execute. As we all know, sometimes database schema changes frequently i.e a column rename is a classical example and some stored procedures/functions which may be legacy then no longer works, in my situation a legacy application was re-written, but it was difficult picking up the objects specific to that application, so as the schema has changed, some procs and functions no longer work, but such objects are no longer required to be on the DB, but we want to pick out the ones that no longer compiles and remove appopriately.

Any ideas ?

View Complete Post

More Related Resource Links

Database diagram support objects cannot be installed...

I can't make a diagram on our server(Win2003 x64,SQL 2005 Enterprise x64 sp2 3054). I have tried to login as an admin and create a new db, but get the same message - 'Database diagram support objects cannot be installed because this database does not have a valid owner. To..' Also tried to make a diagram from the ReportServer db.   Any suggestions?

Checking existence of a record in sql database using IF EXIST and reporting outcome on asp page



I have a page that inserts a record to an sql database and I would like to do the following:

(i) Check if a record already exist before trying do an insert

(ii) If a record exist, the page should be able to inform/display a message in a textbox informing the user that the record already exist.


I have seen a number of post on the internet that suggest that one possible solution is to write a sproc and use the T-sql IF EXIST function. However, I have NOT seen a complete code showing (a) how this can be done (b) how to call the sproc from an asp page (c) and MORE IMPORTANTLY how to display a message informing a user that a record already exist i.e. when the record already exist in the database.


Please have anyone got a complete working code that can achieve this preferably in c#?




Find unused objects in a SQL Server 2000 database


Hello All,

I want to know all the objects in a database which are not been used from a long period (Unused in the sense not executed from a long period; example procedures.). Could anyone show be the way of how to get it done.

Thanks in advance.

Pavan Kokkula Infosys Technologies Limited.

How many database access objects should I use?


Hi everyone. I'd like to know if I'm doing wrong about performance/optimization. Let me explain:

Among my classes there is one (lets call it db_SqlServer) that is used to query the database using stored procedures. Every other class in the site that needs to access the database has an object of that db_SqlServer class. So when they query the database, the class db_SqlServer opens a connection, returns the results and closes the connection.

In short, I can have several db_SqlServer objects depending on how many other classes are running at that moment.

What should I do? Just one static db_SqlServer class? Use singleton to create just one instance of the class? I mean, is bad for performance to give every class its own db_SqlServer object or not? Is good for speed?

Many thanks in advance.

delete all the objects from a database


How can I delete all the objects from a database? (tables, stored procedures, etc.).


Thank you!


Backing up the Database Objects only in SQL Server 2008 R2 using T-SQL


Hi Team,

I have used DMO and T-SQL  to backup my database objects only in SQL server 2005 working fine. I know DMO script would not work in SQL server 2008 R2. Do you have any equivalent script in SQL server 2008 R2. Can we achieve the same using SMOs in SQL server 2008 R2.

If you want I can post the working 2005 SQL script.

Appreciate your help .

Many thanks







Kalyan Techbubbles.com

Fixed database role for managing db objects.


I need to allow a user to

Edit schemas, objects and data.

Can I use one of fixed database roles?

Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Export Visio Database Table Names to Excel

If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.

MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Publishing SQL Server Database using Publishing Wizard : Tips & Tricks

We can use SQL Server Publishing Wizard to deploy our local Database to remote hosting server/production server.This feature is available in SQL Server 2008/VWD 2008.

Below is the complete step by step guide of this process.

Adding Rows in GridView without using a Database

This article describes on how to add rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in the TextBox on Button Click and retain the GridView data on post back.

Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

ASP.NET Database Tutorial

This tutorial will show you how to display data using the .NET GridView Control, ASP.NET 2.0 and VB.NET

The GridView control is a powerful tool and is simple to implement.

First, you will need to import the System.Data.SqlClient namespace.

Connestion string create any database server

This links important to how to create connection string to any data base sever.

SQL Server Database Transaction

A transaction is a group of SQL commands executed together as a single component of work to be accomplished. If all of these commands succeed, then a transaction is committed - the changes to the data are made final. If any of the commands within a transaction fail, then the entire transaction is cancelled, or in SQL Server terms, the transaction will be rolled back.

Transactions are one of the things that keep your data safe, but they're not necessarily easy to understand. Here's some help:

Database Export Wizard for ASP.net and SQL Server

A step wizard for ASP.net to export database objects to CSV, TXT, HTML, XML, or SQL. it guides users through a few simple steps to choose a database object (table, view, or query), select columns, and export the data in any of the standard formats CSV, HTML, XML, or SQL.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend