开发者

Sql server 2000 -Space find

开发者 https://www.devze.com 2023-01-03 00:59 出处:网络
This is query: CREATE TABLE #TempTable(datasize varchar(200)) INSERT#TempTable EXEC sp_spaceused \'Table1\'

This is query:

CREATE TABLE #TempTable(datasize varchar(200))

INSERT  #TempTable
   EXEC sp_spaceused 'Table1'

When executing this query error message shown as below

Column name or number of supplied values does not match table definition

How can I solve this pr开发者_如何学Gooblem?


There's a definition mismatch between that temp table and the default output of sp_spaceused.

Use:

CREATE TABLE #TempTable
(
    objName         varchar(200),
    objRows         varchar(200),
    objReserved     varchar(200),
    objData         varchar(200),
    objIndexSize    varchar(200),
    objUnused       varchar(200)
)

INSERT INTO #TempTable
    EXEC sp_spaceused 'Table1'
0

精彩评论

暂无评论...
验证码 换一张
取 消