Questions tagged [sql-server]

Microsoft SQL Server is a relational database management system (RDBMS). Use this tag for all SQL Server editions including Compact, Express, Azure, Fast-track, APS (formerly PDW) and Azure SQL DW. Do not use this tag for other types of DBMS (MySQL, PostgreSQL, Oracle etc.). Do not use this tag for ...

0
votes
0answers
4 views

Full-text search doesn't return the row containing the searched keyword

I'm experiencing a problem with my full-text search on a client's database. The issue happens only on the client's database, and I cannot reproduce it locally, so I think it should be related to the ...
0
votes
0answers
6 views

using temporary table in Compare 2 tables stored procedure in SQL

I'm trying to create a stored procedure that compares 2 tables and makes them identical, and I did the following: create Procedure SESUS.Compare2Tables(@Table1 as NVarchar(255),@Table2 as ...
0
votes
0answers
5 views

Getting error while trying to connect with sql server analysis service thru ADOMD

Error: "Either the user, 'myName\user', does not have access to the 'Sample' database, or the database does not exist."I have the Sample database in sql serve and also sample cube in the Analysis ...
0
votes
0answers
11 views

SQL Question: When to use GROUP BY clause, and when to use DISTINCT? [duplicate]

SQL: GROUP BY vs DISTINCT --What's the difference between GROUP BY and DISTINCT clause? In certain situations, the output is the same. Sometimes,I get errors like "not a GROUP BY expression" when I ...
0
votes
1answer
9 views

MS SQL Query with logic,outer apply

I need help with the following query. I am trying to subtract the Deduct amount per acc_No from the amount column. The running amount column should reduce with every amount for that accountNo. After ...
1
vote
0answers
17 views

MS SQL Server trying to keep non printable characters in string format function

I'm using MS SQL Server 2008 R2 and SSMS version 17.6. I'm trying to write a function that I can pass a string and a "keep" command to that will be used to generate a regular expression to specify ...
0
votes
0answers
13 views

Some 2016 MS SQL Server fields fail to attach to Access Database

I am attaching from MS Access 2017 to the new World Wide importers sample database for MS SQL Server, if I attach the Cities table I only get 8 the 13 fields in the table to show up in Access. The ...
0
votes
1answer
19 views

Trigger sum of two coluomns into 3rd SQL

I am trying to set a trigger in Microsoft Server Manager where a 3rd gets pouplated by a triggerEg. I have a table that contains Column 1: AmountColumn 2: AdminFeeColumb 3: TotalAmountI ...
-1
votes
0answers
41 views

Validate a condition inside string in SQL Server [on hold]

I need to validate a condition dynamically generated to a string and validate that string inside IF clause to select a particular row(s).Consider I have a table like thiscreate table #temp(...
0
votes
2answers
26 views

How to join two tables on one similar column and any remainder on another column

So I have:View_1ID | col1 | col2 | col3---+------+------+-----1 | a200 | null | 52 | null | 300 | 6View_2:ID | colA | colB | colC---+------+------+-----1 | a200 | 400 | 402 | a500 | ...
-1
votes
1answer
21 views

Update sql records not reflecting solr 7 [on hold]

I have import the sql server db into solr indexing, but when I was updating any sql server table records it is not reflecting in solr index. I am new to solr, any help on this?
5
votes
4answers
38 views

Make update using join

I'm trying to make an update, and here is my queryUPDATE t1SET DOY=isnull(Sum(t2.Price),0)- isnull(Sum(t2.RestOfPrice),0) FROM customermaster t1 INNER JOIN History t2 ON t1.CustomerID=t2....
0
votes
1answer
16 views

Sql problems with combinations of multiple characteristics to result in a number to index

Lets say i have a simple table:Laptops Id (int autoincrement, Name nvarchar(50) 2gb Ram ( bit ),4gb Ram ( bit ),250 hdd ( bit )500 hdd ( bit )So we have a table for laptops and it has just ...
0
votes
2answers
16 views

How to add sequence row numbers based on column values SQL Server

I have the following table in SQL Server;DesiredRowNo. Customer Date NID SID Contacts AG1 AAA 04/09/2018 15357989260016600 100743 1 11 ...
0
votes
0answers
15 views

How to create a copy of table that is in-memory optimized?

I have a table T1 that I created in-memory using the in-memory procedure in SQL Server 2016. Now, I want to create a copy of the same table T1 into another table T2 which should have the same schema i....
0
votes
0answers
6 views

db2oledb Performance single vs multi threaded

Having an issue with DB2OLEDB performance, using sql server 2017 performing a data load from IBM i 7.3 .The client is a VMware VM, network settings seem ok and have been tweaked up to the best of my ...
1
vote
2answers
21 views

Find SQL Server 2008 database connections and how to kill them

How to find current SQL Server database connections and how can I know which connection is connecting with which database, as I have multiple databases on my SQL Server. And how can I kill any one ...
0
votes
2answers
30 views

SQL Server query that allows me to show an overview of books within bookcases

I'm trying to get my program to show an overview of all the bookcases in my database with the associated bookshelves / compartments and the books within those shelves or compartments. I'm using ...
0
votes
0answers
20 views

How to get SQL Server to read from files?

As the title suggest, I am trying to read a csv file and import it to my table in my database. I get this error message: Msg 4861, Level 16, State 1, Line 1Cannot bulk load because the file "C:\...
0
votes
3answers
18 views

How to select rows from table1 which are not in table2 according to FieldX in table2 - but relevant for each different value of Field2 in table 2?

This is for MS SQL Server 2016.I have Table1 which contains an ID and a Name column (of layouts to populate a html dropdown box).This dropdown (stores its ID value into Field1 of table2) should ...
0
votes
0answers
12 views

After installing My SQL in machine, In App config of WPF application at run time LocalMySqlServer connection is added

I am using WPF application connected to SQL Server Local DB using entity framework. During runtime, I am changing connection string value in app.config and saving it. Everything was working before ...
-1
votes
1answer
26 views

Inserting more DATA then it should and bugging. C# .net

Well, I've created a program that is retrieving data from one database and inserting the data into another database. (Because one of my applications uses MSSQL database and my website is using MySQL ...
0
votes
1answer
16 views

SQL Server XML query() - Missing parent node or namespace

We need to query concatenated tags from XML records stored in a SQL Server database by querying sub sections of XML documents. The only tricky issue is that some of our records are missing the parent ...
0
votes
0answers
21 views

How to read text file into @table variable using bcp command

I have below text file having different words inside it. Please refer the link below.My aim is to insert only 4 character words from the text file into a table variable which is @temp, using bcp ...
2
votes
3answers
46 views

Use SQL subquery to count number of rows in table and pass/fail java test based on the result

Below are 2 of my SQL Server tables.TaddressaddressId | addressName |2 | testAddress |TlinklinkId | clientId | addressId |1 | 4 | 2 |I am trying to write a java ...
0
votes
1answer
22 views

SQL Sub Query returning no value, but junit test is still passing

Below is a sub-query that I am trying to use in a junit test.The below code is passing, when the test should be failing.The value I am using (this.Id) does not exist in the tlink, so the sub-query ...
0
votes
3answers
22 views

Conversion error while using ',' in STUFF - SQL

I have the below query:select STUFF((SELECT ',' + rr1._cv_id FROM #reportrows rr1 WHERE rr1._c_id=rr._c_id FOR XML PATH('')),1, 1,null)FROM #reportrows rrIn this query, _cv_id is integer type. ...
0
votes
1answer
21 views

Hosting WCF service in Windows service

There is a client in the form of an ASP.NET MVC application, there is a WCF service, requests to the WCF service are sent from the client, the service itself manipulates database data through the ...
-4
votes
1answer
24 views

I want use LAG function for running total in another column, but it does not work in SQL Server 2012

I want use the LAG function to determine running total in another column, but it does not work in SQL Server 2012.
2
votes
1answer
16 views

prevent rows affected entry in file export from ssms

How can I prevent entries like this:(123456 rows affected)in a text file export at the end of the file. Do not seem to find option. Thanks!

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,