我尝试使用此
select * into #tempdb (
exec SSC.usp_abc_data '01/31/2017','L','G','1','17',Null)
它提示输出错误
Msg 156, Level 15, State 1, Line 4 Incorrect syntax near the keyword 'exec'. Msg 102, Level 15, State 1, Line 4
答案 0 :(得分:0)
use Phalcon\Mvc\Controller;
class UserController extends Controller
{
public function indexAction()
{
}
public function createAction()
{
$this->assets
->addJs('js/jquery.js')
->addJs('js/user.js');
$this->response->setJsonContent(["data" => ["Your data"]]);
$this->response->send();
}
}
所以在你的情况下它会像:
SELECT * INTO #TestTableT FROM OPENROWSET('SQLNCLI', 'Server=localhost;Trusted_Connection=yes;',
'EXEC [databasename].[schemaname].[sp name]')
-- Select Table
SELECT *
FROM #TestTableT;
请记住包含数据库名称。
如果您在此方法中遇到错误,请通过在SSMS中执行以下查询来启用即席分布式查询:
SELECT * INTO #tempdb FROM OPENROWSET('SQLNCLI', 'Server=localhost;Trusted_Connection=yes;',
'EXEC [databasename].SSC.usp_abc_data ''01/31/2017'',''L'',''G'',''1'',''17'',Null')
-- Select Table
SELECT *
FROM #tempdb;
从here
引用的答案