EDINBURGH (Reuters) - Support for Scottish independence rose dramatically in August, a poll showed on Monday, leaving the "Yes" campaign just six points behind advocates of staying in the United Kingdom with 17 days to go until a referendum.

The poll is the first to show a substantial shift in opinion since two television debates. Pro-independence leader Alex Salmond dominated the second debate last week, having failed to win the first one.

A poll for the Sun and the Times newspapers showed support for the pro-independence "Yes" campaign had risen to 47 percent, a four point gain since mid-August and up eight points since the start of the month.

The lead of the "No" campaign to reject independence has slumped to 6 points from 22 points at the start of August. Headline figures excluded undecided voters.

While the figures are the same as a Survation poll last week, Survation had shown support for independence as unchanged when compared to its last poll before the first debate, and has historically shown much smaller leads for "No" than YouGov.

YouGov's survey shows a closer contest than the most recent "poll of polls," on Aug. 15, based on an average of the last six polls, which found support for a breakaway was at 43 percent, against 57 percent for staying in the United Kingdom.

While YouGov has previously shown stronger leads for "No" than some other pollsters, Monday's poll was the first time it has showed support for Yes above 40 percent and support for "No" below 50 percent, once undecided are included.

The poll of 1,063 respondents showed 42 percent support for "Yes", 48 percent voting "No", with undecideds at a record low of 10 percent as voters make up their minds ahead of the Sept. 18 referendum.

(Reporting by Alistair Smout)