‘m trying to verify that a SQL DATABASE is empty ,
5 pts.
0
Q:
'm trying to verify that a SQL DATABASE is empty ,

I am modifying a VB program that is taking ALL the tables from an ACCESS Database and converting them to a SQL DATABASE.
They VB Program opens the SQL DATABASE, but I want to verify the database is completely empty. Is there a function or call that can be added to the code??
ASKED: Feb 8 2008  7:12 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
46795 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
There's no function, but you can query the system and see what's in there.

SQL 7/2000
To look and see if there are any tables in the database.
SELECT *
FROM sysobjects
WHERE xtype = 'U'
and name <> 'dtproperties' /*This table is used for the database diagrams, so you don't want to delete it.*/


To look and see if there are any views in the database.
SELECT *
FROM sysobjects
WHERE Xtype = 'V'


To look and see if there are any procedures in the database.
SELECT *
FROM sysobjects
WHERE xtype = 'P'


SQL 2005+
To look and see if there are any tables in the database.
SELECT *
FROM sys.tables


To look and see if there are any views in the database.
SELECT *
FROM sys.views


To look and see if there are any procedures in the database.
SELECT *
FROM sys.procedures
Last Answered: Feb 8 2008  7:41 PM GMT by Mrdenny   46795 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Mrdenny   46795 pts.  |   Feb 8 2008  7:42PM GMT

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.

 
0