sql-server-data-tools

How do I publish a SSDT Database from code

五迷三道 提交于 2019-12-05 13:34:50
We have SQLServer01.Publish.xml when I double click this file and publish, it publishes a database to sqlServer01. I wanted to ask can we publish this profile from code somehow ? Ashtonian SSDT seems to like DacPac for this kind of thing. There is a DacServices utility class in Microsoft.SqlServer.Dac . I think this will require SSDT to be installed on the machine you plan on running this code. public class DacPacUtility { public void DeployDacPac( string connString, string dacpacPath, string targetDbName ) { var dbServices = new DacServices( connString ); var dbPackage = DacPackage.Load( new

Why is SSDT Schema Compare showing difference in DefaultExpressionScript?

一世执手 提交于 2019-12-05 09:56:32
While comparing Database instance to a Database project in VS2010 using SSDT, it shows a difference in one of the Stored Procedures. The Store Procedure DDL script is exactly the same but when I expanded the Properties folder under the Store Procedure it show a difference in the DefaultExpressionScript. The source SP shows this in the DefaultExpresionScript: DefaultExpressionScript = at While the destination SP has this: DefaultExpressionScript = -1 I don't see where I can change this there is no such object called DefaultExpressionScript in my database project. where should I fix this? This

Wrong error in SSIS - [Execute SQL Task] Error: There is an invalid number of result bindings returned for the ResultSetType: “ResultSetType_Rowset”

随声附和 提交于 2019-12-05 08:17:41
I have an Execute SQL task which gives returns only one row with one column - a number. I set my result set to single row. Despite that, the task fails. Why ? How do I fix it ? [Execute SQL Task] Error: There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_Rowset". Probably, you haven't configured your resultset parametrs correctly. To configure it, click on ResultSet in the Execute SQL Task, click Add. In the 'ResultSetName' column, enter the exact name of the columnname that you are retrieving or simply give it 0. In the 'variablename', select the

SSIS Package Stuck at “Created Execution” Status

喜你入骨 提交于 2019-12-05 07:18:48
I recently deployed a update to one of my SSIS projects, and ever since the project has failed it's scheduled runs. The SSIS package appears to be stuck at the "Created Execution" status. There are no messages in the reports to explain this issue. I've attempted to redeploy the project, but the results remain the same. I ultimately had to revert to an earlier version of the deployment in order to bring the system back online, but I am now in a position where I can not update the project. I'm at a loss right now as to how to resolve this issue, and this project is a rather vital component to

How to develop t-sql in Visual Studio?

限于喜欢 提交于 2019-12-05 05:35:41
问题 We are using Visual Studio 2013 with SSDT mainly for versioning t-sql code, so the sql is being developed on the dev server and then we use schema compare to transfer the scripts into visual studio (and check into Git). Before deployment (which we currently do with schema compare, too) we have to replace database and server references (with [$(database)] etc.). If we change the code in the dev server and compare again, such SQLCMD variables are lost again. (I would expect schema compare to be

SSDT failing to publish: “Unable to connect to master or target server”

随声附和 提交于 2019-12-05 05:19:06
I'm attempting to use SSDT to publish to a SQL Server database in Azure. When I do so, I am seeing the following error: Unable to connect to master or target server 'DATABASE_NAME'. You must have a user with the same password in master or target server 'DATABASE_NAME'. Ignoring the fact that it's listing a database name as the server name in the error, I'm not sure how to resolve it. When I specify the target database, I can successfully Test Connection. I can also connect using the same creds to the database through SSMS. After researching the error, it seems like it is often that the

Is there any way to stop SqlPackage.exe setting default Filegroup in deployment script?

让人想犯罪 __ 提交于 2019-12-05 04:58:07
We are using Sql Server database projects to create deployment scripts from DacPac using SqlPackage.exe. We have different SQL Server Filegroups setup in various environments. When deploying we exclude Filegroups as we want objects to create in the default Filegroup. In database project settings the default Filegroup is not changed from PRIMARY. This presents a problem when attempting to deploy to an environment where the default Filegroup is not PRIMARY because the following code is included... ALTER DATABASE [$(DatabaseName)] MODIFY FILEGROUP [PRIMARY] DEFAULT; Is there a way to prevent this

How to include custom data migrations and static/reference data in an SSDT project?

落花浮王杯 提交于 2019-12-05 03:45:40
We have a moderately-sized SSDT project (~100 tables) that's deployed to dozens of different database instances. As part of our build process we generate a .dacpac file and then when we're ready to upgrade a database we generate a publish script and run it against the database. Some db instances are upgraded at different times so it's important that we have a structured process for these upgrades and versioning. Most of the generated migration script is dropping and (re)creating procs, functions, indexes and performing any structural changes, plus some data scripts included in a Post

How to rename table using SSDT in Visual Studio

风流意气都作罢 提交于 2019-12-05 03:12:24
I am using visual studio 2013 and trying to learn local database operations. I have created a database using VS and create tables. But I cannot rename table names. There is no such a option anywhere or I cannot see. I searched but find nothing. Could anyone show me how to rename table using 'VISUAL STUDIO 2013 SSDT' Open the table, highlight the table name in the T-SQL portion of the window, click the SQL menu, then choose Refactor and Rename. You probably want to preview changes while you're at it to see what will be affected. 来源: https://stackoverflow.com/questions/22577669/how-to-rename

Deploy of a report with SSDT 2016 generates error

五迷三道 提交于 2019-12-05 02:56:35
I use VS2015 with SQL Server Data Tools; I have some Reporting Services (RDL) reports. I want to deploy them to a Reporting Server with SQL Server 2014 installed. In my report project I set the TargetServerVersion to "SQL Server 2008R2, 2012 or 2014" , but the deploment process fails with an error similar to: Report Definition invalid, because namespace .../2016/... invalid. It is solved. You "MUST" recompile your report project and immediately afterwards you can deploy your reports without any problem. 来源: https://stackoverflow.com/questions/37816216/deploy-of-a-report-with-ssdt-2016