sql-server-2014

Cannot be opened because it is version 852. this server supports version 782 and earlier

不羁的心 提交于 2019-11-27 03:23:17
问题 I am using Visual Studio 2017 and SQL Server 2014. While attaching a database file to Visual Studio, I get this error: "" After upgrading the file I used this connection string <connectionStrings> <add name="con" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\binaaelmamorra.mdf;Integrated Security=True;Connect Timeout=30"/> </connectionStrings> It's working fine on my machine, but on the client machine, an error pops up saying Cannot be opened because it

SQL Server after update trigger

梦想与她 提交于 2019-11-27 02:38:11
问题 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? 回答1: Here is my example after a test CREATE TRIGGER [dbo].UpdateTasadoresName ON [dbo].Tasadores

Equivalent of MoveNext in VB.NET

半腔热情 提交于 2019-11-27 02:17:21
As Recordset.MoveNext function is no longer available in VB.NET(searched alot on internet), I want a way to solve my problem.. (Using MSSQL, just seen movenext function somewhere which is not supported with SQLDATASET.) I want to use something which work like MoveNext function and make the changes in the database instantly. Moreover after changes made, it should also reflect into database instantly.. As I said, I searched alot on internet, I am now confused what to use... The following options I got on Internet 1)Using SQLDataset and use SQLDataAdapter with it Problem :- I have to update the

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

旧城冷巷雨未停 提交于 2019-11-27 00:34:24
I'm using SQL Server 2014 Express and the LocalDB option, and I have the following in my SQL Server object explorer pane in Visual Studio 2013... So what is the difference between (localdb)\ProjectsV12 & (localdb)\MSSQLLocalDB ? ErikEJ 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

SQL Server - Remove all non-printable ASCII characters

孤街浪徒 提交于 2019-11-26 23:22:24
问题 We recently migrated from SQL Server 2012 to SQL Server 2014 and all our FOR XML code started throwing errors about non-printable ASCII characters. I wrote this horrible function to remove non-printable ASCII characters as a quick fix. I want to replace it with something cleaner. Is there a way to do this? ALTER FUNCTION [dbo].[remove_non_printable_chars] (@input_string nvarchar(max)) RETURNS nvarchar(max) BEGIN RETURN REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE

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

不问归期 提交于 2019-11-26 22:57:50
问题 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,

Visual Studio 2013 incompatibility with MS SQL Server 2014

杀马特。学长 韩版系。学妹 提交于 2019-11-26 20:36:18
问题 I downloaded MS SQL Server 2014 Enterprise Edition from MSDN. I want to do a server backend in C# and MS SQL, but the problem is, whenever I want to do something with DB in Visual Studio 2013 Ultimate it just tells me this =================================== An incompatible SQL Server version was detected. (Microsoft.VisualStudio.Data.Tools.SqlEditor) ------------------------------ Program Location: at Microsoft.VisualStudio.Data.Tools.SqlEditor.DataModel.SqlConnectionStrategy

Publish DACPAC to SQL Server 2014 using SqlPackage.exe?

对着背影说爱祢 提交于 2019-11-26 19:23:13
问题 I've been successfully publishing DACPACs to SQL Server 2008-2012 instances using SqlPackage.exe, as installed by SQL Server Data Tools (and typically found in C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin ). However, in attempting to publish a 2014-targeted DACPAC to a SQL Server 2014 instance using this same SqlPackage.exe, I get the following: *** Could not deploy package. Internal Error. The database platform service with type Microsoft.Data.Tools. Schema.Sql

How to get the next number in a sequence

跟風遠走 提交于 2019-11-26 18:34:34
问题 I have a table like this: +----+-----------+------+-------+--+ | id | Part | Seq | Model | | +----+-----------+------+-------+--+ | 1 | Head | 0 | 3 | | | 2 | Neck | 1 | 3 | | | 3 | Shoulders | 2 | 29 | | | 4 | Shoulders | 2 | 3 | | | 5 | Stomach | 5 | 3 | | +----+-----------+------+-------+--+ How can I insert another record with the next seq after Stomach for Model 3. So here is what the new table suppose to look like: +----+-----------+------+-------+--+ | id | Part | Seq | Model | | +----

How do you group by any time based interval?

故事扮演 提交于 2019-11-26 18:33:49
问题 In SQL SERVER How do you group by any time based interval? To save someone time I have come up with this solution, For me it works very well. You can generate any time base then group by any interval. Great for doing time weighted averages. If someone has a better way of doing this I would love to hear from you. Hours declare @startdate datetime2 declare @enddate datetime2 declare @interval int set @startdate = '2017-01-01 00:00:00' set @enddate = '2017-01-31 00:00:00' set @interval = 4 -