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
-1
votes
1answer
22 views

Delete Data in Two Tables Based on Date in One Table

I am trying to delete data in a table where a date field value is older than 30 days and also delete related records in a second table that has no date field based on a matching key column in both ...
0
votes
0answers
41 views

Executing more than one command from a stored procedure [closed]

I'm trying to run this stored procedure, but it only runs the first command, although I'm able to run the script outside the stored procedure without any problems exec GetStoreTransfers '010203','...
3
votes
2answers
330 views

Upgrading from SQL Server 2012 SP1 to SQL Server 2019

I'm upgrading an internal database at work, and we are creating a new VM to host it. I can't see an option to generate a script to export the SQL Server 2012 SP1 database for server version SQL ...
2
votes
1answer
64 views

Date time cast preferred method

What would be the preferred method for speed and less database stress using a between or less than? SELECT LogId FROM [Master].[dbo].log mlog WHERE cast(LogDate as Date) BETWEEN '2019-01-01' AND '...
0
votes
1answer
43 views

How can a field with multiple values be used with SQL Server?

For example, I have a field in MongoDB like this: "SignedDocs" : [ { "_id" : "blablabla" "title": " bla bla bla" }, { "_id" : "blablabla2" "title": " bla bla bla2"...
0
votes
1answer
35 views

Patching SQL server

I am having the original release of the 2012 server having bulid number 11.0.2100.60. I have a question like can we install the current patches on the existing version or do we need to do it in stages....
2
votes
1answer
67 views

Breaking point for SQL server database based on connections from app to SQL server [closed]

We have been asked to confirm on some capacity test for one of our SQL server. Application team is building their new app servers with better infrastructure to connect to SQL server. Currently with ...
0
votes
2answers
87 views

SELECT last date from multiples values

I have this table: I want to make a query that allows me to show the last value in fecha_gestion grouped by NitSec. It would be something like this: SELECT id_log, fecha_gestion, nitsec FROM table ...
0
votes
1answer
62 views

Differential backup same size as of Full Backup

I have a SQL Server database of almost 2 TB size, it has tables with image datatypes. Now the size of differential backups are same as that of full backup. Does image datatype makes any difference to ...
0
votes
1answer
25 views

Differential Backup of A Table In Sql Server

I will transfer the datas of a two different table to a database in reporting server Daily but i don't want to do it manually and also don't want to transfer all the datas to that databases everyday. ...
0
votes
1answer
43 views

Offline index rebuild - does it also create a whole new copy of the index?

As I know, while online index is rebuilding, SQL Server virtually creates an index and then at the end it swaps the existing old index with the new created one and then finally drops the old index. ...
0
votes
0answers
47 views

Oracle Linked Server Issue

I am having a Linked Server from SQL Server 2012 to Oracle 11G. TNSPing and Test Connection to the Linked Server is working fine. But when using the Linked Server to run a stored procedure or when ...
1
vote
1answer
61 views

What is difference between Physical Reads and Read-Ahead Reads?

I am trying to understand what is read-ahead reads but it seems a bit complicated to me. I did some searched on the web and got the followings: from Microsoft Official Documentation : Read-ahead ...
-1
votes
1answer
32 views

Help required in query to show user specific jobs in which he is not applied or posted

this my schema of jobs and applied jobs I want to show jobs to a specific user which are not his jobs or in which he is not applied. for example user 1 have job id 2,3,4 and applied in 7,8,9 query ...
1
vote
0answers
30 views

Conection problem trying to connect Linux with SQL Server on Windows [migrated]

I've 2 servers connected to the same network. One of this, is a Fedora web server which contains the webpage and a form. The other one, is a Windows Server 2008 R2 which contains a SQL Server 2012. I ...
1
vote
2answers
55 views

How to Add A User To A Database In Standby / Read-Only Mode In Sql Server

I have a database which is in standby / read-only mode in my reporting server. But, I can not add a new user to this database. How can i add a new user to this database?
0
votes
1answer
71 views

SQL Server 2012 Agent hangs at a particular time of the day

There is a 3 node SQL Server Failover Cluster with 3 instances running on same node at the moment. SQL Server version is 2012 with SP3. At a particular time of the day at 4 PM daily, SQL Agent hangs ...
1
vote
2answers
34 views

SQL Help - Exclude data with just one distinct value

I have the following query: select agentname,CallCenterID, count(leadid) Dials from LeadCallHistory where agentname not in ('vdad','system') and cast(callCenterStartTime as date) between cast(...
-1
votes
1answer
44 views

how can I solve RAID 5 corrupted data? [closed]

I installed Windows Server 2012 on my server using RAID 5. But a problem occurred on my server. I extracted the data from 10 hard disks with data recovery. When I attached the extracted data files in ...
1
vote
2answers
39 views

How much storage space do indexes and keys take for an SQL Table?

I have a table which is predominantly filled with NULLS and takes up 10 GB which was shocking since probably 90 to 95% of the table is NULLS. I copied this table over to a new database on the same SQL ...
0
votes
0answers
33 views

Unfinished A Killed/Rollback Transaction [duplicate]

I have killed a transaction 2 days ago but it hasn't finished yet. You can see the situation in the pic. What can i do?
1
vote
1answer
42 views

What could be the cause for my high disk IO latency (from sys.dm_io_virtual_file_stats DMV)?

These are the results from querying the sys.dm_io_virtual_file_stats DMV. (I add some calculated fields for clarity). I'm finding certain basic operations in Database 7 are bottlenecking core ...
1
vote
1answer
47 views

Migrating old SQL Servers

I found myself in a rather complex situation and need some advice... We are moving our complete environment to a new Server and virtual servers. I have reached a point where i found out that some of ...
1
vote
2answers
74 views

Overestimated query resulting in poor performance - TVF with xml processing

Today i asked question about bad query performance. That query had a lot of joins over a lot of views. I think i have found which view is a trouble for SQL server. Here is actuall query plan for ...
0
votes
0answers
27 views

Memory allocation [duplicate]

How could we decide over how much memory will be good enough for a sql server 2012 standard edition instance having only 1 DB of around 250GB and it's very busy database through out the day, having ...
0
votes
1answer
58 views

Optimize query that accoridng to plan produces over 500 billions rows - Actual result is only 400k rows

I'm trying to improve DB performance. I'v noticed a query that according to the plan it produces a lot of rows but i know for fact there are no more than 400k rows in the table after that insert. Why ...
-1
votes
1answer
34 views

How to Find All Sql Server Users Privileges Rights

I want to list all user's privileges which is in Active Directory accout or using Sql Server account to connect to my database server. I want to see that which users have ddl right or which users can ...
0
votes
2answers
36 views

Database Log File Size Growth So Huge Unexpectedly [duplicate]

My database has two log files. Their sizes are growing very fast. My backup sizes are becoming massive. I know that when I take full backup of my database, the log files are emptied but it is not. I ...
1
vote
1answer
63 views

How to Get Backups & Restores Start and Finish Times?

I backup my databases from prod environment to file server. After taking my backups, i restore them to my report server. And i want to know that if i can get information about when backup and restore ...
1
vote
2answers
41 views

Is it possible to query for the job schedule description?

Working on putting together a script to analyze all of the active jobs and I have nearly everything I need, but if possible I would like to be able to query for the schedules description as well. Is ...
0
votes
0answers
59 views

I/O Requests taking longer than 15 seconds, Flush Cache During Replication SQL-Server

Hello I'm primarily a developer but I am trying to troubleshoot our database that basically just locked up last week. I have been diving into this pretty heavily but I'm also a bit out of my league in ...
0
votes
1answer
29 views

How to see restore history of a deleted database?

For example, I had a database and I want to see which physical backup file was used to restore into it. The problem is that the database was deleted. How can I see the record?
-1
votes
1answer
39 views

Sum for the last 5 records

Table StockSession columns: IdSeq, IdStock, DateSession, ChangePercent How can I get the sum of the ChangePercent column of the last five rows grouped by IdStock?
0
votes
2answers
169 views

msdb.dbo.sp_send_dbmail temp table does not exist

I have created a temp table and would like to email the results I am getting the following error. Query execution failed: Msg 208, Level 16, State 1, Server PRODYCHDBX3\X3V7, Line 1 Invalid ...
0
votes
0answers
35 views

Transactional Replication with 2 subscribers

I have an existing subscriber and want to setup another subscriber but on different machine.So 2 subscribers, 1 publisher I want to initiate it from a backup rather than snapshot but when i try set ...
0
votes
1answer
33 views

Can a subscriber be a publisher at same time

I want to setup a topology for replication. The scenario is such that a subscriber is subscribed to transaction replication based publisher (distributor running on publisher). I then want this ...
1
vote
1answer
64 views

Delete query does not commit

I need to delete about 900m rows from a table that has 6b rows. Since big deletes cause big problems for the transaction log, I'm deleting the data in small batches. What puzzles me is SQL Server does ...
3
votes
1answer
65 views

Grouping values into buckets

I'm working a query and I wasn't sure if my current approach is the "best" approach. I got a table filled with values and a table with buckets that I use to group those values. There are 2 types of ...
1
vote
1answer
69 views

Alternative of JOIN with BETWEEN

I have two tables to JOIN based on BETWEEN condition. Table 1 is small is small around 1500 records and Table 2 is of 40 millions records. Table1 is having only one column with the datatype bigint ...
0
votes
0answers
22 views

Is it a problem to define a non-UTF8 collation in an NVARCHAR field?

I am working on an application I need to make cross-database. One of the things I stumbled on is that SQL Server by default has a case-insensitive collation defined, which makes queries on NVARCHAR/...
1
vote
1answer
35 views

User is in multiple Active Directory groups with multiple roles in database

I have a user that is a member of multiple Active Directory (AD) groups. Within SQL Server 2012, these AD groups have been assigned to different database roles. This user is not getting the correct ...
0
votes
0answers
36 views

xp_sysmail_activate

There are multiple instance that whenever I am seeing xp_sysmail_activate running in SQL Server, DB performance is degrading. Whenever I kill the process, the database can't recover and restarting ...
0
votes
0answers
68 views

Error Formatting Query, probably Invalid Parameter

I created a SQL mail job on Thursday and it runs hourly. It ran fine until Sunday at 3 for which it has been failing with the following error. Executed as user: NT AUTHORITY\SYSTEM. Error ...
-3
votes
1answer
47 views

login not having permission to see sql server properties

I need a login and that login should not view the sql server properties i.e.,login should not have permission to execute command select @@version
0
votes
2answers
80 views

Microsoft® SQL Server® 2012 Service Pack 2 (SP2) Express [closed]

which version SQL server can Install Windows 10? Is SQLManagementStudio_x86_ENU.exe free ?
1
vote
0answers
62 views

SQL Server Agent log is showing error [298] SQLServer Error: 16389, Communication link failure [SQLSTATE 08S01] (LogToTableWrite)

While checking SQL Server Agent Log i found lot of error like follows [298] SQLServer Error: 16389, Communication link failure [SQLSTATE 08S01] (LogToTableWrite) [298] SQLServer Error: 10004, ...
-1
votes
2answers
38 views

SQL Server: How to unpivot from pivoted table back to a self referencing table

How does one unpivot from a pivoted table such as this? Table A: +----+------------+--------+--------+--------+ | Id | Level0 | Level1 | Level2 | Level3 | +----+------------+--------+--------+---...
0
votes
1answer
61 views

Moving Partitioning Files To Another Disk Drive In SQL Server

There is a production table which was partitioned by someone in our company. Some partitioning files was wrongly located to different disk drive. I have to move those files to the disk where they ...
1
vote
1answer
38 views

SQL Server Extended Events purging

How do we purge events older than a day in Extended Events in SQL Server 2012. Stopping and Starting the session is not helping. Target : asynchronous_file_target Trying to create a job which will ...
2
votes
2answers
94 views

Cannot connect to my SQL Management studio after moving a tempDB

In quite a bad position here. This afternoon on my tempDB I ran the query: sp_helpfile to locate where my MDF and LOG file were. My MDF was on my C: drive and my LOG file was on a D: drive so I've ...