Re: Variant datatype not supported?
- From: Joe Weinstein <joeNOSPAM@xxxxxxx>
- Date: Tue, 24 Jan 2006 12:51:30 -0800
Wes Clark wrote:
I'm trying to write a method that will tell me what version, 8 or 9, I'm running on. When I connect to 2000, I use the old driver. When I connect to 2005, I use the new driver. I first used the DatabaseMetaData.getDatabaseMajorVersion() method, but it is not supported in the old driver. Then I used getDatabaseProductVersion, which returns "Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation
Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)" in the old version, and "9.00.1399" in the new. So I noticed if I selected SERVERPROPERTY('ProductVersion'), I got 8.00.760 in the old version, and 9.00.1399.06 in the new version. Perfect. The query works in 2000, but in 2005 I get "com.microsoft.sqlserver.jdbc.SQLServerException: Data type 'variant' not supported".
Hi Wess. Try this:
"select convert(varchar(100), SERVERPROPERTY('ProductVersion'))"HTH, Joe Weinstein at BEA Systems
.
- Prev by Date: Microsoft SQL Server 2005 JDBC Driver is released to the web -- JAN 18, 2005
- Next by Date: Re: Variant datatype not supported?
- Previous by thread: Microsoft SQL Server 2005 JDBC Driver is released to the web -- JAN 18, 2005
- Next by thread: Re: Variant datatype not supported?
- Index(es):
Relevant Pages
|
Loading