| Author |
Topic |
|
Rashima
Starting Member
7 Posts |
Posted - 2010-05-26 : 15:14:27
|
| I have connection string and I want to know which server type is it?need a query that tells me that its a SQL Server or Oracle or MS Access based on connection stringthanks in advance |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Rashima
Starting Member
7 Posts |
Posted - 2010-05-26 : 15:34:39
|
| I have a COM Object and I have only connection string with me and want to know if this connection string is for server type sql server or oracle or ms access ?I need a sql statement for this. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Rashima
Starting Member
7 Posts |
Posted - 2010-05-27 : 03:05:58
|
| select substr(Banner,1,7) from sys.V_$VERSION where rownum < 2Return--> OracleI need same for SQL Serverwhat I need isquerys to identify which database is behind a connection, and what it contains |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-05-27 : 03:40:02
|
quote: Originally posted by Rashima select substr(Banner,1,7) from sys.V_$VERSION where rownum < 2Return--> OracleI need same for SQL Serverwhat I need isquerys to identify which database is behind a connection, and what it contains
select left(@@VERSION,20)MadhivananFailing to plan is Planning to fail |
 |
|
|
Rashima
Starting Member
7 Posts |
Posted - 2010-05-27 : 03:58:30
|
| Thanks a lot for your answer but still I am far from my searchselect left(@@VERSION,20) gives SQL Serverselect substr(Banner,1,7) from sys.V_$VERSION where rownum < 2 gives OracleBut I need a sql where I pass connection string and it tells me server type,database,and what it contains ?thanks in advance. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-05-27 : 05:04:33
|
quote: Originally posted by Rashima Thanks a lot for your answer but still I am far from my searchselect left(@@VERSION,20) gives SQL Serverselect substr(Banner,1,7) from sys.V_$VERSION where rownum < 2 gives OracleBut I need a sql where I pass connection string and it tells me server type,database,and what it contains ?thanks in advance.
Can you post some sample connection strings?MadhivananFailing to plan is Planning to fail |
 |
|
|
Rashima
Starting Member
7 Posts |
Posted - 2010-05-28 : 02:35:47
|
| Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;So I have this and would like to have result "SQL SERVER" |
 |
|
|
Rashima
Starting Member
7 Posts |
Posted - 2010-05-28 : 02:56:10
|
| Also want to know dependGiven the name of a VIEW, find out the view/tables it depends on in sqlserver,oracle and in ms accessthanks a lot for help. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-05-28 : 02:59:06
|
quote: Originally posted by Rashima Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;So I have this and would like to have result "SQL SERVER"
Only way I can think of is if you have "Initial Catalog" as part of the connection string it is SQL Server. For ACCESS, it will have JET.So based on the text available you can find itMadhivananFailing to plan is Planning to fail |
 |
|
|
Rashima
Starting Member
7 Posts |
Posted - 2010-06-18 : 02:51:23
|
| select left(@@VERSION,20) gives SQL Serverselect substr(Banner,1,7) from sys.V_$VERSION where rownum < 2 gives Oraclewhat is the sql for MSAccess ? |
 |
|
|
|