Detect SQL Server Version from CLR UDF

Is there a way to detect the current SQL Server Product Version from a CLR UDF (C#) without
making a connection and issuing a query? Of course, I can connect and issue this query:
  SELECT SERVERPROPERTY('ProductVersion');
But is there a way to get this information without connecting? Is there some CLR or DotNet function or property that will return this information for the SQL Instance the CLR Assembly is invoked from?
Thanks

Not built-in to SQLCLR, no. You may be able to write code to read the appropriate registry key, but that would probably be more fragile than the SELECT you mention. BTW, when you use the context connection it's not the same overhead as "connecting"
with a non-context connection from outside SQL Server.
Cheers, Bob

Similar Messages

  • Sql server replication from SQL SERVER VERSION(7.0) to SQL SERVER 2005

    Hi All,
    We are trying to create a replication between Sql server 7.0 data to SQL server 2005 data . We tried to create a local subscription in Sql server ,when tried to connect to publisher  running in Sql server 7.0 it is showing an error message
    like "This Sql server vresion(7.0) is not supported" .
    Could any one please help us with this issue ?
    Thanks
    Sandy

    Hi CRM_Learner,
    SQL Server version 7.0 Service Pack 4 (SP4) is the earliest version that can participate in a replication topology with SQL Server 2005. We need to verify the version of SQL Server. If you configure transactional replication with updating subscribers,
    for a SQL Server 7.0 Publisher, only SQL Server 7.0 Subscribers are supported. SQL Server 7.0, 2000 was out of support in the SQL Server Forums. I suggest you install SQL Server 2005 or later version to configure the SQL Server replication.
    For more information, there is a detail about using multiple Versions of SQL Server in a replication topology.
    http://technet.microsoft.com/en-us/library/ms143241(v=sql.90).aspx
    Regards,
    Sofiya Li
    If you have any feedback on our support, please click here.
    Sofiya Li
    TechNet Community Support

  • Install Fails With SQL Server Version - Status: Incorrect

    Hi. I am working to install BPC 7 in a single server environment. During installation the setup diangostic detects a problem with [[Microsoft and 3rd Party Software]], below is what appears:
    X - SQL Server Version
    ____    OK - Required: 10.0.1600.22 or higher
    ____    OK - Currently: Not Installed
    ____    X   - Status: Incorrect
    X - SQL Reporting Services Server Version
    ____    OK - Required: 10.0.1600.22 or higher
    ____    OK - Currently: Not Installed
    ____    X   - Status: Incorrect
    X - OLAP Server Version
    ____    OK - Required: 10.0.1600.22 or higher
    ____    OK - Currently: Not Installed
    ____    X   - Status: Incorrect
    Under [[Computer Services Status]] SQL Server is alright:
    OK - MS SQL Server Service
    ____    OK - Required: Running
    ____    OK - Currently: Running
    ____    OK - Status: OK
    OK - MS SQL Server Agent Service
    ____    OK - Required: Running
    ____    OK - Currently: Running
    ____    OK - Status: OK
    OK - SQL Integrated Service
    ____    OK - Required: Running
    ____    OK - Currently: Running
    ____    OK - Status: OK
    OK - SQL Report Service
    ____    OK - Required: Running
    ____    OK - Currently: Running
    ____    OK - Status: OK
    OK - MS SQL Server OLAP Service
    ____    OK - Required: Running
    ____    OK - Currently: Running
    ____    OK - Status: OK
    What I've Checked so far:
    - Collation
    - Account for installation is SQL SysAdmin and a Windows account
    - Mixed mode authentication
    I should mention, this is a single server install on a 64 bit version of Windows, with 64 bit version of SQL.
    Any experience, ideas or suggestions are welcome.
    Joe
    Edited by: jwainz on Mar 29, 2010 5:55 PM

    I think the clearest statement about this is on page 11 of the Master Guide (SAP BPC 7.0 M Master Guide at [http://service.sap.com/instguidesEPM-BPC]).
    Look at the rows for OLAP Server and Microsoft SQL Server.  In each of those, you wil find this statement:
    "Can be 64‒bit when separate from Application/web services"
    On page 10 in the Installation Guide, for look at the rows for Application server Web Server.  The prerequisites are as follow:
    App Server:
    Windows Server 2003 or Windows Server 2003 R2 Standard or Enterprise Edition SP2 (32-bit) configured with NTFS, set to English (United States)
    Web Server:
    Windows Server 2003 or Windows Server 2003 R2 Standard or Enterprise Edition SP2 (32-bit) configured with NTFS
    Finally, the PAM is a bit confusing.  For product SAP BPC 7.0 FOR MICROSOFT, click on the tab Operating Systems and then click on the tab BPC Server.  That is the software that you install for the Application Server and the Web Server server types.  The Operating System Version listed is WINDOWS SERVER 2003/IA32 32BIT

  • SharePoint Foundation 2010 supported sql server version?

    Hi,
    I am using SharePoint 2010 Foundation. I want to know what are all the SQL Server versions would support in SharePoint 2010 Foundation.
    Could anyone tell me as soon as possible.
    Thanks & Regards
    Poomani Sankaran

     It requires Windows Server 2008 SP2 or Windows Server 2008 R2. It will not run on a Server Core installation.
    It requires one of these versions of x64 SQL Server:
                    SQL Server 2005 SP3 CU3 (Build 4220) or greater (Note: SQL Server 2005 goes out of mainstream support in April 2011)
                    SQL Server 2008 SP1 CU2 (Build 2714) or greater
                    SQL Server 2008 R2
    Check this blog 
    http://www.sqlservercentral.com/blogs/glennberry/2010/03/11/sharepoint-2010-and-various-versions-of-sql-server/
    further from msdn 
    In order to maintain SharePoint and SQL Server compatibility we use the “SharePoint N-1
    on SQL Server N+1”  equation to determine version support. Using SharePoint Foundation 2010 as an example, the N release of SQL Server is 2008/2008 R2 and N+1 is SQL Server 2012. For Microsoft SharePoint Server 2013 the N release of SQL Server
    is 2012 and the N+1 is SQL Server 2014.
    https://technet.microsoft.com/en-us/library/cc288751(v=office.14).aspx

  • How to create a .mdf SQL Server database from a Data-Tier Application file that has data?

    This is a noob question, though I do use SQL Server databases all the time with Entity Framework when I code in C# using Visual Studio 2013.  The development environment is found below at [A].  I am trying to make a clone of a SQL Server 2008 R2
    database (.mdf)  that exists online.  I can read, connect and work with this database in Visual Studio 2013, but I wish to make a local copy of the database, as an .MDF file.  Somewhere in my notes I have a way of creating a local copy from
    an online database when using Visual Studio but I forgot how (it seems, reviewing my notes, that it deals with ADO.NET which is deprecated in Visual Studio 2013 these days, or so it seems).  So I'm looking for another way.  What I did was create
    (or export) a "Data-Tier Application File" from the online SQL Server database, with data, and it seems to have worked in that this Data-Tier Application file exists on my hard drive and seems to have data in it ("SQL Server Replication Snapshot"
    is the format it seems).  It contains skeleton code to create a database, but when I tried to execute it with SQL Server 2014 Management Studio, I got a bunch of errors.
    So my question is:
    1) Can I somehow create a .MDF SQL Server Database from an Data-Tier Application file that has data?  What tool do I use?  I saw this link, http://social.technet.microsoft.com/wiki/contents/articles/2639.how-to-use-data-tier-application-import-and-export-with-a-windows-azure-sql-database.aspx 
    and it relates to Azure, but is there a tool for C#Visual Studio 2013, standalone?
    2) If there's an easy way to create a .mdf SQL Server Database file from an online file, within SQL Server Management Studio?  I don't think so, since it would require Administrator permissions on the online server, which I don't have. I have permission
    to read, update, delete the online database file, but strangely not to download it (the service I use has a tool for backup, but not for download).
    3) same question as 2), but for Visual Studio 2013?  I don't think so, since I notice none of the templates even mentions ADO.NET anymore, but instead they go with Entity Framework.  Using EF I can of course do anything I want with the online database
    (CRUD), but it remains online.  Maybe there's a switch to make a local copy?  I guess I could write a short program to suck all the data out of the online database and put it into a new, duplicate database having the same tables, that I create on
    my localhost, but my question here is if there's an easier way than this, maybe a tool or command I can run from inside Visual Studio?
    Any advice on any of the above questions is appreciated.
    Thank you,
    Paul
    [A] Microsoft Visual Studio Professional 2013
    Version 12.0.21005.1 REL
    Microsoft .NET Framework
    Version 4.5.51641
    Microsoft Web Developer Tools 2013   2.0.40926.0
    SQL Server Data Tools   12.0.30919.1
    Microsoft SQL Server Data Tools
    Windows Azure Mobile Services Tools   1.0
    Windows Azure Mobile Services Tools

    Thanks but these links are too general to help.
    "2. what do you mean by online file?" - I mean the SQL Server database file is on a remote web server that I rent from, but I am not the administrator of.  I can access my database using SQL Server Authentication, but nothing more.
    Paul
    What do you mean by too general? It explains on how you can use data tier application to create and deploy databases
    May be this will help you to understand better
    http://www.databasejournal.com/features/mssql/article.php/3911041/Creating-Data-Tier-Applications--in-SQL-Server-2008-R2.htm
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Error while Viewing SQL Server data from Oracle

    Dear Friends,
    I am using Oracle10g XE.
    I have made a connection to view or insert data in SQL Server Database from Oracle.
    I  have done all the things with the help of below link.
    http://www.databasejournal.com/features/oracle/article.php/3442661/Making-a-Connection-from-Oracle-to-SQL-Server.htm
    Everything worked fine. but when i run below query
    select "EmployeeNo" from hrtattendance@mysqlserverdsn
    it gives an error which is mentioned below
    ERROR at line 1:
    ora-28545: error diagnosed by Net8 when connecting to an agent
    Unable to reteieve text of  NETWORK/NCR MESSAGE 65535
    ORA-02063: preceding 2 lines from MYSQLSERVERDSN
    Please help. I will be thankful.
    Regards,

    Dear Klaus,
    Here u go.
    C:\>C:\oraclexe\app\oracle\product\10.2.0\server\bin\hsodbc
    Oracle Corporation --- TUESDAY   JUN 24 2014 16:28:20.146
    Heterogeneous Agent Release 10.2.0.1.0 - Production  Built with
       Driver for ODBC
    C:\>C:\oraclexe\app\oracle\product\10.2.0\server\bin\tnsping MYSQLSERVERDSN
    TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 24-JUN-2
    014 16:28:33
    Copyright (c) 1997, 2005, Oracle.  All rights reserved.
    Used parameter files:
    C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT
    =1522)) (CONNECT_DATA=(SID=MYSQLSERVERDSN)) (HS=OK))
    TNS-12541: TNS:no listener
    C:\>C:\oraclexe\app\oracle\product\10.2.0\server\bin\lsnrctl status LISTENERMYSQLSERVERDSN
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 24-JUN-2014 16:28
    :48
    Copyright (c) 1991, 2005, Oracle.  All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))
    TNS-12541: TNS:no listener
    TNS-12560: TNS:protocol adapter error
      TNS-00511: No listener
       32-bit Windows Error: 61: Unknown error
    Connecting to (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))
    TNS-12541: TNS:no listener
    TNS-12560: TNS:protocol adapter error
      TNS-00511: No listener
       32-bit Windows Error: 2: No such file or directory
    C:\>
    Regards,

  • Connect SQL server source from OWB

    Hi,
    I have to connect to SQL Server source from OWB.
    I am using OWB 10.2 version and Owb is installed on UNIX platform.
    I have created system DSN, made respective entries in hs/admin and edited listener.ora file.
    In OWB Non-Oracle sorces trying to connect with ODBC connection to SQL server source.
    It is throwing erorr 'ORA-28545:error diagonised by Net8 agent when connecting to an agent Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from OWB-2339'
    How to check System DSN is setup properly on UNIX or not.
    Could anyone help out on this.

    Hi David,
    I have created db link and queried with select statement.
    It has thrown following error.
    " ORA-12537: TNS:connection closed".
    And, I don't know how to use "trace level gateway service configuration property in the service .ora file".
    I want to start from the first.
    Could you please give me the guidelines on, how to connect to a Sql server source(Which is on Remote Server) from OWB.
    What are the prerequisites and steps.
    Thanks for your help,
    Shaik.

  • Have anyone connected to sql server 2000 from forms 6i release 2

    Have anyone connected to sql server 2000 from forms 6i release 2
    on winNT 2000. sql server is also on same machine.
    If yes then pls tell me details regarding
    oca version
    any patch required for forms 6i release 2(download location of
    patch)
    version of odbc drivers
    or any other detils
    urgent
    thanks
    yogesh

    refresh

  • Sql server migration from 2005 to 2012 (110)

    hi, experts, 
    the database of  .net web form application (Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1025  ) that I am responsible will be migrated to sql server 2012 (110). 
    the .net webform use the functions from System.Data.SqlClient. should be ado.net
    e.g.
    public static DataSet LoadByID(int id)
    SqlConnection conn = new SqlConnection();
    DataSet ds = new DataSet();
    try
    conn.ConnectionString = ConfigurationManager.ConnectionStrings["connection_string"].ToString();
    conn.Open();
    SqlParameter[] aryParams = new SqlParameter[1];
    aryParams[0] = new SqlParameter("@ID", SqlDbType.Int);
    aryParams[0].Value = id;
    SqlCommand cmd = new SqlCommand("a_store_procedure_name", conn);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.AddRange(aryParams);
    SqlDataAdapter sqlAdapter = new SqlDataAdapter(cmd);
    sqlAdapter.Fill(ds);
    catch (Exception ex)
    throw ex;
    finally
    if (conn.State == ConnectionState.Open)
    conn.Close();
    return ds;
    I cloned the database from 2005, restore into 2012 and change the compatibility level to 110 of cloned database.
    I am doing tests on the sql server 2012 from the web application user interface. (changed connection string to new 2012 db)
    I found that I always hit this error 
    any configuration for whole web form application?
    Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
    Source Error:
    delaynomore.

    Hi delaynomore,
    According to your description, you fail to execute the function with timeout error after migration to SQL Server 2012. Based on my research, the issue could be due to the long running tasks or uncommitted transactions.
    To troubleshoot the issue, besides Olaf's suggestion to check the connection to SQL Server 2012 instance and the stored procedure using SQL Server Management Studio(SSMS) manually, you could also follow the methods below.
    1. Execute that procedure manually using SSMS and check if it takes a very long time to execute and return. For example, there could be millions of rows being updated. If it takes a long time, you can adjust the CommandTimeout accordingly.
    2. Execute the following statement in SSMS to check if there are any uncommitted transactions: dbcc opentran ('yourDatabaseName'). If there are any uncommitted transactions, please change the  stored procedure accordingly to commit the transactions.
    For more information about the process, please refer to the article:
    http://blogs.msdn.com/b/spike/archive/2008/07/31/timeout-expired-the-timeout-period-elapsed-prior-to-completion-of-the-operation-or-the-server-is-not-responding.aspx
    Regards,
    Michelle Li

  • What are the SQL server versions those are compatible with XI 3.0.

    Hi All,
    Please suggest,
    what are the SQL server versions those are compatible with XI 3.0.
    or with which SQL server versions XI 3.0 will interact using JDBC Adapter.

    Check in the [Product Availability Matrix |https://websmp201.sap-ag.de/~form/handler?_APP=00200682500000001303&_EVENT=DISP_NEW&00200682500000002804=01200314690900000192]in market place for more information on this
    Thanks
    SaNv...

  • Unable to connect to SQL Server 2008 from OBIEE 11G(on 64 bit Linux box)

    We are unable to connect to connect to SQL Server 2008 from OBIEE 11G which is on 64 bit Red Hat Enterprise Linux.
    Infrastructure: OBIEE 11.1.1.5 64bit, on 64 bit Red Hat Linux Enterprise Linux 5.6 , MS SQL Server 2008 on 64 bit Microsoft Windows Server
    Issue Description: Unable to connect to SQL Server 2008 from OBIEE11G RPD
    Details: We are unable to connect to SQL Server 2008 from OBIEE which is on a 64 bit Linux box. We created the ODBC connection on Linux box to the SQL server. Whenever we try to import metadata it throws an error that says ‘Connection Failed’.
    Here are the steps we followed to setup the ODBC connection on Linux box.
    1) We updated the user.sh file with the LD_LIBRARY_PATH and LD_LIBRARY_PATH_64 values that point to $ORACLE_HOME/bifoundation/odbc/lib
    This is where we found the driver for SQL server SEmsss23.so.
    2) We updated the odbc.ini file with the entry for SQL server with the connection details
    SI_SQL_Server_DEV = SQL Server
    [SI_SQL_Server_DEV]
    Driver=/u001_OAS/Oracle/Middleware/Oracle_BI1/bifoundation/odbc/lib/SEmsss23.so
    Description=DataDirect 5.1 SQL Server Wire Protocol
    Address=10.230.216.52,54970
    AlternateServers=
    AnsiNPW=Yes
    ConnectionRetryCount=0
    ConnectionRetryDelay=3
    Database=SVBDW_NEW
    LoadBalancing=0
    LogonID=SIDatavalidation
    Password=~~~Password123
    QuoteID=No
    ReportCodePageConversionErrors=0
    3) We updated the IDENTIFIER_QUOTE_CHAR with single quotes instead of double quotes in the DB features of the RPD
    4) We updated the bash_profile file to point the ODBCINI variable to the path where the OBIEE odbc.ini file is present.
    Export ODBCINI=/u001_OAS/Oracle/Middleware/instances/instance1/bifoundation/OracleBIApplication/coreapplication/setup/odbc.ini
    The error in nqsserver.log file says “[nQSError: 16001] ODBC error state: IM002 code: 0 message: [DataDirect][ODBC lib] Data source name not found and no default driver specified.”

    Hi,
    Make sure SQL Configuration Manager make sure the TCP/IP enabled. please try below method
    Method 1
    Re Create a new ODBC & Oracle Bi Server DSN Configuration test it and use it in the connection pools.
    define your ODBC data source in your server where the BI Server is installed. Check your DB connections in your physical layer and make they are defined on your BI Server as well.
    Method 2:
    try using the complete TNS in below format in the datasource name section:
    (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST =DB IP)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = ORCL) ) and provide the credentials.
    Method 3:
    To use the OCI call interface you need to have oracle client DB to be installed so that you can establish a connection using that DB credentials and connect to the remote dB and then import the tables.....this is the rule of thumb.
    hope helps you.
    Thanks
    Deva

  • Error trying to install ICM 8.0 - "FAILED TO GET SQL SERVER VERSION."

    Hello guys, i tried to install ICM 8.0 but when i click on Setup.exe appears this error:
    "FAILED TO GET SQL SERVER VERSION. MAKE SURE SQL SERVER INSTALLED PROPERLLY
    NO INSTANCE NAME FOUND.NO SCHEMA UPGRADES ATTEMPTED"
    I try to check the SQL COnfiguration, about Named Pipes, but everything is allright. Someone knows what is it?
    Thank you very much.

    You should be able to see the ICMSetup.log file somewhere - check TEMP. It seems to me that this is the first thing it does - tries to connect to the SQL database and ask for the version. Clearly it cannot. I assume you installed SQL OK, probably have the service running under a domain user created especially for the task, or the domain admin, and you are also logged in as the domain admin, and that SQL is running.
    Check that log file for clues.
    Regards,
    Geoff

  • I want to query sql server database from oracle

    i want to query sql server database from oracle
    can anyone help me in this regard

    First of all - you are in the wrong forum.
    Look either for the Database general or search for Transparant / Heterogenous Gateways.
    cu
    Andreas

  • MS SQL Server upgrade from 2000 to 2005

    I'm running SAP Tools for MsSQL server and my database version that is running on my system is 8, I'm getting an error saying that the SAP tools can only work with version 9.
    Is there an older version of SAP Tools to work with MS SQL Server version 8 ?
    Thanks.
    George

    Hi,
    what is the version of the Sap tools ? generally all sap executables are downward compatible.
    Regards,
    Siddhesh

  • Access SQL-Server Data from Oracle 10gXE

    Hello,
    I want to access sql-server data from oracle 10g XE. I need the same functionality provided by Sql-server by Linked Servers, by which we can query on any data source(oracle, Excel, Access).
    do, Oracle 10gXE provide us with same functionality ???
    any pointers ???

    Yes, it does work with Express Edition.
    Here is a thread from the XE forum with examples.
    Re: Database Link to MS Access
    They refer to a MS Access database, but the procedure is the same.
    Doug

Maybe you are looking for

  • Unable to expose a method in web service

    Hi, My scenario is to expose a method in service. This method will take date as input & should return all the rows. To Implement this, I took employeeVO of HR DB(Employees Table) & created a ViewCriteria "GetEmpbyHireDate" with Hiredate as input para

  • My genius is not working with a few albums!

    Ok.. so i bought the CD of Miley Cyrus' "The Time Of Our Lives" and Nick Jonas & The Administration's "Who I Am" and rippped them into my PC, filled the details, added album art and stuff. Then i updated my genius. but still genius is not detecting t

  • Things not working in IE

    i have a button that when clicked, displays a pop-up window with a form to fill out, well, in firefox and safari, it works fine, however in IE, its not doing anything, not even displaying a pop-up blocker message, the code is below. another problem,

  • HT4437 can i use airplay from my ipod to my mac?

    Could i connect my ipod with my mac and play videos on my mac just like you do on an apple TV if there is a way please let me know. thaks in advance

  • F.13 Clearing Documents contain no data

    Hi, I have carried out F.13 transaction to clear some customer accounts. However, the system displays that it has created a few clearing documents in the output. But when i see the document postings, i see no data in the documents. It says List is em