I get an unresolved reference to the object [#aspnet_Permissions] 29 July 2011 Donovan-Brown Work (0) Normal 0 false false false EN-US X-NONE X-NONE Problem When I import a database that uses ASP.NET Providers I get an unresolved reference to the object [#aspnet_Permissions]. Solution Modify the script to define the shape of the temp table by adding the additional SQL above the declaration of the cursor. IF(OBJECT_ID('tempdb.#aspnet_Permissions') IS NULL) BEGIN CREATE TABLE #aspnet_Permissions ( Owner sysname, Object sysname, Grantee sysname, Grantor sysname, ProtectType char(10), [Action] varchar(60), [Column] sysname ) END Or just download the file below. Explanation The "#aspnet_Permissions" temp table must be created by ASPNET at the same time as the membership database is created. Because the table is not created in this script or referenced by this project the table appears as an external reference that DBPro cannot resolve. By adding the code the table can be resolved by the DBPro project and will not create the table if it already exist on the database server you are deploying too. aspnet_Setup_RestorePermissions.proc.sql (1.14 kb)
sysobject warnings in my DBPro projects 29 July 2011 Donovan-Brown Work (0) Problem My DBPro project references sysobjects and is causing build warnings for example: SQL04151: Procedure: [dbo].[aspnet_AnyDataInTables] has an unresolved reference to object [dbo].[sysobjects]. Solution Add the following DB reference to your database project: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\SqlServer\2008\DBSchemas\master.dbschema If you are targeting 2005 SQL Server use: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\SqlServer\2005\DBSchemas\master.dbschema
I can't run my scripts created by DBPro in SSMS 26 July 2011 Donovan-Brown Work (0) Problem When I try and run my deploy scripts from DBPro in SSMS I get syntax errors where variables are used. Solution Switch on SQL CMD Mode before you execute the SQL file. To enable the SQL CMD Mode select SQL CMD Mode from the Query menu in SSMS.
How to override the connection string and target database of a database project 06 September 2010 Donovan-Brown Work (0) Problem: I need to override the connection string and target database of a database project built with Team Build. Solution: Pass the TargetConnectionString and TargetDatabase parameters to team build. Explanation: Although Team Build in 2010 is Windows Workflow based at the end of the day MSBuild is still being called to perform the actual build. Project files in Visual Studio are just MSBuild project files. Not only does this make building Visual Studio projects and solution very easy but it also allows us to pass parameters to our builds. Any properties set in a project file can be overwritten by passing in parameters to MSBuild. The parameters we need to override are TargetConnectionString and TargetDatabase. On the Process Tab of the Team Build 2010 Build Definition wizard you can use the MSBuild Arguments parameter to pass in parameters to MSBuild. For example I can pass in the following to override the values in the project file, /p:TargetConnectionString="Data Source=.;Integrated Security=True;Pooling=False" /p:TargetDatabase=MyDatabase This allows me to keep the project file in version control set to the values used for development and override them for build when I deploy to different environments.
How do I deploy Metadata during my database deploy 06 September 2010 Donovan-Brown Work (0) How to deploy Metadata with my database. [More]
How to deploy a Database Project with Team Build 2010 06 September 2010 Donovan-Brown Work (0) How to deploy your database project using Team Build 2010 [More]