Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Generate script for all objects in a database Expand / Collapse
Posted Friday, January 8, 2010 2:41 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, January 20, 2010 3:02 AM
Points: 1, Visits: 10
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:

Scripting failed.
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?
Post #844171
Posted Sunday, January 10, 2010 11:49 AM



Group: General Forum Members
Last Login: Tuesday, August 2, 2016 2:14 PM
Points: 1,519, Visits: 4,107
Looks like a permissions issue to me. Is the directory/user/etc you used when the script executed successfully the same as the ones you used when it failed?

Seth Phelabaum
Consistency is only a virtue if you're not a screwup.

Links: How to Post Sample Data :: Running Totals :: Tally Table :: Cross Tabs/Pivots :: String Concatenation
Post #845089
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse