lets say a column using int as datatype
for eg:
the current method i used to retrieve the largest value is by...
select TOP 1 ...from....order by desc
so for eg:
let say the column contains
10
60
40
25
40
i will only retrieve 60. are there any loophole in the above method?Why not try this:
SELECT MAX(<field>) as MaxValue <from <TABLE> where <CLAUSE>|||Originally posted by Bascy
Why not try this:
SELECT MAX(<field>) as MaxValue <from <TABLE> where <CLAUSE>
Thanks. :)|||TOp n gives u the number of rows.
Max gives u the maximum value in the column|||Originally posted by cyrus
TOp n gives u the number of rows.
Max gives u the maximum value in the column
That is not quite correct...
TOP n gives you the first n rows of the resultset, so TOP 1 is the same as MAX as long as the order is on the same field.|||Originally posted by Bascy
That is not quite correct...
TOP n gives you the first n rows of the resultset, so TOP 1 is the same as MAX as long as the order is on the same field.
i am saying the same thing without order by
Showing posts with label method. Show all posts
Showing posts with label method. Show all posts
Wednesday, March 7, 2012
How to retrieve system oledb Provider list
In my app I have to list of "oledb provider" to let the user choose the connection method. As follow:
1.Jet 4.0 OLE DB Provider
2.OLE DB Provider for DTS Packages
3.OLEDB Provider for Indexing Service
4.OLEDB Provider for ODBC Drivers
5.OLEDB Provider for OLAP Services
6.OLEDB Provider for Olap Services 8.0
7.OLEDB Provider for Oracle
8.OLEDB Provider for SQL Server
9.OLEDB Simple Provide
Which doesn't not support must be disabled.
Use which funciton can retrieve the Provider list of system or something like that.
Thanks.
--Master..xp_enum_oledb_providers
If you want to keep the resule,Create a table with the column returned by the above query.And
insert into OLEDB_Providers exec Master..xp_enum_oledb_providers|||en ... I still do not know how ..
where is the master..xp_enum_oledb_providers
is that a function?
can show me a sample ?
many thanks.
Originally posted by ClaireHsu
Master..xp_enum_oledb_providers
If you want to keep the resule,Create a table with the column returned by the above query.And
insert into OLEDB_Providers exec Master..xp_enum_oledb_providers|||Can show me a sample code to list the oledb providers of current system.
Thanks.|||I really want to know does the system support:
1.SQLOLEDB
2.DTSPackageDSO
3.SQLReplication.OLEDB
4.MSDataShape
5.VSEE Versioning Enlistment Manager Proxy Data Source
6.ADsDSOObject
7.MSOLAP
8.MSDAIPP.DSO
9.MSDASQL
10.MSDASQL Enumerator
11.Microsoft.Jet.OLEDB.4.0
12.Microsoft.Jet.OLEDB.3.51
13.SQLOLEDB Enumerator
14.MSDAOSP
15.MSDAORA
...
How to perform this check/text of the user's system in my app.
In my app the unsupport oledb provider must be visable.
--
Thanks.
1.Jet 4.0 OLE DB Provider
2.OLE DB Provider for DTS Packages
3.OLEDB Provider for Indexing Service
4.OLEDB Provider for ODBC Drivers
5.OLEDB Provider for OLAP Services
6.OLEDB Provider for Olap Services 8.0
7.OLEDB Provider for Oracle
8.OLEDB Provider for SQL Server
9.OLEDB Simple Provide
Which doesn't not support must be disabled.
Use which funciton can retrieve the Provider list of system or something like that.
Thanks.
--Master..xp_enum_oledb_providers
If you want to keep the resule,Create a table with the column returned by the above query.And
insert into OLEDB_Providers exec Master..xp_enum_oledb_providers|||en ... I still do not know how ..
where is the master..xp_enum_oledb_providers
is that a function?
can show me a sample ?
many thanks.
Originally posted by ClaireHsu
Master..xp_enum_oledb_providers
If you want to keep the resule,Create a table with the column returned by the above query.And
insert into OLEDB_Providers exec Master..xp_enum_oledb_providers|||Can show me a sample code to list the oledb providers of current system.
Thanks.|||I really want to know does the system support:
1.SQLOLEDB
2.DTSPackageDSO
3.SQLReplication.OLEDB
4.MSDataShape
5.VSEE Versioning Enlistment Manager Proxy Data Source
6.ADsDSOObject
7.MSOLAP
8.MSDAIPP.DSO
9.MSDASQL
10.MSDASQL Enumerator
11.Microsoft.Jet.OLEDB.4.0
12.Microsoft.Jet.OLEDB.3.51
13.SQLOLEDB Enumerator
14.MSDAOSP
15.MSDAORA
...
How to perform this check/text of the user's system in my app.
In my app the unsupport oledb provider must be visable.
--
Thanks.
Subscribe to:
Comments (Atom)