Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_ORAgetprovider

  No additional text.


Syntax


-- Name:
--          sp_ORAgetprovider

-- Description:
--          Determine the OLEDB provider to use for
--			Oracle publisher

-- Security:
--          Internal
-- Requires Certificate signature for catalog access

-- Returns:
--          Error code

-- Owner:
--          acarter

-- Notes:
--			Driver is picked based on the version of Windows.
--			The driver can also be forced driver to Oracle OLEDB
--			provider via a special form of the publisher type value.
--			Windows 2003 SP1+ will use Oracle OLEDB since out-of-proc
--			works.  Otherwise, will use MSDAORA.

--			64-bit will always use Oracle OLEDB if Windows 2003 SP1+
--			otherwise will error out


CREATE PROCEDURE sys.sp_ORAgetprovider
(
	@publisher_type sysname OUTPUT,
	@provider       sysname OUTPUT
)
AS
BEGIN
	DECLARE @winver  int,
			@w2ksp1  int,
			@64bit	 int

	-- Windows 2003 Server SP1
	SET @w2ksp1 = 0x0ECE0205
	
	-- Initialize platform indicator to 32 bit
	SET @64bit = 0
	
	-- Get version info
	CREATE TABLE #msver
	(
		idx		smallint,
		name		sysname,
		internal_value	varbinary(8),
		character_value nvarchar(120)
	)

	INSERT #msver
	EXEC master.dbo.xp_msver 'WindowsVersion'

	-- Get Windows version
	SELECT	@winver = CONVERT(int, internal_value)
	FROM	#msver
	WHERE	idx = 15
	
	INSERT #msver
	EXEC master.dbo.xp_msver 'Platform'

	-- Get 64 bit indicator	
	SELECT	@64bit = COUNT(*)
	FROM	#msver
	WHERE	idx = 4
	  AND	character_value like '%64%'

	DROP TABLE #msver

    IF (@publisher_type LIKE N'%.OLEDB')
    BEGIN
        SELECT  @publisher_type = LEFT(@publisher_type, LEN(@publisher_type) - 6),
                @provider = N'OraOLEDB.ORACLE'
    END

    ELSE IF (@publisher_type LIKE N'%.MSDAORA')
    BEGIN
        SELECT  @publisher_type = LEFT(@publisher_type, LEN(@publisher_type) - 8),
                @provider = N'MSDAORA'
    END

    ELSE IF @64bit <> 0
    BEGIN
        SELECT @provider = N'OraOLEDB.ORACLE'
    END
    ELSE
    BEGIN
    	SELECT @provider = N'MSDAORA'
    END

    return (0)
END

 
Last revision 2008RTM
See also

  sp_IHgetprovider (Procedure)
sp_MSdrop_replcom (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash