How to put the result of the stored procedure into a temporary table

xiaoxiao2021-03-06  39

If you can get the table structure in the stored procedure result set INSERT INTO #TMP EXEC SP_WHO

Otherwise, Select * Into #tmp from OpenRowSet ('sqloledb', 'server = server; uid = sa; pwd = sapwd; database = master', 'exec ") AS A If the store is used during the stored procedure, Use Set Fmtonly Offselect * Into #tmp from OpenRowSet ('SQLOLEDB', 'Server = Server; UID = SA; PWD = SAPWD; Database = Master', 'Set FMTONLY OFF; EXEC Store ") AS A

转载请注明原文地址:https://www.9cbs.com/read-78244.html

New Post(0)