sql-server-2014

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

自作多情 提交于 2019-11-28 12:38:20
The error: There was an exception while loading Script Task from XML: System.Exception: The Script Task uses version 14.0 script that is not supported in this release of Integration Services. To run the package, use the Script Task to create a new VSTA script. In most cases, scripts are converted automatically to use a supported version, when you open a SQL Server Integration Services package in %SQL_PRODUCT_SHORT_NAME% Integration Services. at Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptTask.LoadFromXML(XmlElement elemProj, IDTSInfoEvents events) I'm doing exactly what it says, but it does

The database cannot be opened because it is version 851. This server supports version 782 and earlier. A downgrade path is not supported

坚强是说给别人听的谎言 提交于 2019-11-28 12:01:39
I am trying to attach database file in SQL Server. I am getting the below error. The same error I am getting while trying to attach database from Visual Studio. I am using Visual Studio 2013 and SQL Server 2014 Management Studio. My connection string: <add name="Sample" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\M\Desktop\SampleApplication1\App_Data\Sample.mdf;Initial Catalog=SampleDBContext;Integrated Security=True;" providerName="System.Data.SqlClient"/> Error: The database 'sample' cannot be opened because it is version 851. This server supports version

c# time to sql date time

自作多情 提交于 2019-11-28 11:35:20
问题 I am not able to convert the c# date time 7/31/2017 3:13:49 PM to SQL date time while inserting the records to the database. I am doing this using DateTime dt = DateTime.Parse("11/23/2010"); string toSqlDate= dt.ToString("yyyy-MM-dd HH:mm:ss"); DateTime finalDate = DateTime.Parse(toSqlDate); But it's giving me the error. String was not recognized as a valid DateTime. 回答1: After changing it to year/month/date this can help! var sqlDate = finalDate.Date.ToString("yyyy-MM-dd HH:mm:ss"); 回答2:

Using GROUP BY with FIRST_VALUE and LAST_VALUE

夙愿已清 提交于 2019-11-28 09:54:36
I'm working with some data that is currently stored in 1 minute intervals that looks like this: CREATE TABLE #MinuteData ( [Id] INT , [MinuteBar] DATETIME , [Open] NUMERIC(12, 6) , [High] NUMERIC(12, 6) , [Low] NUMERIC(12, 6) , [Close] NUMERIC(12, 6) ); INSERT INTO #MinuteData ( [Id], [MinuteBar], [Open], [High], [Low], [Close] ) VALUES ( 1, '2015-01-01 17:00:00', 1.557870, 1.557880, 1.557870, 1.557880 ), ( 2, '2015-01-01 17:01:00', 1.557900, 1.557900, 1.557880, 1.557880 ), ( 3, '2015-01-01 17:02:00', 1.557960, 1.558070, 1.557960, 1.558040 ), ( 4, '2015-01-01 17:03:00', 1.558080, 1.558100, 1

SQL Server after update trigger

主宰稳场 提交于 2019-11-28 09:04:48
I have a problem with this trigger. I would like it to update the requested information only to the row in question (the one I just updated) and not the entire table. CREATE TRIGGER [dbo].[after_update] ON [dbo].[MYTABLE] AFTER UPDATE AS BEGIN UPDATE MYTABLE SET mytable.CHANGED_ON = GETDATE(), CHANGED_BY=USER_NAME(USER_ID()) How do I tell the trigger that this applies only to the row in question? Here is my example after a test CREATE TRIGGER [dbo].UpdateTasadoresName ON [dbo].Tasadores FOR UPDATE AS UPDATE Tasadores SET NombreCompleto = RTRIM( Tasadores.Nombre + ' ' + isnull(Tasadores

Changing sql-server DB from tabular to multidimensional

假装没事ソ 提交于 2019-11-28 08:37:08
问题 I have following problem: When I try to deploy my SSAS project (with cube, dimensions and all that jazz) to sql-server, it throws error saying that You cannot deploy the model because the DB deployment server is not running in multidimensional mode. I'm new to this, so it might be a dumb question, but how do I change database mode from tabular to multidimensional? 回答1: Tabular and Multi Dimensional are completely different thing. When you install SQL Server, you have to choose which one you

Why is running a query on SQL Azure so much slower?

戏子无情 提交于 2019-11-28 08:10:51
I created a trial account on Azure , and I deployed my database from SmarterAsp . When I run a pivot query on SmarterAsp\MyDatabase , the results appeared in 2 seconds . However, running the same query on Azure\MyDatabase took 94 seconds . I use the SQL Server 2014 Management Studio (trial) to connect to the servers and run query. Is this difference of speed because my account is a trial account? Some related info to my question the query is: ALTER procedure [dbo].[Pivot_Per_Day] @iyear int, @imonth int, @iddepartment int as declare @columnName Nvarchar(max) = '' declare @sql Nvarchar(max) =''

In-Memory user defined table, not in memory?

落爺英雄遲暮 提交于 2019-11-28 03:06:13
问题 I am using SQL Server 2014 CTP2, with READ_COMMITTED_SNAPSHOT ON (I think it's important for the question). I have create an In-Memory table type (very similar to the example the technet blog, SQL Server 2014 In Memory OLTP: Memory-Optimized Table Types and Table Variables), and I have several In-Memory tables. In the query itself I have a join between the regular In-Memory tables and the In-Memory table type, acting as a filter, when I execute the query I get this error message: "A query

How to restore SQL Server 2014 backup in SQL Server 2008

三世轮回 提交于 2019-11-28 01:50:50
Were there any changes in this area with SQL Server 2014? I’ve seen this post Is it possible to restore Sql Server 2008 backup in sql server 2005 and I know that this was not possible as a scenario for 2012 -> 2008 but I wonder if MS made any changes here with the 2014 version. We are evaluating 2014 version and we have a fairly large database in testing. We’d like to restore a backup of that database to SQL Server 2008 because that physical machine has more space, RAM,… I’m getting standard error message when I try to restore backup but I was wondering if there is something else in SQL Server

Convert SQL Server Date to mm-yyyy

杀马特。学长 韩版系。学妹 提交于 2019-11-27 23:55:11
问题 I'm trying to convert my Date which is (eg. 2012-04-20 05:54:59) format in into mm-yyyy. I came across some solutions that says you would need to convert into varchar . Is there any way using the Convert function ? Thanks :) 回答1: You can use FORMAT function, available from SQL Server 2012 onwards: DECLARE @myDate DATETIME = '2012-04-20 05:54:59' SELECT FORMAT(@myDate, 'MM-yyyy') Output: 04-2012 回答2: There might be a more graceful way to pull this off, but the below works. Declare @dt datetime