sql-server-2014

Violation of PRIMARY KEY constraint during Merge Replication

家住魔仙堡 提交于 2019-12-12 06:16:03
问题 I have two identical SQL Server 2005 databases (MYDB_Pub, MYDB_Sub1) where the merge replication was configured and it works fine. Recently we upgraded to SQL Server 2014. To test the replication functionality on the new SQL Server I followed the below steps: Backup the MYDB_Pub on the SQL Server 2005. Restore the MYDB_Pub on the SQL Server 2014 with the same name. Restore the same MYDB_Pub on the SQL Server 2014 with name 'MYDB_Sub1'. Configure Merge Replication on a single table 'Country'.

Cannot create a foreign key becaue it is in conflict with itself

旧城冷巷雨未停 提交于 2019-12-12 05:49:20
问题 I am trying to add a Foreignkey to a table and i cannot because i get this error: Msg 547, Level 16, State 0, Line 1 The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_RDATA_COMBO_VALUES_ID_REFERENCES". The conflict occurred in database "MyDatabase", table "dbo.EVA_REFERENCES", column 'ID_REFERENCES'. The error message says that the problem is a conflict with FK_RDATA_COMBO_VALUES_ID_REFERENCES but this is the name of the FK i am trying to create, it does not exist yet.

Unable to connect to SQL Server 2014 using ODBC

点点圈 提交于 2019-12-12 03:28:34
问题 I've set up my first SQL Server 2014 and I am trying to connect to it via ODBC, but I'm getting an error: Microsoft SQL Server Native Client Version 11.00.2100 Running connectivity tests... Attempting connection [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. [Microsoft][SQL Server Native Client 11.0]Login timeout expired [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while

String aggregate using a variable

谁说我不能喝 提交于 2019-12-12 03:27:28
问题 Is is okay to use a variable to concatenate a value from several rows ( as an implicit aggregate function )? It seems to work fine on my machine, but I haven't seen it recommended. declare @v_str varchar(4000) = '' select top 5 @v_str = @v_str + ',' + city_name from city_table order by city_name print @v_str 回答1: From nvarchar concatenation / index / nvarchar(max) inexplicable behavior "The correct behavior for an aggregate concatenation query is undefined." 来源: https://stackoverflow.com

Figure out name of project in SSIS

折月煮酒 提交于 2019-12-12 03:24:46
问题 Is it possible to figure out the name of the project while in SSIS either through a script task, or a variable? I know how to get the PackageName, and the TaskName, but in this case, I need the ProjectName. 回答1: This is, admittedly, holy-set-the-house-on-fire-hacktastic, but it works when run via SSDT... You need a couple of things for this Script Task to work: 1. A variable to access so you can climb to its parent. 2. A reference to Microsoft.SqlServer.DTSRuntimeWrap using System; using

Problems deploying a SSAS cube in Azure

不想你离开。 提交于 2019-12-12 03:05:16
问题 I am having problems deploying a ssas cube in Azure. I have designed a cube in SSDT. The structure of the cube is correct and I can access to the database placed in azure machine from my local laptop.My SSDT project is created in my local laptop. I have tried ti deploy to azure machine and get the following error; "The project could not be deployed to the 'mbitsql.westeurope.cloudapp.azure.com' server because of the following connectivity problems : A connection cannot be made. Ensure that

Creating Financial statements in sql

喜夏-厌秋 提交于 2019-12-12 02:55:36
问题 Consider the following Tables: Now before I continue I should preface this by stating that I'm not an accountant (which if you happen to be an accountant reading this probably shows!!) I have an invoices table and a related InvoicePayments table and a separate Contacts statements table. My Intention is to provide the end user with the ability to create numbered statements for clients that in theory , at least, could be called back at any time in the future. Logically It should be possible to

Insert into SQlite DB from SQL Server 2014

风格不统一 提交于 2019-12-12 02:53:18
问题 I've successfully created a linked server between SQL Server 2014 (x64) and a SQLite database via ODBC. I can select from the SQLite database with no problem. select * from openquery(mp_test, 'select test1 from test2') When I try to insert a record into to the database I get the following error : OLE DB provider "MSDASQL" for linked server "mp_test" returned message "unable to open database file (14)". Msg 7343, Level 16, State 2, Line 4 The OLE DB provider "MSDASQL" for linked server "mp

Generation of ROWID column in triggers even when its generation is switched off in SSMA v 6.0

房东的猫 提交于 2019-12-12 02:46:13
问题 I used SSMA v6.0 for migrating my Oracle database to SQL Server 2014. I turned off the generation of ROWID column and as expected it did not generate any additional ROWID column in any of my tables after conversion, but surprisingly it DID generate all the triggers associated with their respective tables with ROWID column infused in triggers like following: USE [DBName] GO /****** Object: Trigger [dbo].[InsteadOfInsertOn$ROLEPERMISSIONS] Script Date: 3/11/2015 10:58:46 AM ******/ SET ANSI

Splitting Strings with Regular Terms to Columns

假装没事ソ 提交于 2019-12-12 02:38:28
问题 I'm having trouble with the following query. I need to split a string values into new columns based of LineFeeds. The data is presented as |NUMBER |Answer |RN110455 |very satisfied very satisfied very satisfied very satisfied very satisfied | I came across the following section of code however i keep getting the following error message Msg 240, Level 16, State 1, Line 1 Types don't match between the anchor and the recursive part in column "SplitValue" of recursive query "SplitValues". I'm