Quantcast
Channel: Microsoft Drivers for PHP for SQL Server forum
Viewing all 391 articles
Browse latest View live

Microsoft Drivers for PHP 5.6+ for SQL Server

$
0
0
Hi there! I'm trying to migrate all of the sites running on Joomla 3, PHP 5.6, from mySQL to MSSQL server 2014. I can only find Microsoft SQL driver 3 which supports until PHP 5.4 but I'm currently running PHP 5.6. Joomla will NOT even recognize SQL driver PHP 5.4 since I'm running PHP 5.6. Based on my research, it seems as Microsoft DO NOT have SQL driver for PHP 5.6 and don't seem to worry about it. Is there any support for SQL Drivers for PHP in the future (PHP 5.6+)? Any suggestions? These current sites we are supporting do get PHP upgrades, as well as Joomla. Any help is greatly appreciated. Thanks.

Columns with numeric names are not retrieved using sqlsrv_fetch_object

$
0
0

I pivot some data into tables with the year as the column name. When I use sqlsrv_fetch_object, the columns with numeric names don't return.

Example:

SELECT [someText], [someMoreText], [2014],[2015],[2016] FROM someTable

returns the first 2 columns only using sqlsrv_fetch_object.

SELECT [someText], [someMoreText], [Y2014],[Y2015],[Y2016] FROM someTable

returns 5 columns using sqlsrv_fetch_object.

Is this a bug in the SQL Drivers for PHP or the underlying native client?

Microsoft Drivers for PHP for SQL Server 3.0

SQL Server 2008 R2

SQL Native Client 11.0

PHP 5.3.28

W2k12 + IIS + PHP 5.6 + SQL Express 2012 >>> error to connect PHP to DB

$
0
0

Hi,

this is a fresh install of Windows Server 2012 where I used 'MS Web Plataform Installer' to install PHP (after I installed mannualy the 'Visual C++ Redistributable for Visual Studio 2012 Update 4'). The PHP is working and then I installed the MS SQL 2012 Express, I already set up the MSSQL TCP properties to connect by IP address since I´m able to connect using .ASP files.

<%
        Set cn = Server.CreateObject("ADODB.Connection")
        cn.Open "Provider=SQLOLEDB;Server=192.168.100.22;Database=ruedb;UID=sa;PWD=sql20015;"
        cn.CommandTimeout = 900
        cn.Close
        Response.write("Connected Successfully")
%>


I already download the 'Microsoft Drivers 3.0 for PHP for SQL Server' from 'http://www.microsoft.com/en-us/download/details.aspx?id=20098' and then extracted to 'C:\Program Files (x86)\PHP\v5.6\ext'. Now I need to set up the PHP to stablish communication with that DB.

<?php
	$link = mssql_connect('192.168.100.22', 'sa', 'sql20015');
	if(!$link) {
		echo'Could not connect';
		die('Could not connect: ' . mssql_error());
	}
	echo'Successful connection';
	mssql_close($link);
?>


but shows the following msg:

Fatal error: Call to undefined function mssql_connect() in C:\inetpub\wwwroot\rue103\testedb.php on line 2

The installer of the app show the following:

SQL Server (SQLSRV):  NOT AVAILABLE (See http://www.php.net/manual/en/ref.pdo-sqlsrv.php)

My current PHP.INI call this extensions:

[ExtensionList]
extension=php_curl.dll
extension=php_exif.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_imap.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_openssl.dll
extension=php_pdo_mysql.dll
extension=php_pdo_sqlite.dll
extension=php_pdo_sqlsrv_54_nts.dll
extension=php_soap.dll
extension=php_sqlsrv_54_nts.dll
extension=php_tidy.dll
extension=php_xmlrpc.dll

>>> Should I install anything else?

>>> Does anyone have idea about the development enviroment (Visual Studio vXYZ) of these .DLLs?

php5.4 + php_pdo_sqlsrv_54 +sqlserver 2012+apche2.2 memory problem

$
0
0
php5.4 + php_pdo_sqlsrv_54 +sqlserver 2012+apche2.2
problem:
   
1. Why some call the function php5.4 sqlserver 2012 in the CLR, the memory has been rising, but not release. For example, the ToUpper ()。
   
   
2.why when PHP call sqlserver for a long time, Apache always restart?
  

一、
php :
https://localhost:8080/entry.php?req={"schema":"interface","type":"test","@id":"010296081","@testa":"abc123456789101010","@testb":"T","@result":"?"}
二、
php code:
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Origin: *");

//request
$req = $_REQUEST["req"];
$loc = $_REQUEST["loc"];
$device = $_REQUEST["device"];
$app_version = $_REQUEST["app_version"];
$web_version = $_REQUEST["web_version"];

$ip ="" ;
 

// 
$req = stripcslashes ( $req );
$req = jsonRemoveUnicode($req);


// 
$db_helper = new db_helper();
  
$readret = 0;
$arr = json_decode ( $req, true );
if (is_array ( $arr )) {
$schema = empty($arr["schema"])?"interface":$arr["schema"];
$type = $arr ["type"];

$procname = "exec {$schema}.interface_" . $type . " ";


//delete type
unset($arr ["type"] );
unset($arr["schema"]);

//get array count
$count = count ( $arr );
//add procname
$i=0;
foreach ( $arr as $k => $v ) {
if(substr($v,0,2)=="@@") {
continue;// 
}
if ($i == 0) {
$procname = $procname . $k."=?";
} else {
$procname = $procname .",".$k."=?";
}
$i++;
}

try {

$db = new PDO (DSN, DB_USER, DB_PWD);

$db->setAttribute(constant('PDO::SQLSRV_ATTR_DIRECT_QUERY'), true);
                $db->query("SET NOCOUNT ON");

$stmt = $db->prepare ( $procname );
$i=1;
$j=1;
$recordset = array();
foreach ( $arr as $k => $v ) {
if($v==="?"){
$stmt->bindParam( $i,${"output".$j},PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT,4000);
$return_arr[$k]=$j;
$j++;
$i++;
}else if(substr($v,0,2)=="@@"){
$recordset[$v] = $k;
}else {
//$stmt->bindValue ( $i,$v,PDO::PARAM_STR );

       if($k=="@ip" || $k=="@IP" || $k=="@iP"  || $k=="@Ip" ){
$stmt->bindValue ( $i,$ip,PDO::PARAM_STR );

}else{
$stmt->bindValue ( $i,$v,PDO::PARAM_STR );
}



$i++;
}
}

if ($stmt->execute ()) {
$rstr="{";

if(count($recordset)>0) {
$i = 1;
do {
$arr_result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$record_key = $recordset["@@{$i}"];
if (!empty($record_key)&&!empty($arr_result)) {
$adjust_arr = array();

$arr_json = "";
foreach ($arr_result as $arr) {
foreach ($arr as $key=>$val) {
$key = iconv ( "gbk", "utf-8", $key );
$adjust_arr[$key] = $val;
}
$json = json_encode($adjust_arr);
$json_2 = jsonRemoveUnicode($json);

$arr_json .= $json_2.",";
}
$arr_json = substr($arr_json, 0, strlen($arr_json)-1);
$rstr.="\"".$record_key."\":[".$arr_json."],";
}
$i++;
} while ($stmt->nextRowset());
}

$stmt->closeCursor();

foreach ($return_arr as $k=>$v){
$value = ${"output".$v};
if(substr($value,0,1)=="[") {
$rstr=$rstr."\"".$k."\":".$value.",";
}else {
$rstr=$rstr."\"".$k."\":\"".${"output".$v}."\",";
}
}
$rstr=rtrim($rstr, ",");
$rstr=$rstr."}";

$rstr = str_replace("@", "", $rstr);
$rstr = str_replace("\"{", "{", $rstr);
$rstr = str_replace("}\"","}",$rstr);

output($rstr);
exit();
} else {
$arrinfo = $stmt->errorInfo ();
$arrinfo [2] = iconv ( "gbk", "utf-8", $arrinfo [2] );
output("{\"error\":\"error".$arrinfo [2]."\"}");
}
} catch ( PDOException $e ) {
$errorinfo = $e->getMessage();
$errorinfo = iconv("gbk", "utf-8", $errorinfo);
output("{\"error1111\":\"error1111" . $errorinfo . "\"}");

}
}else{
output("{\"error222\":\"error2222\"}");
}

//result 
function output($output) {
 
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Origin: *");
echo $output;
}

function jsonRemoveUnicode($struct) {
return preg_replace ( "/\\\\{1,2}u([a-f0-9]{4})/e", "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", $struct );
}
?>

三、clr 代码

public partial class StoredProcedures
{
    [Microsoft.SqlServer.Server.SqlProcedure]
    public static void procgeteqno(String testa, String testb, out string eqno)
    {
        eqno = "";
        try
        {
            if ("".Equals(testa) || "".Equals(testb))
            {
                return;
            }
            //
            if (testb.ToUpper().Equals("O"))
            {
                eqno = testa.Substring(testa.Length - 12);
                return;
            }
            //
            eqno = GetSN(testa);
        }
        catch (Exception)
        {
            eqno = "";
        }

    }



    public static string GetSN(string testaData_src)
    {

        int cardlen = HexToInt(testaData_src.Substring(0, 2));
        String m_testaData = testaData_src.Substring(cardlen * 2 + 2);
        string decryptResult = string.Empty;
        int testaDataLen = 2 * HexToInt(m_testaData.Substring(0, 2));
        int entestaDalaLen = testaDataLen;
        if (testaDataLen % 16 > 0)
        {
            entestaDalaLen = ((testaDataLen / 16) + 1) * 16;
        }

        //string entestaData = m_testaData.Substring(2, entestaDalaLen);
        int snLen = 2 * HexToInt(m_testaData.Substring(2 + entestaDalaLen, 2));
        return m_testaData.Substring(2 + entestaDalaLen + 2, snLen).Replace("F", "");
    }

    /// <summary>
    /// 16???10??
    /// </summary>
    /// <param name="hexStr"></param>
    /// <returns></returns>
    public static int HexToInt(string hexStr)
    {
        int i = hexStr.Length - 1;
        int dec = 0;
        foreach (char c in hexStr)
        {
            int temp = 0;
            switch (c.ToString().ToUpper())
            {
                case "A": temp = 10; break;
                case "B": temp = 11; break;
                case "C": temp = 12; break;
                case "D": temp = 13; break;
                case "E": temp = 14; break;
                case "F": temp = 15; break;

                default: temp = int.Parse(c.ToString()); break;
            }
            dec += (int)(temp * Math.Pow(16, i));
            i--;
        }
        return dec;
    }
};

fieldmetadata of greek database not showing right

$
0
0

I have a greek database in sql server 2008 with the character columns set to nvarchar.When i connect to the database from php i have set Characterset to UTF-8 and in the header of the html files charset="utf-8".When i retrieve data from the database it shows fine in the browser,but if i want to retrieve the column names with sqlsrv_field_metadata(), the name fields are shown with question marks.

If i retrieve the column names from the infromation_schema.columns view they are shown fine.

What can i do to get the column names from the sqlsrv_field_metadata()?

Is PHP capable of handling all SQL Server syntax and commands?

$
0
0

I'm running into database errors when running a query via php and pdo. It runs fine on SQL Server, but not through my php application. 

You can see the query that is failing here http://stackoverflow.com/questions/27262644/how-can-i-troubleshoot-a-raw-mssql-query-that-runs-fine-on-sql-server-but-fails

I'm at my wits end. I need to be able to execute this query for a project which I am urgently completing, however no matter what I do, it is failing in PHP.

Can't find compatible drivers for PHP

$
0
0

I’m running Windows 7 Pro, SQL Server 2012, and installed xampp for PHP version 5.6.3. Thread safety is enabled. I cannot find Microsoft SQL Server drivers that are compatible with this version. I’m using the following from SQLSRV31.EXE in my PHP extensions:

extension=php_pdo_sqlsrv_55_ts.dll

extension=php_sqlsrv_55_ts.dll

 

but I’ve tried all the available drivers and get variations of the same message when trying to run:

"PHP Startup: sqlsrv: Unable to initialize module Module compiled with module API=20100525 PHP  compiled with module API=20131226. These options need to match."

I can’t find any MS drivers for 5.6. Is there a solution? Do I need to  install the earlier versions of xampp?


sqlsrv very slow over network

$
0
0

I'm using sqlsrv (php_pdo_sqlsrv_55_ts.dll and php_sqlsrv_55_ts.dll) in PHP (5.5.12, CLI version on Windows 8.1) to connect to a SQL Server 2012 over a VPN tunnel. But the transfer rate for large result sets is very slow.

Testing SSMS on the same PC over the same VPN tunnel for this query (query is just for testing purposes, I also tried other queries with large data sets and all showed the same performance issues):

    SELECT *
    FROM [Data].[dbo].[Logins]
    WHERE date >= '2014-01-27 00:00:00.000' AND date < '2014-01-29 00:00:00.000'

returns about 100,000 rows in 4 seconds. Checking the transfer rate on my firewall/VPN shows 2,500 KB/s (on a 100mbit network) while the query is running.

Using PHP:

    sqlsrv_configure('ClientBufferMaxKBSize', 1024*1024);
    $dbconnect = "SERVER\\HERE";
    $dbconinfo = array("UID" => "user", "PWD" => "pass", "Database" => "Data")
    $conn = sqlsrv_connect( $dbconnect, $dbconinfo);
    $sql = "
    SELECT *
    FROM [dbo].[Logins]
    WHERE date >= '2014-01-27 00:00:00.000' AND date < '2014-01-29 00:00:00.000'
    ";

    $options = array();
    $options["Scrollable"] = SQLSRV_CURSOR_CLIENT_BUFFERED;
    $options["QueryTimeout"] = 30000;      

    $stmt = sqlsrv_query( $conn, $sql, array(), $options);

runs 40 seconds and the firewall/VPN shows less than 150 KB/s while the query is running. Task-Manager shows around 5% CPU load for the script.

I used SQLSRV_CURSOR_CLIENT_BUFFERED just for testing, because it reads the result in its own buffer without any further PHP code. Fetching each set of data without buffering is just a little bit slower (around 45 seconds).

I also tried a PDO version which lead to the same result.

ConnectionPooling 0 or 1 didn't make any difference either.

Changing server name to DNS vs. IP adress also made no difference.

LogSubsystems -1 and LogSeverity -1 did not show any issues or anything helpful at all.

I even used Wireshark to watch the network traffic but couldn't find any big differences between PHP and SSMS versions. But I don't know too much about networking layers.

So the CPU load is low, there is no HDD use at all, the network transfer rate is extremely slow and the SQL server would be capable to deliver the results very much faster. And it actually is a lot faster with SSMS on the same PC and network connection. Why is sqlsrv so very slow?

Any ideas what might be the issue or what I could try to speed up PHP/sqlsrv would be greatly appreciated.


Any news about SQLSRV Driver for PHP x64?

$
0
0

I have tried several times to compile this for x64 with no luck, all I keep getting are errors like these:

ext\sqlsrv\core_stmt.cpp(1994) : error C2664: 'convert_string_from_utf16' : cannot convert parameter 3 from 'SQLLEN' to 'SQLINTEGER &'
ext\sqlsrv\core_stmt.cpp(2006) : warning C4244: 'initializing' : conversion from 'SQLLEN' to 'int', possible loss of data
ext\sqlsrv\core_stmt.cpp(2119) : warning C4244: 'initializing' : conversion from 'SQLLEN' to 'SQLINTEGER', possible loss of data
ext\sqlsrv\core_stmt.cpp(2130) : error C2664: 'sqlsrv_result_set::get_data' : cannot convert parameter 5 from 'SQLINTEGER *' to 'SQLLEN *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ext\sqlsrv\core_stmt.cpp(2157) : error C2664: 'sqlsrv_result_set::get_data' : cannot convert parameter 5 from 'SQLINTEGER *' to 'SQLLEN *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ext\sqlsrv\core_stmt.cpp(2183) : error C2664: 'convert_string_from_utf16' : cannot convert parameter 3 from 'SQLLEN' to 'SQLINTEGER &'
ext\sqlsrv\core_stmt.cpp(2227) : error C2664: 'convert_string_from_utf16' : cannot convert parameter 3 from 'SQLLEN' to 'SQLINTEGER &'
ext\sqlsrv\core_stmt.cpp(2380) : warning C4244: 'initializing' : conversion from 'SQLLEN' to 'int', possible loss of data
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\amd64\cl.exe"' : return code '0x2'

Everybody says it's because x64 is experimental in PHP 5.5, but I have successfully compiled another well known DB Server (IBM DB2) for x64 without any problems or errors, Oracle also comes with PHP 5.5 x64, so if DB2 and Oracle can be compiled for x64 why not SQLSRV?

Thanks,

SqlServer driver for php

$
0
0

hi this is arshad from saudi arabia,

Actually i m facing the problem regarding the sql drivers compatibilities for php.  I want to know that sqldriver 3.0 is compatible in Xp service pack 2 or not?

Drivers are installed and configured correctly but PHP can still not find them

$
0
0

Hi,

I am trying to test my application on and IIS/MSSQL setup before trying to deploy it to a customer's site. I have a clean install of IIS, SQL Server and PHP. The Servers appear to be configured correctly. I have downloaded and installed drivers according to the Microsoft documentation. I have made sure the module is enabled in IIS and the entry isin the PHP.ini file.

Using "PHP -i" in powershell gives:

PHP Startup: Unable to load dynamic library

'C:\xampp\php\ext\php_pdo_sqlsrv_55_nts.dll' - The specified module could not be found.

I am using the PHP from my xampp installation as I need the newer version of PHP to support my application. The PHP version is 5.6.3.

When I try to connect to the database in PHP I get: 

#0 CACDB::fail(could not find driver) called at [C:\plato\dal\dbconn.php:24]

#1 CACDB->__construct() called at [C:\plato\dal\dbconn.php:36]

#2 CACDB::Connection() called at [C:\plato\dal\user.php:17] 

Thanks in advance,

Dion

System DSN Not Resolving SQL Server Name

$
0
0

I have a client computer connected to a domain and I'm trying to attach to a GreatPlains database on our SQL server.  All the other clients are fine, but this one wont resolve the servername/instance of the SQL server.  I can use 192.168.1.x\instance and it works, but that leads to problems.

Also, I can ping the server by its name and it resolves.  I can connect via RDP to the server using the name and it resolves.   The server is the domain controller as well.

Please help!  Thanks in advance!

Scott

Problems connecting php5.5 to sql server with php_pdo_sqlsrv_55_ts.dll

$
0
0

I am trying to retrieve code I last touched a couple of years ago to connect to a sql server database.  I have a little test utility to do that

<?php   $serverName = 'ROO\SQLEXPRESS';    $database = "PAS_Live";   // Get UID and PWD from application-specific files.   

$uid = "accu_app";   $pwd = "xxxxx";   try {      $conn = new PDO( "sqlsrv:server=$serverName;Database = $database", $uid, $pwd); $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );    }   catch( PDOException $e ) { die( "Error connecting to SQL Server: $e" );    }   echo "Connected to SQL Server\n"; ?>


This used to work fine with the old version of the drivers.  Since time has moved on, I am trying this again with the latest drivers contained in the SQLSERVER31.EXE file that you can download.  In particular I have set up php5.5 to run with the extension file php_pdo_sqlsrv_55_ts.dll that that file contains.

Whe I run the little test program, it flags up this error (only partially listed it)

'SQLSTATE[IMSSP]: This extension requires the ODBC Driver 11 for SQL Server to communicate with SQL Server...'

I tried downloading the ODBC driver given in the link in the full message (which doesn't point to the driver - but you can find the download link from that link if you search for it), but it refused to install.  I presume that is because, according to my  Data Sources(ODBC)  (run from Administrative Tools), I already have a driver"Sql Server Native Client 11.0" installed.

What am I supposed to do to get this working.  There is absolutely no documentation with the driver that I can find to explain how this new driver works.  Does the connection string change for instance? Or can I uninstall an old client to install a new one.

I am currently doing all of this on Windows 7 Home Premium, but this is really just a test install for the long term plan to move it all to a Server 2011 installation.


SQL Server 2008 R2 backup problem with Sector Size.

$
0
0

I have restored a SQL Server 2008 R2 to my local development system with SQL Server 2008 R2 SP1. After restoring the database, I tried to do a backup and received the message:

How can I solve this problem?

Thanks,

Doug MacLean

Difference between 3.1 and 3.0.1 version

$
0
0
Wich are the differences between both version? Regards

How to catch multi language's data in MSSQL and data isn't garbled

$
0
0

Hi everyone, I'm Taiwanese PHP developer, sorry for my poor English.

I have 3 language's data:Simplified Chinese,Traditional Chinese, and English in our mssql2012 database.

If I want to use ADODB to catch data,The Simplified Chinese and Traditional Chinese will be garbled.

I try to use mb_convert_encoding($data,'UTF-8','BIG-5'), the Traditional Chinese is ok, but Simplified Chinese is still garbled.

Do anyone have suggestion?

This is my output:

Array
(
    [0] => Array
        (
            [0] => ZHS2
            [1] => ?体中文
            [2] => 123
        )

    [1] => Array
        (
            [0] => ZHS3
            [1] => 翻?
            [2] => 123
        )

    [2] => Array
        (
            [0] => ZHS
            [1] => ?体中文
            [2] => Chinese Simplified
        )

    [3] => Array
        (
            [0] => ZHT
            [1] => 繁體中文
            [2] => Chinese Traditional
        )

    [4] => Array
        (
            [0] => US
            [1] => English
            [2] => English US
        )

)

Here is my code:

<?php
include('adodb5/adodb.inc.php');

	function encoding_data($results){
		foreach($results as $key1 => $result){
			foreach ($result as $key2 => $arr_str){
				if(is_integer($key2)){
					//unset($results[$key1][$key2]);
					//echo $key2."=>".$arr_str."<p />";
				}else{
					//echo $key2."=>".$arr_str."<p />";
					$results[$key1][$key2] = mb_convert_encoding($arr_str, 'UTF-8','BIG-5');
				}
				$results[$key1][$key2] = mb_convert_encoding($arr_str, 'UTF-8', 'BIG-5');
			}
		}
		return $results;
	}

	$sql = $_REQUEST['sql'];
	$usedb = $_REQUEST['usedb'];

	if($sql==""){

		$sql = "select * from HCP";

	}

	if($usedb == ""){

		$usedb ="oci8";

	}

	if($usedb == "mssql"){

		$hostname = "Driver={SQL Server};Server=XXXX,XXXX;Database=XXXX;CharacterSet=UTF-8;UID=XXXX;PWD=XXXX";
		//$port = XXXX;
		$dbname = "XXXX";
		$username = "XXXX";
		$pw = "XXXX";

		$mssqlconn = &ADONewConnection ('odbc_mssql');
		//define connection string, specify database driver
		$mssqlconn->Connect($hostname, $username, $pw , $dbname);
		$mssqlconn->debug = false;

		$results = $mssqlconn->GetArray($sql);
		$results = encoding_data($results);

		echo "<pre>",print_r($results),"</pre>";
		print_r($usedb);
?>


Stored procedure timing out - was working fine.

$
0
0

I have a stored procedure which all of a sudden started to time out when called from the data access method for no apparent reason.  Here's the situation:

Its been running fine since its creation about 2 months ago.

It always returns the same fixed number of rows (about 6k rows), the only thing that changes are some of the values in those rows.

Its just a large sql statement, no cursors or anything out of the ordinary.

This has happened twice.  each time it was running find until I ran an update statement to change some of the values. in this case I set a bit column from 0 to 1, and set a date value in a datetime column to all 6k rows. the next time the application executed it, it started to time out.

it runs fine from SSMS where I execute it from the query window.  from here it executes instantly as expected.

the app code that executes the sproc where its timing out is:

qlConnection conn = null;
conn = DBConnectoinHelper.GetDBConnection();
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "dbo.spIssue_LTE_lst ";
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.Add("@Df_Prj_Id", SqlDbType.UniqueIdentifier).Direction = ParameterDirection.Input;
cmd.Parameters["@Df_Prj_Id"].Value = id;
SqlDataReader rdr = cmd.ExecuteReader();

Here's the exception I get in this method when running the code above:

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. "at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader()
   at DataServices.Issue_LTE_DataServices.Issue_LTE_GetListByFK(Guid id)"

The first time this happened, I deleted the sproc and then recreated it, then it ran OK again.  any idea what's happening here and how to trouble shoot/resolve it?

Thank you.

Official PHP 5.6 Driver

Very disappointed with PHP SQL Driver support

$
0
0

Hello,

I don't know what's happening at Microsoft but it appears that you guys have abandon the development and support for the SQL Server PHP driver.

Users have been asking for an update to use PHP 5.5 for a very long time and still nothing from Microsoft.

his delay will continue frustrate PHP users and developers when working with Microsoft products.

What has happened to your commitment to open source technologies? 

KNOWN ISSUES 3513544: Performance degradation...

$
0
0

I see that version 3.1 of the Microsoft Drivers for PHP for SQL Server was published on 12/12/2014 and is available onhttp://www.microsoft.com/en-us/download/details.aspx?id=20098. Thank you Microsoft...

One thing that bothered me though is the "Known issue" described at the end of the release.txt file included in the SQLSRV31.EXE package:

KNOWN ISSUES
"3513544: Performance degradation when using Microsoft Drivers 3.1 for PHP for SQL Server with Windows 7/Windows Server 2008 R2 and previous versions. Clients connecting to supported versions of Microsoft SQL Server may notice decreased performance when opening and closing connections in a Windows 7/Windows Server 2008 R2 environment. The recommended course of action is to upgrade to Windows 8/Windows Server 2012 or later."

Has anybody experienced that "decreased performance when opening and closing connections" problem on Windows Server 2008 R2? If you have, how bad is it?

And are there any solutions - other than the "recommended course of action" ("upgrade to Windows 8/Windows Server 2012 or later")? In a corporate environment upgrading a OS isn't always a simple thing that you do in a few minutes. It can take weeks or months of planning and testing...

Viewing all 391 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>