This tag is for SQL Server 2012, major build version 11.00.xxxx.

learn more… | top users | synonyms (3)

0
votes
1answer
6 views

Alter of stored procedure and execution performance

Like to understand how an alter of a stored procedure without modifications can impact performance. Had a situation where a production environment had DB schema updated and particular stored ...
4
votes
1answer
98 views

Find rows where data resets

So I have a table tbl where I'm trying to pull data that increments at a variable rate. I need to identify when the data resets so I can make a cumulative value. Here's an example table: ID VAL ...
-9
votes
1answer
44 views

Stored Procedure which INSERT, UPDATE, DELETE any table(for any table) where table name and its values are passed as parameter [on hold]

Stored procedure which performed operations like inserting data to table, updating data, and deleting data of table where table name is passed by parameter. Parameters of stored procedure: table name ...
3
votes
1answer
16 views

How to change location of SQL Server 2012 database which is already configured with a merge replication

I have SQL Server 2012 configured with merge replication. currently the location of the replication database and the .mdf and .ldf files reside in C:\ drive. The C:\ drive is now full due to that ...
1
vote
1answer
58 views

What is the best option to easily fix fragmented heap indexes?

I have SQL Server 2008 R2 SP2 and also SQL Server 2012 SP2 on these servers. I have a database in which there is a lot of heap indexes which are more than 90% fragmented. What is the best option ...
3
votes
1answer
37 views

Insert a range of numbers from a call to sp_sequence_get_range

Given the following code: CREATE SEQUENCE dbo.NextTestId AS [bigint] START WITH 10 INCREMENT BY 2 NO CACHE GO DECLARE @variableNumberOfIdsNeeded INT = 7, -- This will change for each call ...
2
votes
0answers
63 views

No significant performance increase after migrating from SQL Server 2005 32bit 4 Cores 4 GB RAM to SQL Server 2012 64bit 4 Cores 32 GB RAM [on hold]

We run regularly a series of data analysis scripts on one of our databases. The MDF File of the database is several gigabytes big, the scripts perform not only selects, but also inserts, updates and ...
0
votes
0answers
21 views

Object refernce not set… Maintenance plans SQL server 2012

I need to perform a backup but while executing the existing maintenance plan, I recieve the following error message (also after creating new maintenance plan): Object reference not set to an ...
2
votes
1answer
12 views

Trouble removing filestream file / filegroup

My database was originally using filestreams in one table. For reasons that I won't go into here, we decided to stop using filestreams. I therefore wrote a migration to copy the filestreamed table ...
2
votes
0answers
33 views

Disk setup for Windows 2008 R2 and SQL Server 2012 [on hold]

I am wondering what would be the best disk/RAID setup for a Windows server 2008 R2 OS and SQL Server 2012 database that has heavy read/write. I have the following disks I can use: 4x 15k 146GB 2x ...
0
votes
1answer
14 views

XQuery on Extended Events joining with dm_exec_query_plan not working [duplicate]

I have this XQuery for my extended event session which works fine but when I try joining the plan_handle to dm_exec_query_plan to get the query plan, it says Msg 257, Level 16, State 3, Line 1 ...
2
votes
1answer
38 views

Can I use a script to restore multiple SQL databases from .bak files?

I'm migrating 100 plus SQL databases over to a new server in a new location. I have the maintenance plan in place to take full back ups and then a script to copy over the .bak files to a temp ...
0
votes
1answer
15 views

Replicate a database to one secondary replica, but not the other secondary replica using Availability Group

I have a 3 nodes cluster in an availability group. There are two databases on the primary node. One database I want to replicate to the 2 secondary nodes. Another database I just want to replicate ...
1
vote
1answer
43 views

Dynamic Partition Elimination when using “OR ” or “IN”

Say I have a query like this: SET @ContainerId = 5 SELECT * FROM Container.Container_Partitioned WHERE containerId = @ContainerId When I run this, I get a query plan with Actual Partition ...
1
vote
2answers
28 views

Role to view SQL server job log

We have a monitoring tool that can check if Microsoft SQL Server jobs have run successfully. What I want to do is create a user that has as little permission as possible but it must be able to watch ...
0
votes
2answers
38 views

Retrieve Data from a Specific Database [closed]

Goal: I want to retrieve the value of [data].[Mobiles] when you use a query document that is for the database [test] (use [test]) Problem: Based on picture two, I cannot retrieve the value ...
0
votes
2answers
24 views

Retrieve data from SP inside of From

Goal: Retreive a list of data from a stored procedure that is acting as a database name. When you have retrieved the list from stored procedure, I want to make another new data manipulation. Problem: ...
6
votes
2answers
119 views

SQL Server 2012 Standard Edition Disaster Recovery Options?

Could you please suggest me the best method for My DR plan. Currently we have set of databases (6) used for our application and we in the process of building DR and HA plan. As we are into small ...
5
votes
2answers
57 views

Predicate not resulting in expected scan

So I have this query that I'm trying to tune and am running into an issue that I'm having trouble understanding. First of this is the query I'm using. SELECT si.LoanNbr AS [LoanNumber], ...
1
vote
0answers
23 views

Does SQL Server 2012 Standard Edition have an option for select a window over time range?

As an example, in StackOverflow they answer the question Finding a count of rows in an arbitrary date range using Oracle. One of the queries is very similar to what I need, but in reverse, I need ...
1
vote
0answers
12 views

Compare Traces with RML Utilities

I am new to RML and am trying to use it to capture a trace, replay it on another server and then compare the two. I have managed to capture a trace using the server side script that comes with it and ...
-3
votes
2answers
30 views

SQL DBA Monitoring and basic check [closed]

I need to improve SQL monitoring for backups, blocking job failure, high availability failure, log size, DB status, server status...etc...(basic check) Which way is reliable? as our company does not ...
2
votes
1answer
56 views

How to Retrieve value from a User-Defined Table Type (UDTT)

Goal: I want to reach and display the value of @data inside of [wwtest]. Problem: The UDTT is from the database [test] and I receive an error message: The type name 'test.dbo.tvf_id' contains ...
6
votes
2answers
121 views

SharePoint 2013 Database encryption

I'm using SharePoint 2013 with SQL Server 2012 as persistence layer. I need to encrypt the data stored in the database. I stumbled upon the SQL Server feature Transparent Data Encryption (TDE). What ...
3
votes
1answer
28 views

A Customized Table with Chronological order

Goal: My request is the retrieve the return result from sp_Test as 8, 2, 4, 1 ,3 (take a look at picture 1) based on the chronological list from User-Defined Table Type dbo.tvf_id. Problem: When I ...
2
votes
0answers
35 views

Is there a TSQL command or another way to rename AOAG (Always On Availability Group)?

We have an AOAG named with "space" and I need to rename it to not have "spaces". It was created before my time. The 3rd party vendor tool does not work with AOAG that has spaces. There are about 40 ...
2
votes
1answer
39 views

Partitioned Database restore is very slow on SQL Server 2012 with SP2

Team, We have a Partitioned database which is very small in size(112MB backup size). This is partitioned with 15000 files for one table and 7500 files for other table. Currently we are running into ...
0
votes
0answers
29 views

How can I correct my untrusted foreign key situation?

In our scenario, we have a number of situations in which foreign keys or check constraints are not trusted. Here's some example situations: A "claim" is an entity that is the primary purpose of the ...
1
vote
1answer
16 views

Order of DROP_EXISTING and ONLINE for CREATE INDEX

If I call a CREATE NONCLUSTERED INDEX using DROP_EXISTING = ON and ONLINE = ON what order are things done it? What I want is: New index is made in the TempDB Existing Index is dropped New index ...
7
votes
3answers
134 views

IF statement not skipping TempDB when Looping through Databases with sp_MSForEachDB

[SQL Server 2012 SP2 EE] Why does the following script gives me an error relating to tempdb? exec sp_MSForEachDB ' IF ( (select database_id from sys.databases where name = ''?'') > 4) ...
9
votes
3answers
291 views

Backup internals - What happens when a backup job is running - in terms of locking and performance overhead in SQL Server?

For MySQL I know the database is backed up table by table in SQL Statements, this results in locking and if you update columns while backing up you might end up in integrity problems. To my ...
6
votes
2answers
183 views

SQL Server Management studio slow connection or timeout when using Windows Authentication

I'm getting extremely long delays (10~30 seconds) in SQL Server Management Studio 2014 when attempting to connect to a SQL Server 2012 instance over TCP using Windows Authentication. This happens when ...
0
votes
1answer
45 views

Exporting tables from SQL Server

I have to export some data from SQL Server 2012. I'm interested in flat file export (i.e.: .csv) but my database has about 500 tables. Here is an example for you to better understand the situation: ...
0
votes
1answer
25 views

Sql Server thinks I have different Data Compression when swaping partitions

I am setting partition switching for my database. I created a script using SqlCmd variable so that the same script would make both my source and target tables for partition swapping. Here is an ...
0
votes
1answer
31 views

Different way to do a LIKE WHERE condition?

I have a query which works fine: SELECT month_date= month(SendTime) ,year_date =year(sendtime) ,MessageType ,COUNT(MessageType) AS MESSAGE_COUNT FROM Message where year(SendTime)= ...
2
votes
2answers
25 views

Shreded system_health ExEvent not returning all node information

SQL Server is not returning all node information when I shred the deadlock XML from the 2012 system_health Extended event. When I run the following query SELECT ...
4
votes
2answers
66 views

Rebinding a SQL Server user to its login after a restore with this user

After performing a restore of a SQL Server (v12.0.2000) database, I figured that a user needs to be remapped to its login (this issue seems to be known as orphan users). And one of the simplest way to ...
3
votes
2answers
41 views

Prevent logins loss when restoring a database

I'm backuping and restoring databases accross two sql server (v12.0.2000). But it looks like whenever I restore a .bak file, the login I created on the database that was backuped is no more existent ...
8
votes
3answers
182 views

Configure RAM for SQL Server and NUMA

Accidental DB admin here. Question: Would you still manually limit max RAM for SQL Server even though the sole purpose of that server is to serve SQL Server database engine only? I have Microsoft ...
1
vote
1answer
25 views

Indexed view doesn't exist on the subscriber

I am configuring transactional replication in SQL Server. The subscription is configured as push from 2008R2 publisher (distributor is the same server) to 2012 subscriber. The object I want to ...
0
votes
3answers
54 views

Query for total downtime of site using datestamps and status columns

what want to find the total downtime for a site. I'm thinking I can subtract the 'down' DateStamp from the following 'up' DateStamp. then add the totals together for all downtime. I want to get a ...
0
votes
1answer
35 views

Optimal SQL Server 2012 Disk Configuration

I will be installing SQL Server 2012 on a new Dell T430 server containing four (4) physical 15K SAS 6Gbps disk drives using a PERC H730P RAID Controller and RAID 1. Since this will be the first time ...
0
votes
0answers
25 views

Sync two SQL Server databases

So I've got a hosting package from hostgator with an MS SQL database and a local SQL Express 2012 database running. I'm trying to investigate syncing the two together, two-way syncing, and I'm unable ...
1
vote
2answers
44 views

With LocalAdmin become sysadmin SQL Server

I am a local Admin on my machine. Same old thing, my account wasnt added when SQL Server was installed, and I don't want to have to reinstall SQL Server. I went through this blog and it worked until ...
2
votes
1answer
38 views

Create Database and LCK_M_S

We are experiencing issues when creating a database in the SSMS GUI in that sometimes it times out complaining that it could not get an exclusive lock on the Model database. Other times the database ...
3
votes
1answer
45 views

Why is the secondary selective index not used when the where clause filters on `value()`?

Setup: create table dbo.T ( ID int identity primary key, XMLDoc xml not null ); insert into dbo.T(XMLDoc) select ( select N.Number for xml path(''), type ) from ( ...
5
votes
2answers
69 views

Does SA account need to be called “SA” or can I rename it safely?

We have some applications on our network (from before my time) that use SA account in their SQL Server connection string. It's hard-coded in the source code, and for whatever reason, we can't change ...
1
vote
1answer
57 views

Full backup at 1am, not started by my maintenace plan

I set up a complete set of Maintenance Plan. Full backup of all databases at 3AM. Differential backup at 6h30, 12h30, 18h30 and 00h30. Log backup at each hour, at 45 minutes (1h45, 2h45...) In my ...
2
votes
0answers
43 views

MEMORYCLERK_SQLOPTIMIZER in SQL 2012 Memory usage extremely high and causes server to crash

I have been having issues with our SQL server for a while now. It seems to run out of memory every few days and when I look at the memory dump, the MEMORYCLERK_SQLOPTIMIZER seem to take over memory ...
2
votes
1answer
34 views

Difference between clustered index and partitioning column

As I understand partitioning, the column that you partition on is how things are divided into partitions. But does the partitioning column have anything to do with order on the disk? (Aside from ...