I'm trying to generate scripts in SQL Server Management Studio 2005.
When I choose 'Script all objects' I get an error when I try to execute it. When I generate the scripts in single files, only tables in one file, only views in one file etc. etc., the execution is succeded.
1) Why do I get an error when I try to execute the script containing tables, views, procedures in one file....?
2) I get an error in the view-file where one column is 'invalid' but I can see it in the view. A generated script should execute succesfully when it is generated one second ago on the same database and so on... Right?
Thanks....
Which exact error do you get ?
Jens K. Suessmeyer
http://www.sqlserver2005.de
sorry, I cant reproduce the errors because my workbuddy has the day off...
But I remember it was one of the views with 2 columns in it, which caused the error: 'Invalid item on view...'
And the sequense in the script is wrong. For example I can see that the script are trying to create a view before the table is created?
|||You may find that the Database Publishing Wizard offers you more functionality.
Database Publishing Wizard
http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en
|||Thomas, did you find a solution to your problem?I have the same problem and Database Publishing Wizard does not work any better.
The CREATE VIEW is placed before the dependant tables in the script.
This ONLY happens when I'm trying to script a SQL Server 2005 Express db.
I run the script wizard in SQL Server Management Studio 2005.
SQL Server 2005 Express: 9.0.3042
SQL Server 2005: 9.0.1399
Thanks
Jonas
|||
Did you use the switch "create dependent objects" ?
Jens K. Suessmeyer
http://www.sqlserver2005.de
|||Yes I did.
I've now updated to sp2 (9.0.3042) on the SQL Server 2005 too - no difference. Except that the default value of "create dependant objects" in the script wizard is now false.
I can not include any image of the properties selected, but all are default exept the dependant switch which is true.
The final report start with:
Generate Script Progress
- Determining objects in database '....MDF' that will be scripted. (Success)
- dbo.AllDataView (Success)
- dbo.FindNewRawData (Success)
Which also shows that a View is created first of all objects.
Thanks
Jonas
No comments:
Post a Comment