0

为什么这张表不会被截断?不返回错误。如果我在 SQL Server Management Studio 中运行截断 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));
4

1 回答 1

0

@user1745767

$truncate = "使用 energyDB 截断表 [temp_energydata]";

像这样尝试也需要几个小时才能见面。

于 2017-08-15T12:26:31.097 回答