SSIS: script task (vs15) not work when deploy on sql server 2014

This worked for me: Install SSDT-BI for Visual Studio 2013. Open your solution in Visual Studio 2015. Select your SSIS Project in the Solution Explorer. In the Project menu select Properties. In the Property Pages dialog select Configuration Properties -> General Under Deployment Target Version change the Target Server Version to “SQL Server 2014.” Clean … Read more

How to get the next number in a sequence

If you do not maintain a counter table, there are two options. Within a transaction, first select the MAX(seq_id) with one of the following table hints: WITH(TABLOCKX, HOLDLOCK) WITH(ROWLOCK, XLOCK, HOLDLOCK) TABLOCKX + HOLDLOCK is a bit overkill. It blocks regular select statements, which can be considered heavy even though the transaction is small. A … Read more

Using GROUP BY with FIRST_VALUE and LAST_VALUE

SELECT MIN(MinuteBar) AS MinuteBar5, Opening, MAX(High) AS High, MIN(Low) AS Low, Closing, Interval FROM ( SELECT FIRST_VALUE([Open]) OVER (PARTITION BY DATEDIFF(MINUTE, ‘2015-01-01 00:00:00’, MinuteBar) / 5 ORDER BY MinuteBar) AS Opening, FIRST_VALUE([Close]) OVER (PARTITION BY DATEDIFF(MINUTE, ‘2015-01-01 00:00:00’, MinuteBar) / 5 ORDER BY MinuteBar DESC) AS Closing, DATEDIFF(MINUTE, ‘2015-01-01 00:00:00’, MinuteBar) / 5 AS Interval, … Read more

Equivalent of MoveNext in VB.NET

In UI, you can use BindingNavigator. In code, you can use BindingSource.MoveNext() or change this.BindingContext[datasource].Position. OP: Some Data bindingNavigator function I seen somewhere but can’t get it. If this option is good option then please add a link in comment plz… As a quick start to create a data application: Show Data Source Window from … Read more

LocalDB SQL Server 2014 Express creates 2 instances (localdb)\ProjectsV12 & (localdb)\MSSQLLocalDB?

The (localdb)\ProjectsV12 and (localdb)\ProjectsV13 instances are created by SQL Server Data Tools (SSDT) and should not be used by applications (localdb)\MSSQLLocalDB is the SQL Server Express 2014/2016 LocalDB default instance name and an “automatic instance”. You can use the sqllocaldb.exe command line tool to manage which version (2014 or 2016) owns the MSSqlLocaldb instance And … Read more

SQL Server – Remove all non-printable ASCII characters

Another Option. This function will replace control characters and correct any residual repeating spaces. For example Jane Smith{13}was here will not be returned as Jane Smithwas here, but rather Jane Smith was here CREATE FUNCTION [dbo].[udf-Str-Strip-Control](@S varchar(max)) Returns varchar(max) Begin ;with cte1(N) As (Select 1 From (Values(1),(1),(1),(1),(1),(1),(1),(1),(1),(1)) N(N)), cte2(C) As (Select Top (32) Char(Row_Number() over … Read more