I get an unresolved reference to the object [#aspnet_Permissions]

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

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

How to override the connection string and target database of a database project

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.