Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [sql-server-2012]

SQL Server 2012 (major build version 11.00.xxxx). Please also tag sql-server.

Filter by
Sorted by
Tagged with
0 votes
1 answer
69 views

Replicate Data from 2008R2 to 2012 for Reporting Purposes [closed]

We are planning to replicate data from 2008R2 to 2012 SQL Server every 5 minutes (if possible). 2012 server will be used for reporting purposes only and 2008r2 will remain our primary sever/database ...
Preety's user avatar
  • 1
1 vote
1 answer
30 views

Recovered database files, need to be rebuilt using a new SQL server instance [closed]

Need some help in recreating a recovered database. We recently recovered an old disk drive that has the following folders on it: Program Files\Microsoft SQL Server\MSSQL... Program Files(x86)\...
Patrick's user avatar
  • 11
0 votes
1 answer
168 views

Why did queries become slower after upgrading SQL Server 2012 to 2022?

I'm in the process of upgrading my current set of databases from SQL Server 2012 to 2022. I've ensured I've matched my resources/specs to ensure both Servers match. I am facing a huge performance ...
Gautam's user avatar
  • 21
0 votes
0 answers
19 views

Problem with SQL Server Merge Replication 2017

I have multiple replications: merge replications that sync the data on both Headoffice and Stores but from past two days I am getting these error messages and replication doesn't complete successfully ...
Haider Mumtaz Khan's user avatar
0 votes
0 answers
31 views

What is the easiest way to do filtered replication to another SQL Server 2012 database with the exact same schema?

I need to start a filtered replication of a SQL Server 2012 database for a company subsidiary that contains only a subset of records related to that subsidiary (using only row filters). This is in ...
GratefulDisciple's user avatar
0 votes
0 answers
47 views

Elapsed time of the query is abnormal in SQL server

I am trying to find the elapsed time of the query in SQLSERVER using the view, sys.dm_exec_requests. For some queries the elapsed time is more than an hour, most of the queries coming up when using ...
dheepakraj govindarajan's user avatar
1 vote
2 answers
215 views

How can I save the job result to a file?

I created a job in SQL Server. This job runs the following statement at regular intervals: Select NationalIDNumber from HumanResources.Employee where BusinessEntityID = '1' I want to save the result ...
Merve's user avatar
  • 55
0 votes
2 answers
156 views

sqlserver memory problems,How to check the memory usage

I want to know whether sqlserver has a memory bottleneck, how bad the free memory needs to be Can you see which statements use more memory thank you Read some information do not understand, want to ...
chen's user avatar
  • 1
0 votes
0 answers
76 views

Sql server database restoring from backup, sql users without login

After restoring a database from another SQL server, set database comes with database users without login. Do these users have any actual functionality or they are practically dead users? I've looked ...
Peter's user avatar
  • 79
0 votes
1 answer
36 views

Get Point from Another Table based on Category and Value Range

I am trying to get a column which specify the points by comparing the value from original table to min and max value from another table. I have a main table, which consists of few columns of values ...
John Marston's user avatar
-3 votes
1 answer
21 views

In what format do I need Insert 3 table sql? [closed]

In what format do I need Insert 3 table sql? animals(`AnimalsID`, `Animals`, `IUCN_Red_List`, `TypesID`, `BloodedID`) types(TypesID,Types) blooded(BloodedID,Blooded)
0 votes
0 answers
46 views

Convert a list-of-IDs column into a junction table [duplicate]

I have a table, Office, with a column that contains lists of ids representing many-to-many relationships: TABLE Office { OfficeId int IDENTITY(1,1) NOT NULL, CubeIds NVARCHAR(MAX) NULL, --values ...
nivomi's user avatar
  • 11
0 votes
1 answer
264 views

Deleting rows using count after reaching certain threshold MS Sql server 2012

I'm trying to make a loop query for Sql agent which checks users data and if the criteria is met reward is sent, after that it would delete the records from the table restarting the loop. The issue is ...
Peter's user avatar
  • 79
0 votes
0 answers
43 views

Linked server view Select query doesn't execute on production server

I've build one view. I can run sys.databases from the linked server. However, when I tried to execute the following view. It is not retrieving any data from the linked server. USE [SSISDB] GO /****** ...
James's user avatar
  • 1
0 votes
0 answers
240 views

Removing/disabling a single SQL instance on a failover cluster?

I need to retire a single SQL instance on a (classic) failover cluster while leaving other SQL instances running. SQL version is 2012 in case that matters, but this could come up for other versions in ...
BradC's user avatar
  • 9,964
0 votes
0 answers
236 views

How to delete specific table partition in SQL Server?

I am able to switch out and IN and also truncate partition.But I am not able to delete specific partition file in SQL Server. Suppose there is total 4 partition in order table, I don't need partition ...
Sheikh Wasiu Al Hasib's user avatar
0 votes
1 answer
290 views

SQL Server 2012 how to audit user's access to database tables and views?

We have a read-only login account that unfortunately was created without proper planning, and now users throughout the company are using this login to access tables and views in our database. The ...
Fandango68's user avatar
1 vote
0 answers
20 views

New WS install win11 Pro and O365: Connection to DB fails due to change in ownership from SQL to Azure. Is it a Permissions issue?

Security System: Unable to connect to Local Database Template. Error Message: The remote computer that you are trying to connect to requires Network Level Authentication (NLA), but your Windows domain ...
Dragonfly's user avatar
0 votes
0 answers
47 views

SQL query to find device list in specific AD group

I have AD Group which has user ID list but I need device list so looking for the SQL code which can convert this AD group and give me the list of device used by the users present in specific AD group.
Manjunath Tumkur's user avatar
0 votes
0 answers
89 views

Counting Rows From a Value in a SQL text box - please please can anyone help?

I just can't find an example of this anywhere and hoping someone can help. I have a query which returns a list of care services and other fields based on the care service table values and calculated ...
Paula Morrison's user avatar
0 votes
0 answers
119 views

Server is Distributor, but Can't set database for replication

I Have a server that is already a Distributor. This happened in the past. Nobody nowadays knows why it is configured as a distributor, there's not even the "distributor" database. We don't ...
Racer SQL's user avatar
  • 7,386
0 votes
2 answers
85 views

Specify constraints during table creation by select into

Can we explicitly specify "not null" and "primary key" constraints for a column of table that is dynamically created through execution of "select into"? Something like ...
F.I.V's user avatar
  • 101
0 votes
0 answers
138 views

Query update issue, it updates only the first match sqlserver2012

I'm trying to transfer part of data "ID" from table1 to table2, you may ask why doesn't table2 have the all the data. Answer is simple the data is generated by a program which doesn't ...
Peter's user avatar
  • 79
1 vote
1 answer
69 views

sql server - How to prevent backup db file to load on any SQL server instance

I am trying to find if there is any way we can restrict loading of a .bak file to be loaded on SQL server instance. Example: User named "Zack" created and is dba of a database named "...
Paras P.'s user avatar
-3 votes
1 answer
42 views

Build logic on Reversal record flag for a particular table

I have Reversal flag (RF) values as ' ' , 'R' , 'D' which make the records distinct. I am selecting many columns from this table as it is a primary table and taking sum of few columns as well. There ...
Moulshree Suhas's user avatar
-1 votes
1 answer
318 views

What causes a stored procedure to have multiple plans in SQL Server?

We have noticed that many of our stored procedures, which involve the use of local variables, have multiple plans associated with them. By which I mean the same query in the stored procedure has ...
lifeisajourney's user avatar
2 votes
2 answers
1k views

How can I optimize the stored procedure and reduce table scans?

I have a stored procedure which identifies any changes in candidate information from the last SSIS job run. Then it proceeds to save the changes in a sync table. CREATE PROCEDURE [dbo].[...
Rishav Ghosh's user avatar
2 votes
1 answer
946 views

SQL server memory component CACHESTORE_SQLCP is way more than the plan cache

In our production server (SQL server 2012) when I checked the memory component CACHESTORE_SQLCP is consuming the much more than the total size of the cached plans. Is there any reason for it and how ...
Peter's user avatar
  • 21
1 vote
2 answers
5k views

Best Practices to archive or remove old data in SQL Server 2012

Our application has numerous tables that contain outdated data, some dating as far back as 2010. Despite having indexes defined on these tables, many of the index seeks retrieve old records, which is ...
JoeCharles's user avatar
2 votes
2 answers
287 views

SQL Server 2012 Standard Edition rebuild index

We use SQL Server 2012 Standard Edition. Is there a way to rebuild the index, trying not to cause data table locking, and reducing the impact on performance? When we rebuild the index, it causes the ...
user avatar
-1 votes
1 answer
94 views

Creating a hierarchy from text

I'm trying to create a hierarchy from a text field I have in my table. Visually it is relatively easy to see who is parent and child. For example: (see a screenshot of the table results) 1M -----1M5 --...
Olivier's user avatar
5 votes
2 answers
528 views

Varbinary update attempt

Is it possible to adapt this into update query which has to seek a free sequence of 3 bytes or (0x000000) and replace it with a new sequence if the data is split like this every 3 bytes? The issue is ...
Peter's user avatar
  • 79
1 vote
1 answer
243 views

Filtering in Queries using Linked Servers in SQL Server 2012

My colleague told me that any query that uses a linked server first transfers the data from the remote server to the server the query is running on and then applies filters. For example, if I have the ...
RobMartin's user avatar
  • 149
1 vote
3 answers
221 views

Alter a scalar UDF that is used in a check constraint in SQL Server 2012

I have a check constraint on a column that uses a scalar UDF. I have a requirement where I need to make changes to the UDF. Based on what I know, I need to drop the constraint, make changes to the UDF,...
RobMartin's user avatar
  • 149
7 votes
1 answer
3k views

Does With(NoLock) help with query performance?

Most of the select statements in our stored procedures use WITH(NOLOCK) and I was told by my co-workers that they use it to improve performance. Now, I know that this hint helps with locking but does ...
RobMartin's user avatar
  • 149
0 votes
0 answers
65 views

Improve query performance in SQL Server 2012

I have a table with 150 million rows with a non-clustered index on userId. I have to write a query to filter on userId and return all the rows if the productType is not SIG and return only rows ...
lifeisajourney's user avatar
0 votes
1 answer
730 views

Modify an existing non clustered index or create a new index in SQL Server 2012

I have a table with 150 million records and 8 indexes. One of the indexes is on userId. A lot of the current queries I have filter on userId and therefore this index works perfectly. For one of the ...
lifeisajourney's user avatar
5 votes
1 answer
1k views

How to Retrieve (Debit, Credit and Balance) from daily Transaction tables (Customer, Invoice, Payment) Full and Date Range)

There are 3 Tables Customer, Invoice and Payment. Customer Link with Invoice and Payment table. Question is, need to retrieve statement wise Debit, Credit and Balance. main issue is opening balance ...
HRSO1's user avatar
  • 63
0 votes
1 answer
50 views

Re-write a query in SQL Server 2012

I have 3 tables: order: contains the list of all the orders; product: contains the list of all products for each order; productVersion: contains multiple versions for each product. I want to write a ...
lifeisajourney's user avatar
0 votes
1 answer
657 views

Cannot open backup device 'D:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Backup\‪D:\DB_backup\uni.bak'

I have 2 database backup files casa.bak (25 GB) and uni.bak (176 GB) in the same folder. I'm using the same script to restore the database for both files previously both were working successfully. Now ...
Muzammal arshad's user avatar
0 votes
1 answer
1k views

Convert an Int column to BigInt in a stored procedure in SQL Server 2012

We have a stored procedure that uses SUM on an Int column in the SELECT statement. We have a few cases where for one of the parameter values, the SUM(integer column) exceeds the Int range and ...
lifeisajourney's user avatar
2 votes
1 answer
142 views

Forwarding SQL Server Error Logs to Another Server

I wasn't sure where to post this question. If this is not the right place, kindly point me in the right direction. We have SQL Server 2012 and 2014 on-prem. My intention was to forward the error logs ...
Nina G's user avatar
  • 123
2 votes
1 answer
567 views

Return the inserted timestamp after inserting a record [duplicate]

I feel like this should be an easy problem. All I want to do is return the timestamp of the entry that was just inserted, but in the same call. All I can find in my searching is about returning the ...
dmikester1's user avatar
0 votes
0 answers
110 views

How to get exact SQL output for below mention input

Input table data : itemid MfrCatalog MfrNameNorm RawDescription UOM Conv noun Modifier 420754 G322H ETHICON, INC SUT PLAIN 3/0 27IN EA 1 SUTURE ABSORBABLE 420754 G322H ETHICON, INC SUT PLAIN 3/0 ...
karthik sanapala's user avatar
0 votes
1 answer
427 views

Performance benefit of dividing a frequently used stored procedure into multiple stored procedures in SQL Server

I have a stored procedure usp_appdata that is used by our application loading screen as well as a lot of other places in the application. This SP is very resource intensive and returns a lot of data. ...
lifeisajourney's user avatar
2 votes
1 answer
4k views

SUM total amount of each column from two tables SQL Server

By joining two tables, the total amount obtained from Crowdfund_Users is incorrect. Sum of Amount in table Crowdfund_Users increased by an additional 60000 from ID 5. table Crowdfund_Users (ID is ...
Mohammad Bastan's user avatar
0 votes
1 answer
178 views

In SQL 2012 - Export Data-tire Application Error: Database source is not a supported version of SQL Server : . (Microsoft.SqlServer.Dac)

I have asked to move Database from SQL server 2012 to azure SQL During the export data-tire Application Its shows Error : Database source is not a supported version of SQL Server (Microsoft.SqlServer....
Srinivasan Raja's user avatar
0 votes
1 answer
2k views

Updates to the same table in concurrent sessions in SQL Server

Consider the following scenario: 10,000 users try to create a profile on our application concurrently at the same time and the data has to be inserted into the table, userProfile. The SP that handles ...
lifeisajourney's user avatar
5 votes
3 answers
592 views

Is there a way to sort by an alphanumeric column? [duplicate]

I have a table units unitname unit 1 unit 2b unit 2c unit 2a unit 10 unit 3a unit 3c unit 11 I want to sort the same as unitname unit 1 unit 2a unit 2b unit 2c unit 3a unit 3c unit ...
Rishav Ghosh's user avatar
2 votes
0 answers
232 views

Setting up Database Integrity Checks

I'm relatively new to SQL and, unfortunately, am definitely not at the level of a DBA - However, it's become my job to look into some SQL issues... There's a Database Integrity Check set to run for ...
Yeldur's user avatar
  • 21

1
2 3 4 5
91