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'
精彩评论