There is one SP (SP_GenerateScript) available at the below URL:
Explanation for the switches in the SP can be found at the below URL:
When i execute the SP script files are created successfully. Separate script files each for Table, SP, Views, etc are created. But my requirement is to create a single file for all objects.
There is an occurence in the SP like
set @query = '"'+@applicationpath +'"'+ ' /s '+@@servername+ ' /d '+@dbname+ +' /F '+@destinationpath+ @switches
As per the explanation in the Switches, /F means separate file for different category of objects.
Hence is replaced /F with /f, which means all script in a single file. Now i get an error like the one below:
ERROR: Executing ScriptTransfer
Error Code: 5
Error Category: 0
Source: Microsoft SQL-DMO
Description: [SQL-DMO]CreateFile error on 'd:\pubs20100108'. Access is denied.
Can anyone help me out on how to resolve this?