sql-server-data-tools

SSDT SQL Server Debugging Doesn't Hit CLR Breakpoints

China☆狼群 提交于 2019-12-03 02:49:17
I applied the SQL Server Data Tools patch to Visual Studio 2012 (Premium) and created a SQL Server CLR user-defined function project in C#: public partial class UserDefinedFunctions { [Microsoft.SqlServer.Server.SqlFunction] public static SqlInt32 Add42(SqlInt32 in_param) { SqlInt32 retval = in_param + 42; // Set break point here. return retval; } } In the SQL Server Object Explorer pane, I right-click on the newly published UDF and select "Execute Function..." I am prompted to supply a sample input value, and Visual Studio then publishes the function (again) to my local 2012 SQL Server and

Command-line/API for Schema Compare in SSDT SQL Server Database Project?

偶尔善良 提交于 2019-12-03 02:45:01
问题 In Visual Studio 2012, we have Schema Compare in SSDT's SQL Server Database Project (DbProject) project which helps Compare source versus target Update target to make it the same as source Where Source and target can be either a database, a DbProject project, or a .dacpac file Update can be done via an update action or generated script My question is that is it possible to have and where can I get the command-line/API interface to call this feature? 回答1: SOURCE Database sqlpackage.exe /a

MSBuild 15.0 (Visual Studio 2017) error MSB4067 for SSDT (SSRS and SSAS) projects: “The element <State> beneath element <Project> is unrecognized”

纵饮孤独 提交于 2019-12-03 02:31:25
MSBuild 14.0 (the version included with Visual Studio 2015) logs warnings (MSB4078) when building a solution which contains SSDT projects (rptproj or dwproj projects). For example: warning MSB4078: The project file "Reports.rptproj" is not supported by MSBuild and cannot be built. This is fine, MSBuild does not support SSDT projects, and we have to fall back to building them with Visual Studio (i.e. devenv.com ). See, for example, this answer . When using MSBuild 15.0 (the version included with Visual Studio 2017), however, building the same solution file gives the following error : Reports

How to create a user for a login in 2013 SQL Server Database Project

旧时模样 提交于 2019-12-03 01:46:53
I'm trying to create a user with a login for a SSDT database project. The login already exists on the target server. With the following SQL: CREATE USER [MyLogin] FOR LOGIN [MyLogin] WITH DEFAULT_SCHEMA = dbo GO I get the error: Error 1 SQL71501: User: [MyLogin] has an unresolved reference to Login [MyLogin]. I've found two solutions, but neither work with 2013: 1) Create a server project to reference the login. This isn't an option in the current version of SSDT / VS2013 2) Disable schema checking. The option is missing in 2013 (I believe it was Options -> Database Tools -> Schema Compare )

Default to the T-SQL Pane view within Visual Studio 2012 Database Project

允我心安 提交于 2019-12-03 01:27:20
When working with a Database Project in Visual Studio 2012, VS defaults to the "Design-View" pane when you add or edit a table. While you can work in split-screen mode, the T-SQL pane defaults to the bottom pane. As I prefer to work with T-SQL directly as opposed to the designer, I constantly am switching to make the T-SQL pane the top-most editor in order to work with the object. Unfortunately, VS does not remember this preference, so each and every time I work with a table I must change to make the T-SQL pane appear on top as opposed to beneath the designer pane. I've looked to see if there

Import Database in VS 2015 SQL Server Database Project

人盡茶涼 提交于 2019-12-02 20:19:25
I recently had troubles Importing a Database from a SQL Server Database Project in VS 2015. Just hoping this helps some folks. I will add more pictures when my rep is higher. Error I get: The server version or database compatibility level is not supported. This is the Error I get when I right click on the project and try and Import a Database . Import Error: Right click on the Project and clicking View in Object Explorer . Add and connect to your database next, if needed. Right click on the database you are wanting to import and click Create New Project . Change settings if needed. Then Click

SSDT Post Deployment Scripts

青春壹個敷衍的年華 提交于 2019-12-02 19:17:29
问题 I would like to ignore post deployment scripts after it has been deployed. How do you archive/remove a branch specific post deployment script after it has been deployed on production environment in SSDT? Are there any best practices around? 回答1: What I used to do is to create log table and store all the executed scripts. This is the table structure: CREATE TABLE dbo.publish_script_logs ( script_name_id VARCHAR(255) NOT NULL , database_name VARCHAR(255) NOT NULL , execution_time DATETIME2(7)

Command-line/API for Schema Compare in SSDT SQL Server Database Project?

丶灬走出姿态 提交于 2019-12-02 16:47:16
In Visual Studio 2012, we have Schema Compare in SSDT 's SQL Server Database Project (DbProject) project which helps Compare source versus target Update target to make it the same as source Where Source and target can be either a database, a DbProject project, or a .dacpac file Update can be done via an update action or generated script My question is that is it possible to have and where can I get the command-line/API interface to call this feature? SOURCE Database sqlpackage.exe /a:Extract /scs:Server=%Server%;Database=AspBaselineDB; /tf:%DriveSpec%\%DacPath%\%AspBaselineDB%_baseline.dacpac

How to properly manage database deployment with SSDT and Visual Studio 2012 Database Projects?

折月煮酒 提交于 2019-12-02 13:52:35
I'm in the research phase trying to adopt 2012 Database Projects on an existing small project. I'm a C# developer, not a DBA, so I'm not particularly fluent with best practices. I've been searching google and stackoverflow for a few hours now but I still don't know how to handle some key deployment scenarios properly. 1) Over the course of several development cycles, how do I manage multiple versions of my database? If I have a client on v3 of my database and I want to upgrade them to v8, how do I manage this? We currently manage hand-crafted schema and data migration scripts for every version

SSRS Records Not Showing Up When (Select All) Is Used But Is When Selecting A Particular Value

强颜欢笑 提交于 2019-12-02 12:16:05
问题 I have a report that is has a multiple value parameter. It has available values (1, 2, 3, 4, 5, and blank). The blank value isn't NULL it is just an empty cell. For testing purposes, there should only be one record showing up. The record has a blank value in the cell that I am using to filter on in my stored procedure. In the parameter drop down, I see all of the options. If I choose the (Select All) option, I don't get the record I am wanting. However, if I choose just the blank value, I get