Advice prepared last year by senior civil servants, now released under Freedom of Information laws, said Scotland was in the red for all but one year between 1990 and 2011, even taking the country's geographical share of oil revenues into account.
Loading article content
The paper warned: "This suggests that over this period North Sea receipts would have been required to fund public services in Scotland.
"Therefore, if the Scottish government had wished to establish an oil fund, it would have had to reduce public spending, increase taxation or increase public sector borrowing."
Mr Salmond was challenged over the revelations at Holyrood yesterday, a week after Finance Secretary John Swinney announced plans to create two oil funds, one to smooth out year-to-year fluctuations in North Sea revenue and the second to create a long term savings fund.
The plan was based on a report from the Scottish Government's Fiscal Commission panel of experts, who argued modest payments could be made into a Norwegian-style savings fund as early as 2017/18 without impacting on tax or public spending.
Scottish Labout leader Johann Lamont used First Minister's Questions to challenge Mr Salmond to say whether services would be cut or taxes increased to allow an oil fund to be set up.
She demanded: "Which is it, and when was he going to tell us?"
Scots Conservative leader Ruth Davidson said the Fiscal Commission's report was based heavily on the earlier civil service advice but with "all the bad stuff" deleted.
She claimed: "It's the Alastair Campbell school of dodgy dossier writing.
The First Minister said the civil service advice, dating back to March 2012 reflected his government's "early thinking" on an oil fund but had been overtaken by the Fiscal Commission's analysis.
He told MSPs: "The fundamental difficulty the unionist parties have with this is quite clear. They want the people of Scotland to believe having an asset whose estimated wholesale value over the next 40 years is £1.5 trillion is somehow a major encumbrance and disadvantage.
"It would have been a huge advantage for the people of Scotland would that we had had it over the last 40 years. We're certainly going to have it over the next 40 years."
During angry clashes, Ms Lamont was twice asked by Presiding Officer Tricia Marwick to withdraw accusations of Scottish Government "dishonesty".
The civil service analysis was produced by the office of the Scottish Government's chief economic adviser. Ministers initially attempted to keep it secret but published it following a ruling by the Information Commissioner.
It said an independent Scotland could have built up an oil fund worth £117 billion had one been started in the North Sea boom years of the 1980s.
However, it warned that since 2000 the Norwegian oil fund had produced returns of 4.1%, while UK Government borrowing cost 4.4%.
The report said: "This implies that if the Scottish Government was able to borrow at the same rate as the UK Government, and adopted a similar investment strategy as the Norwegian oil fund, the returns on its investments may not cover the interest payments on its borrowing."
The Fiscal Commission argued modest sums could be paid into a savings fund without the need for tax rises or spending cuts, provided Scotland's deficit could be reduced to a more manageable level.
Alistair Darling, head of the Better Together campaign, accused the SNP of deception, a view backed by Scottish Secretary Alistair Carmichael.
Mr Darling said: "Last week they said they could set up an oil fund at no cost.
"It is now clear that their own private advice says that there would need to be tax rises, spending cuts or more borrowing - or all three."
Danny Alexander, the Chief Secretary to the Treasury, said Mr Salmond's plans for an oil fund had been completely discredited.