![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Thank u for the your reply and the links. What I really want is too easy and clear : I create a program that open SQL 2005 Data Bases and show tables of the data base. What I have done is to get a table data but I have to know the table name before opening any one. What I want is to know the tables name of the current data base. Any idea ? |
#12
| |||
| |||
|
|
Omar Abid (omar.abid2... (AT) gmail (DOT) com) writes: Thank u for the your reply and the links. What I really want is too easy and clear : I create a program that open SQL 2005 Data Bases and show tables of the data base. What I have done is to get a table data but I have to know the table name before opening any one. What I want is to know the tables name of the current data base. Any idea ? I just posted a sample on how to do it. You even reply to that post. Could you care to explain why it does not address your problem? -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books... Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx |
#13
| |||
| |||
|
|
I tried the code but I want any SQL Data Base and not Adventure Works |
#14
| |||
| |||
|
|
I tried the code but I want any SQL Data Base and not Adventure Works Just replace AdventureWorks in the connection string with the database of your choice. I used AdventureWorks to give you a working sample. |
#15
| |||
| |||
|
|
Omar Abid (omar.abid2... (AT) gmail (DOT) com) writes: I tried the code but I want any SQL Data Base and not Adventure Works Just replace AdventureWorks in the connection string with the database of your choice. I used AdventureWorks to give you a working sample. -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books... Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx |
#16
| |||
| |||
|
|
Thank you the problem was solved, and I used mid to get the table name, because the output was "[DBO].[table]" |
#17
| |||
| |||
|
|
Omar Abid (omar.abid2... (AT) gmail (DOT) com) writes: Thank you the problem was solved, and I used mid to get the table name, because the output was "[DBO].[table]" You could modify the query if you don't want the schema. Then again, in SQL 2005, it may be dangerous to ignore the schema, since SQL 2005 makes schemas useful, and it can be deceivable to work with. The AdventureWorks database is a good example of this. -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books... Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx |
![]() |
| Thread Tools | |
| Display Modes | |
| |