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 issues on software and mobile development, unless it is directly related to the database.

0
votes
0answers
3 views

Implementing temporal tables for dimensions to track changes

I am working on a star schema and I want to track the history of data for some dimensions and specifically for some columns. Is it possible to work with temporal tables as an other alternative ?If yes,...
0
votes
0answers
17 views

I created one Stored procedure getting Begin syntax error

I created the One stored procedure. Below is the query. I am getting Begin syntax error. CREATE PROCEDURE Upload_Address @COM_Addresstbl AS BEGIN SET NOCOUNT ON; INSERT INTO ...
0
votes
0answers
10 views

A large update statement on Sql server

I have to do an update statement on a table with a high number of records for 3 years, each month has a million of records I have tried to use the batching script but it takes a long time and i ...
0
votes
0answers
15 views

Conversion failed when converting the nvarchar value to data type int during mass insert

I have a simple example database table called test, where the column name is a nvarchar, and the column value is a decimal,9,2 I'm trying to understand why the following SQL statement fails: insert ...
0
votes
0answers
5 views

Sharepoint 2016 :two types of authentication

t is possible to configure two types of authentication sharepoint ? For users in LAN via Active direvtory and for external users (from internet) via sql server database ? Thanks
-1
votes
1answer
25 views

Sql Server conversion problem? From String to DateTime? The problem is that i don't have String fields

I would like to Select a specific date but mySql says that there is a conversion problem.. Here is my structure Table AssAttestati ID int Allow Nulls (No), matricola varchar(MAX) Allow Nulls (YES),...
0
votes
0answers
9 views

How to read XML file contains Multiple Node in SQL Server

How to read XML having multiple nodes into temporary table in SQL Server. I had done below things but getting wrong output Below is the XML String, set @DocumentControlXML = '<Awbolds> <...
0
votes
0answers
22 views

Add more table to existing VIEW

I have VIEW which contains around 2000 tables. create view AllTables AS select * from t1 union all ... ... select * from t2000 Requirement: I want to add one more table to the existing ...
0
votes
2answers
46 views

How to select MAX date of each month in database

I'm trying to extract max date of each month for a later join to extract in results the records/rows that match (inner join) this max date in Transact-SQL for SQL Server Main problem is that in the ...
0
votes
1answer
36 views

Calling Stored Procedure in Entity Framework Core with parameters not start with @ or #

I'm writing a data layer based on ef-core 2.2, which need to be compatible with SqlServer and Oracle. When calling a SP with complex data format (like binary) or output parameters, a SqlParameter ...
0
votes
4answers
35 views

MS SQL Querying Tables Where Data may or may not exist

Have not come across an exact use-case for what I'm trying to achieve on Stackoverflow so will explain it in the hopes someone can assist. I have two tables, one contains a master activity list and ...
0
votes
1answer
32 views

Update SQL Server table based on values in a column

I have 11 tables in my SQL Server database in which have the same columns, 10 are sub tables and 1 is the main table where the data in 10 tables will be merged. The 10 tables are constantly updating ...
2
votes
1answer
33 views

SSIS SQL Executation Task error: unable to run some sql queries

I'm working to make some fact tables (taking some data from some resources, doing some transformations and putting them in a table). My main dilemma is that I can't run any SQL query other than select,...
2
votes
1answer
47 views

Is there a way to auto-fill dates in SQL

My first problem is that I have been adding dates into the database by hand-creating them and it is labor-intensive. I am looking for a way to automatically add dates like you can do in Excel. I have ...
1
vote
1answer
40 views

Which columns to index

For the following query to run quickly which columns I should add to an index? select max(id) from tb group by BranchId,ArticleID having count(*)>1
1
vote
1answer
42 views

How to perform self join on a large table

I have a very large table (~70 million rows) in which the id column is derived from another table. The ID has been wrongly assigned. 2 different people with different first names have been assigned ...
0
votes
1answer
21 views

SQL Server : order by time portion of Datetime2 timestamp

I have a table of orders with a datetime2(7) column O_CreatedOn and I would like to order this recordset by the time portion only of the O_CreatedOn column. The reason for this is that I need to ...
0
votes
0answers
17 views

I am not getting sqllocaldb i after installing 2016

mssqllocaldb is not working , below is the error:
0
votes
0answers
18 views

Is it safe to delete old transaction logs after it created a new ones?

I am running SQL Server 2014, my transaction log's size become very big size and it causing performance degradation. I have created a new transaction log, and now the performance become normal. My ...
-1
votes
0answers
26 views

can someone help me make this program portable so i can use it independently on another computer [on hold]

im a chemical bioqueist.. i have this program on my workstation..it is independent..only needs that PC to work.. i tried copying it to use it on another PC, but it wont work..keeps asking me about ...
-3
votes
0answers
28 views

Global Connection String for Local Database

I'm creating an application for work that uses a local database (SQL Server). I've created the database, but I have noticed that the connection string contains the full path to my solution with the ...
0
votes
0answers
12 views

I've made a jasper report and now I need to add a print button in my java application to save it

I've created a Jasper Report but I don't know how to add a button in my Java Swing application to save this report? That's what I've already tried but it's not working: Class.forName(...
-1
votes
1answer
49 views

How to split months between a start date and end date from a table in SQL

I want to set up a stored procedure in SQL Server which creates month by month currency exchange rates based on a start and end date per currency. The following is the format of the table I want to ...
0
votes
1answer
27 views

Inserting data into multiple tables(f_k linked together) through view

im trying to insert values through view into two tables which have f_k Borrower_Id. But getting an error 'String or binary data would be truncated'. But same values can get inerted directly witout ...
1
vote
1answer
40 views

How can I apply converting within my stored procedure

I have seen this resolved on here different time however I'm unsure how to apply this conversion in this case. Please see error messages and code below: The conversion of a varchar data type to a ...
0
votes
0answers
55 views

Performance issue with SQL Query

I am pulling data from two tables-Forecast and Orders to compute sales forecast accuracy. Steps I am taking: Identifying all exhaustive combinations of product-region-demand month b/w both data ...
0
votes
0answers
16 views

Do two batches with the same queries have the same sql handle, although they are executed via separate JDBC connections?

I have a Java program with multiple threads, each executing the same parametrized SQL queries through JDBC connections. Each thread has its own JDBC connection. I want to retrieve performance data ...
1
vote
1answer
17 views

Custom dlls not found in SQL Server 2016 agent job

I have an ssis package in SQL Server 2016 which is using a custom dll that I have added in the gac. SSIS package works fine in visual studio but when I deploy it on SQL Server, it can not find the dll ...
0
votes
0answers
17 views

Two Prod SSRS server. One has a memory usage of 2GB, the other has about 8GB memory

Why is that so different? How can I check the memory usage in SSRS?
0
votes
2answers
45 views

Custom Order By in SQL

I've written a query for getting me the total sum of a column id for every hour. The hour value is calculated from a date field in the table called, created_at. I have used an if case for better ...
0
votes
2answers
31 views

Consider whole result on order by

I currently have a table with two columns OriginalName and SocialName I am trying to order by these two using order by, but the problem is I want the two columns to be considered on the order by but ...
0
votes
1answer
30 views

Join a MS SQL Server WITH statement into a Select statement

I received this answer to this question MS SQL Server Last User Logged in Multiple Clients with Multiple Users and it works great. ;with cte as ( select client, myuser, lastlogin, ...
-1
votes
2answers
35 views

How does a SQL query transform the data?

I came across this question and was trying to understand how the answer given there is actually transforming the data. Input Table +---------+-------+---------------+ | user_id | State | ...
0
votes
1answer
33 views

T-SQL search through all columns for jquery autocomplete textbox

I have been trying to design a query to search for specific text through all columns but it is not working as required. Here is my query: create table #tblTempAddress (locationId int identity(1,1) ...
0
votes
0answers
56 views

Identity function not working in SQL Server?

I have a table Emp with columns as EID Name Salary City I have added Identity(1,2) to my column EID. I was expecting an output of 1,3,5,7 .... for my auto incremented EID column. ...
0
votes
2answers
52 views

SQL Server Case Update

I have the following query and trying to see if the way its written i can have best possible performance UPDATE UserSession SET PauseSpan = CASE State WHEN 9 THEN PauseSpan + @SPAN ELSE ...
0
votes
1answer
20 views

How can I create a contained user on an Azure SQL database using C#?

I need to create a contained user for my Azure SQL database using C#. I have the following code already for creating the database: // Login to Azure var credentials = UserTokenProvider....
0
votes
0answers
24 views

Republishing data in merge replication SQL Server

I have 3 servers srv1, srv2 and srv3. srv1 is distributer and publisher and srv2 also is distributer and publisher and srv3 subscriber of srv2. I create merge replication and data successfully ...
0
votes
1answer
18 views

What happens when we add new records to a SQL table while the Azure Search Indexer is running

Say for example that I've got an Indexer running every day and it pulls down 2 million records from the SQL table every time it gets run. It takes around 30 min to finish off. During that time we keep ...
0
votes
0answers
19 views

Retrieve values from table cells that were generated dynamically

I am working on an appointment scheduler using asp. Bet and sql database. I have generated html table cells dynamically using asp.net code and data from sql server database. I am trying to retrieve ...
-7
votes
0answers
31 views

500 Internal Server error trying to connect database after deployment in IIS [on hold]

Deployed an Application on ISS with Angular 7(Client side) and .net core 2.2 api at backend. I have used .net identity for login and when I try to login from i get Access to XMLHttpRequest at '...
0
votes
2answers
57 views

Stored procedure to check if table exists

I haven't being programming in a while and I am stuck on a problem. I am building a small application that you can select one of the 32 counties of Ireland from. In my database called ...
0
votes
0answers
16 views

SQL Server Management Studio retrieving Messages instead of ResultSet after sql script execution using python

I want to take backup of the database and need a confirmation that it has been successfully executed. i want the SQL Server Management Studio 'Messsages' to be printed through my python script. This ...
1
vote
1answer
52 views

How can i write select with join using cursor

I have the following code: SELECT Przedmiot, COUNT(Ocena) 'wystawiono n ocen' FROM Przedmiot JOIN ocena ON przedmiot.IdPrzedmiot = Ocena.IdPrzedmiot GROUP BY Przedmiot How can I run ...
1
vote
1answer
43 views

VARCHAR parameter in INNER JOIN isn't working while INT parameter of the same table is working [on hold]

I have three tables: Author, Author Catalog, Products. Author can have multiply books as books can have multiply authors, so I splitted the relation between Author and Production on two «1 to many». ...
-2
votes
1answer
17 views

While Creating SSIS Catalog ;I get fail about code PAGE

I can not create SSIS catalog. When I try to this, Iget this message: The code page 65001 is not supported by the server. (Microsoft SQL Server, Error: 2775) I searched but I could not find any ...
0
votes
0answers
27 views

Retrieve data using Node.js from SQL Server and show it with Angular.js

I have retrieved some data from database 'Testdb' from SQL Server using nodejs. I want to show it from another file in my web-page named "canvasangular.js". Currently I am showing those type of data ...
0
votes
0answers
20 views

Docker-compose override not overriding connection string

I have an ASP.NET web app which connects to a SQL database. In appsettings.Development.json the connection string is defined as "ConnectionStrings": { "DefaultConnection": "Server=(localdb)\\...
0
votes
1answer
38 views

How to get sequence start value from another table's max value

I'm trying to insert a bunch of values in a table but it doesn't have IDENTITY column, and I need to insert a unique value in that field. And the sequential number should be start based on the ...
1
vote
1answer
30 views

Fill color based on values from other data set in SSRS

I'm trying to fill colors based on table records. From SQL Server AdventureWorks2017 database: select * from [HumanResources].[Department] I have two dataset: 1st : select * ...