Checking database has a table.
-
How to check whether a database has a table out of that database
-
How to check whether a database has a table out of that database
yuvarajujogi wrote:
How to check whether a database has a table out of that database
Why, will it also hold tables out of "other" databases? You can check if a table exists by quering
sys.tables
in Sql Server. Other database-servers will have similar options.Bastard Programmer from Hell :suss:
-
How to check whether a database has a table out of that database
It depends which database you are using. If you are using MSAccess , then you can write the code in any language and using TABLE collection you can count and note the tables name If you are using SQL SERVER , then here is querey "SELECT * FROM Sys.Tables" If you are using MySQL , then here is query SHOW [FULL] TABLES [{FROM | IN} db_name] [LIKE 'pattern' | WHERE expr]
-
How to check whether a database has a table out of that database
Yet another way to get a list of tables in an ADO.net-supported database:
System.Data.Common.DbConnection con =
this.command.Connection as System.Data.Common.DbConnection ;if ( con != null )
{
System.Data.DataTable temp = con.GetSchema
(
"TABLES"
) ;temp.DefaultView.RowFilter = "TABLE\_TYPE='TABLE' OR TABLE\_TYPE='BASE TABLE'" ; temp.DefaultView.Sort = "TABLE\_NAME" ;
-
How to check whether a database has a table out of that database
-
How to check whether a database has a table out of that database
Hey, What database are you talking about? MySQL, Microsoft SQL Server ORACLE ....
-
Hey, What database are you talking about? MySQL, Microsoft SQL Server ORACLE ....
Sql Server
-
Sql Server
Once Again, What version of SQL Server? SQL Server 2000 SQL Server 2003 or What?
-
yuvarajujogi wrote:
How to check whether a database has a table out of that database
What are you going to do if it doesn't?
I want to create a table in that database similar to the table in another database.
-
Sql Server
-
I want to create a table in that database similar to the table in another database.
try with this..
If Object_ID('dbo.MyTable') IS NOT NULL
PRINT 'MyTable Exists'
Else
PRINT 'MyTable Not Exists'with regards Karthik Harve
-
How to check whether a database has a table out of that database
try with this..
If Object_ID('dbo.MyTable') IS NOT NULL
PRINT 'MyTable Exists'
Else
PRINT 'MyTable Not Exists'with regards Karthik Harve
-
try with this..
If Object_ID('dbo.MyTable') IS NOT NULL
PRINT 'MyTable Exists'
Else
PRINT 'MyTable Not Exists'with regards Karthik Harve