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
vote
1answer
63 views

Casting int YYYYMMDD to date produces incorrect value in Squirrel-SQL

I have extracted some data from a legacy database where dates are stored as Numeric(8) values, in YYYYMMDD format. I've stored them in a staging table in that same format, and now I would like to ...
0
votes
1answer
27 views

How to Grant A User Under A Sql Domain Account To Insert and Update Records

I have a sql domain account in sql server like DOMAIN\GroupName. There are many user accounts under that account like DOMAIN\user.name. I want to give insert and update permission only to a user under ...
0
votes
0answers
12 views

Incremental Load SSIS Job not capturing Data from CDC tables [closed]

I have few tables enabled with CDC and SSIS job is working side by side to deliver the incremental data to FTP via text files. It was working fine few days back but now job is generating the files ...
0
votes
1answer
10 views

How can I Get Value of Max(col) in a greatest n per grouped by into Declared variable. MS SQL sever

I am looking for how to set the value of @MaxItemSeqNum to the returned result of the column MAX(dbo.[Table1].[Item_Seq_number]) in my select statement. I need this in order to insert the next record ...
0
votes
1answer
61 views

MSSQL 2016 - Restore SSISDB from MSSQL 2012

On "MSSQL 2016 (SP2-CU11) (KB4527378)" I created empty SSISDB. After that I restored SSISDB from "MSSQL 2012 (SP4) (KB4018073)" to "MSSQL 2016 (SP2-CU11) (KB4527378)" On DB I set owner to sa and ...
1
vote
1answer
56 views

Why only few of expected tasks are processed although many cores are available?

I push some data from one database to another on the same instance using Service Broker. 20 cores are online, 6 Service Broker tasks are activated, every taks is working on indepentent piece of data. ...
0
votes
0answers
28 views

Stuff With XML Path

DECLARE @v NVARCHAR(MAX)='' select @v =STUFF((SELECT CASE WHEN MeterID=0 THEN '' ELSE CONVERT(VARCHAR(50),MeterID) + ',' END AS [text()] FROM (SELECT DISTINCT mr.MeterID FROM #...
0
votes
1answer
39 views

Duplicate record inserted - why trigger is not preventing it?

I have two tables: DebitIUVs and RPTs. I have record inside DebitIUVs which is with state 118001. My business logic must insert new line inside RPTs table. Inside RPTs table there is additional ...
-1
votes
1answer
24 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 ...
3
votes
2answers
345 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
44 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
88 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
27 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
64 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
2answers
60 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
73 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
46 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
43 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
75 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
59 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
38 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
41 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
177 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
36 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
35 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
69 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