sql-server-2012

Why does FireError fail in C# 2012, but works in VB, while FireInformation works in both?

限于喜欢 提交于 2019-12-19 11:38:51
问题 I have an SSIS package in Visual Studio 2014, and I want to raise an error in a Script Component if any records traverse a particular path out of a 3rd party transformation. I WANT to do this in C# 2012, but the FireError method gives an error: The best overloaded method match for 'Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100.FireError(int, string, string, string, int, out bool)' has some invalid arguments When I try to do this: bool fireAgain = false;

SQL JOIN WITH OR Condition

☆樱花仙子☆ 提交于 2019-12-19 09:08:10
问题 I have a table say Cases , which is using reference from Workers for three columns. Also there is one table Company to which workers belongs. Below is the schema: Cases [ CaseID, CaseNumber, Worker1, Worker2, Worker3 ] Workers [ WorkerID, ComapnyID] Company [CompanyID, CompanyName] Now I need case count for each company. So is it possible to make one join with workers and map all Worker1 , Worker2 and Worker3 columns? Is there any better option and performance impact? Note: Two workers from

Query JSON inside SQL Server 2012 column

家住魔仙堡 提交于 2019-12-19 08:16:13
问题 I have a column inside my SQL Server 2012 table which contains following Json data. [{"bvin":"145a7170ec1247cfa077257e236fad69","id":"b06f6aa5ecd84be3aab27559daffc3a4"}] Now I want to use this column data in my query like select * from tb1 left join tb2 on tb1.(this bvin inside my column) = tb2.bvin. Is there a way to query JSON data in SQL Server 2012? 回答1: Honestly, this is a terrible architecture for storing the data, and can result in some serious performance issues. If you truly don't

IS NULL versus <> 1 SQL bit

余生颓废 提交于 2019-12-19 05:13:27
问题 I have a bit column on a table in a SQL Server 2012 database. I am trying to retrieve all the rows where this bit column is either NULL or NOT TRUE. This query does not bring back what it should: (returns 0 rows) Select * from table where bit_column_value <> 1 This query brings back the correct rows: Select * from table where bit_column_value IS NULL Now, I'd be happy to use the second query, but my issue is that, in a similar query for another table, the reverse of the above is true, where

SQL Server: Best way to concatenate multiple columns?

吃可爱长大的小学妹 提交于 2019-12-19 05:13:27
问题 I am trying to concatenate multiple columns in a query in SQL Server 11.00.3393. I tried the new function CONCAT() but it's not working when I use more than two columns. So I wonder if that's the best way to solve the problem: SELECT CONCAT(CONCAT(CONCAT(COLUMN1,COLUMN2),COLUMN3),COLUMN4) FROM myTable I can't use COLUMN1 + COLUMN2 because of NULL values. EDIT If I try SELECT CONCAT('1','2','3') AS RESULT I get an error The CONCAT function requires 2 argument(s) 回答1: Through discourse it's

Performance difference between left join and inner join

£可爱£侵袭症+ 提交于 2019-12-19 04:08:46
问题 Is there any difference between left join and inner join regarding performance? I use SQL Server 2012. 回答1: There is at least one case where LEFT [OUTER] JOIN is a better option than [INNER] JOIN . I talk about getting the same results using OUTER instead of INNER . Example (I am using AdventureWorks 2008 database): -- Some metadata infos SELECT fk.is_not_trusted, fk.name FROM sys.foreign_keys fk WHERE fk.parent_object_id=object_id('Sales.SalesOrderDetail'); GO CREATE VIEW View1 AS SELECT h

Entity Framework Code First and SQL Server 2012 Sequences

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-19 04:06:08
问题 I was in the middle of implementing a database audit trail whereby CRUD operations performed through my controllers in my Web API project would serialize the old and new poco's and store their values for later retrieval (historical, rollback, etc...). When I got it all working, I did not like how it made my controllers look during a POST because I ended up having to call SaveChanges() twice, once to get the ID for the inserted entity and then again to commit the audit record which needed to

SSIS Error while deploying package The locale identifier (LCID) is not supported by SQL Server

守給你的承諾、 提交于 2019-12-19 03:25:15
问题 I get this error when deploying a package to SQL 2012 SSISDB catalog: A .NET Framework error occurred during execution user-defined routine or aggregate "deploy-project-internal": System.Data.SqlClient.SqlException: The locale identifier (LCID) 9242 is not supported by SQL Server ...... 回答1: I had a very similar issue (different LCID) and took me weeks to resolve it but I hope is the same issue you where having and it helps for any other users. So somehow something got bad installed on the

SQL 2008 VS 2012 Error: Incorrect syntax near the keyword 'COMPUTE'

孤者浪人 提交于 2019-12-19 03:15:40
问题 My friend sent me the commands that he wrote in server 2008 and they worked with no problems, mine however from a copy and past did not work with 2012. Is there any reason why? Here is the code: Use Kudler_Database SELECT AccountNumber, [Description], ShortDescription,Balance FROM Chart_of_Accounts ORDER BY left (AccountNumber, 2) COMPUTE SUM(Balance) BY left (AccountNumber, 2) COMPUTE SUM(Balance); Here is the error : Msg 156, Level 15, State 1, Line 6 Incorrect syntax near the keyword

How to re-deploy, re-create database on each test run

巧了我就是萌 提交于 2019-12-19 03:01:54
问题 Currently I'm using Visual Studio 2012 RC and SQL Server 2012 RTM. I'd like to know how to re-deploy/re-create a test database for each test run. Keep in mind I've a SQL Server database project for the database using Visual Studio 2012's template. Actually I'm not very sure about an idea I got in my mind, but .testsettings file has Setup and cleanup scripts . Is this the way to go? For example, a PowerShell script reading the database project generated script and executing it against the