Monday, August 06, 2012 9:59 AM
I would like to connect my Database with Visual Studio 2010 and then work with it.
Here's what I did:
- I connected an existing SQL Database with VS2010.
- I created a New "SQL Server 2008 Database Project".
- Right-click on the Database Project in the Solution Explorer -> "Import Object and Settings".
- I have chosen a Database and clicked Start and then Finish.
After I waited a little bit, till the operations are completed, I get around 150 error Messages with the error code SQL03006 and 50 warnings with the error code SQL04151.
What I tried till now:
- I tried every possible option, when I do the "Import Object and Settings".
- I created a Server Project to the Solution and made a Shema comparison. But after the comparison is completed I get over 100 more errors with the error code SQL03006. And when I set the Reference to the Server Project, it won't work either.
- I selected all check boxes under "Tools -> Options -> Database Tools -> Shema Compare -> Microsoft SQL Server 2008 -> Object Types"
Does anyone know a fix or a workaround?
Tuesday, August 07, 2012 2:42 AMModerator
As far as I know that error SQL03006 error always raised when database objects in one database project can't resolve references to other objects. Solutions to deal with this error vary based on the reference type you use for these database project:
1). If these objects just reference objects in another database, you need to create one more database project for that database and then add database reference for it.
2). If these objects reference objects in master or tempdb database, you need to add reference to the C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\SqlServer\2008\DBSchemas\master.dbschema file and change the database variable to be "master" or "tempdb". See: http://blogs.msdn.com/b/gertd/archive/2009/06/10/system-objects-in-tempdb.aspx
If both the above two options are not your scenario, please show me the detailed error message you got, I would like to know which kind of reference you use and then provide you the solution accordingly.
Vicky Song [MSFT]
MSDN Community Support | Feedback to us
- Marked As Answer by Benzolitz Wednesday, August 08, 2012 6:27 AM
Wednesday, August 08, 2012 6:27 AM
Thanks Vicky! Works fine now.