为什么这张桌子被截断了?没有错误返回。如果我在SQL Server Management Studio中运行truncate SQL,它会正常截断。
$truncate = "USE energyDB truncate table temp_energydata";
// Initiate connection to energyDB MS SQL server
$connection = sqlsrv_connect($serverName, $connectionInfo);
if( $connection ) {
echo "Connection established.";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
// Start the query on the Database server
$statement = sqlsrv_query($connection,$truncate);
if( $statement ) {
echo "Truncate Query completed.";
}else{
echo "Query not completed.<br />";
die( print_r( sqlsrv_errors(), true));
答案 0 :(得分:0)
@ user1745767
$ truncate =“USE energyDB truncate table [temp_energydata]”;
尝试这样也花了好几个小时才能遇见。