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

learn more… | top users | synonyms (3)

0
votes
1answer
37 views

Cannot read from secondary availability group

I have an issue with Always On Availability Groups In SQL Server 2012. I installed a replica secondary SQLNODE3. It was fine and everything retrievable form tables but suddenly I found I could not ...
3
votes
2answers
165 views

Copy large table to archive table SQL Server 2012

I have a table with logs of my application that have 161.626.718 rows (and growing) and it's very slow to make a insert on it. My idea is to keep only 6 months of log in the table and all older ...
0
votes
1answer
28 views

SQL Server 2012 Patching Service Pack and CU Question

I am tasked with updating a SQL Server 2012 from a version(11.0.5623.0) before SP3 all the way to SP3 CU2. Can I install both patches without a reboot until afterwards? All the documents I have found ...
2
votes
1answer
60 views

Bulk Insert into view and find missing values

I have 2 tables, Categories, and SubCategories: CREATE TABLE [dbo].[tbCategories] ( [CategoryID] [int] IDENTITY(1,1) NOT NULL, [CategoryName] [varchar](250) NULL, ) CREATE TABLE [dbo].[...
1
vote
0answers
15 views

SQL Server 2012 certificate encrypt connection

I'm not a DBA by trade. My organization doesn't have a dedicated DBA, we have to just figure things out. I have a SQL Server 2012 Enterprise installed on a Sever 2012 R2 OS. It is a not in a SQL ...
0
votes
1answer
35 views

Row of database is unreacheble

Here is the problem: I have a table called "flags" with 54 columns: PVKEY PEOPLEKEY ADDRESSKEY FLAGTYPE FLG1 FLG2 FLG3 FLG4 FLG5 FLG6 FLG7 FLG8 FLG9 FLG10 FLG11 ...
0
votes
1answer
51 views

solve high stolen memory

I've a SQL Server 2012 SP2 with max memory set to 13GB but there is 8GB of stolen memory (SQLServer:Memory Manager - Stolen Server Memory (KB)). I know stolen memory is memory taken from the ...
0
votes
0answers
10 views

How to weight columns and should I use a dedicated table?

Our website had a full text search that included a title, description, and other fields. Appearing in the title is far more important than appearing in any of the other fields, but the index was ...
0
votes
1answer
52 views

Transaction log changes not synchronizing with AlwaysOn

SQL Server 2012 Enterprise in an AlwaysOn configuration. The Availability Group for this specific DB is synchronized and healthy. I had to add a second transaction log file (logfile2) to the primary....
6
votes
1answer
144 views

How do I move or redistribute FILESTREAM files between containers?

We have a FILESTREAM container with a few million files, and we believe it's the cause of our performance issues we're experiencing (abundant timeouts). According to this blog about FILESTREAM best ...
1
vote
0answers
14 views

Unable to get anything other than 'Remote scan' when selecting from linked MySql server

I have a linked server in SQL Server 2012 (SP3) that points to a MySql 5.1.61 server on another machine. Whatever I do, I don't seem to be able to get any where filtering to occur on the remote side. ...
10
votes
5answers
1k views

How to hide/disable tables without dropping them to check redundancy?

I have to maintain and extend an old legacy system which contains webservice methods and database tables that are no longer used. Since I’m not entirely sure that the tables are really redundant, I’m ...
0
votes
0answers
27 views

SQL Server Collation conflict

The problem is, one of the server had wrong collation, so I tried fixing it by using sqlservr -m -T4022 -T3659 -s"" -q" SQL_Latin1_General_CP1_CI_AS". It worked perfectly, it fixed all the system ...
3
votes
2answers
60 views

Fill in missing dates with data value from previous populated date for group

Picture help desk tickets that gets transfered between departments. We want to know what the department is at the end of the day for each ticket for each day that the ticket is open. The table ...
0
votes
0answers
80 views

SQL query too slow to fetch single row of data

we have this SP, running extremely slow to fetch a single row of data from tables within 100K rows, which seems not that big. It takes onn avg 15-20 mins to complete. We have tried to remove all ...
3
votes
0answers
57 views

Why would Stolen Memory counter be at a constant high? [duplicate]

I'm trying to understand memory stats a lot better and have been troubleshooting an issue with one of our SharePoint DB servers for a while now. Low PLE, frequent lazy writes, slow performance etc I ...
0
votes
0answers
17 views

Is it possible to configure exceptions for SQL Server Agent tasks?

I use SQL Agents tasks to execute my backup, maintenance & ETL tasks. IT would like to have a regular maintenance window to apply server patches. They're suggesting the 3rd Tuesday of every month ...
2
votes
0answers
37 views

Multiple transaction logs and preferred order of use

Here's my situation: I have a SQL Server 2012 installation with a relatively small (185GB) SSD volume, and a large (3TB) RAID10 spinning disk volume. I currently have tempdb data and log files on ...
2
votes
1answer
56 views

SQL Server Always ON

We have a SQL Server 2008 R2 cluster with 2 node and total data is about 2 TB now that cluster is log ship to 4000 Miles another data center. I know about a 2 years back we have mirroring setup ...
0
votes
1answer
62 views

Extracting data from SQL Server linked server

I am using MS SQL Server 2012, and I am trying to extract data from a Linked Server database. In SQL Server management studio, I can see the linked server. I can browse the database on the server. I ...
0
votes
0answers
70 views

automate import and export of process EXCEL -> SQL SERVER - > EXCEL without using SSIS

I have an ETL process that is entirely written using T-SQL scripts. The script grabs an Excel spreadsheet and imports it using openrowset. Once I get the transformed data I copy with headers and paste ...
1
vote
2answers
27 views

SQL Server Cluster + Availability Groups?

I'm actually finding a way to provide a good High Availability and Failover solution while I have a way to manage some sort of horizontal scalability and Load-Balancing... I actually have a SQLServer ...
3
votes
1answer
24 views

Error When Trying to Run MDW Data Collector

I have SQL Server Management Data Warehouse (MDW) set up across multiple instances, all in the same way with the same accounts and permissions. On one server I get an error when trying to run the ...
1
vote
1answer
44 views

Create a stored-procedure to insert multiple rows on a junction table and other tables

I am new to Databases and Design and needs some help on a INSERT issue. I want to create a procedure that will insert multiple values to different tables, I need to make sure it stays atomic so I need ...
0
votes
1answer
15 views

Combine addresses missing Unit/Suite #

I have a list of addresses which need to be updated in SQL Server. How can I go about adding the Suite # to the addresses which are missing it? Address 1 Burton Hills Blvd, Suite 250 1 Burton Hills ...
0
votes
1answer
30 views

Query Transactional Replication Article Filters

Through the UI, I can see that I have 2 tables with filters on them. I need to be able to query this information but cannot find the table that contains the data. I did a search for any column in the ...
3
votes
3answers
267 views

9 digit zip codes are reporting LEN of 12

I am attempting to resolve some difficulties in getting zip codes to display properly. The original spreadsheet has zip codes of mixed 5 and 9 digit formats. After the import process, these 9 digit ...
5
votes
2answers
72 views

Stable triangle relationship?

I have a table that represents a specific type of action. Let's call it [ACTION]. An action can be performed by a user ([USER]), so I have the relation [USER] 1:N [ACTION]. The user can have ...
7
votes
1answer
242 views

Is there a way to see how SQL Server 2012 defines new identities?

On Microsoft SQL Server 2012 (SP1) - 11.0.3000.0 (X64), is there a way to see what mechanism SQL Server uses to calculate the new identity values for tables created by SELECT INTO? SAMPLE DATA -- ...
6
votes
3answers
458 views

Would a table benefit if it was a heap

I've a logging table with approx 1.500.000 rows, the primary key is an ascending identity and the clustered index is on the primary key. The identity value is auto-generated => records are always ...
1
vote
2answers
47 views

Primary keys, clustered indexes and partitioning

We store data for financial records, splitting it up over 4 tables. I'm at a bit of a loss as to what's optimal for our setup here, or at least which direction to head in as I'm getting a lot of ...
5
votes
2answers
107 views

How to find the specific file in a filegroup in which an object resides

Today, I encountered below error on one my SQL Server which I manage. Could not allocate space for object '%.*ls'%.*ls in database '%.*ls' because the '%.*ls' filegroup is full. Create disk ...
4
votes
1answer
61 views

Buffer Cache Size when Page Life Expectancy Drops

I'm troubleshooting an issue with one of our SharePoint databases, essentially huge drops in PLE which I think are caused by increased I/O activity (I see increased reads, writes and lazy writes at ...
0
votes
0answers
82 views

SQL Server not using all the memory

We have a server with 32 GB of RAM, Windows 2012, 64 bit and SQL Server 2012. SQL Server is not consuming all the memory available on the server. Max and min settings are in place. No resource ...
0
votes
0answers
32 views

SQL Server - “…failed to retrieve text for this error. Reason: 317” error on FILEGROUP

I log in on my local SQL Server 2012 via Windows Authentication. If I try to execute: CREATE DATABASE MediaDB ON PRIMARY ( NAME = FileStreamDB, FILENAME = 'C:\temp\FS\MediaDB.mdf'), FILEGROUP ...
2
votes
3answers
63 views

Vendors with Most Invoices in State

I have the tables Vendors(VendorName, VendorID,...) and Invoices(InvoiceID,...) and I am trying to find vendors with the most invoices in their respective states. Please critique my work: SELECT Max(...
1
vote
0answers
29 views

How can I create a Web-service to share data from SQL Server?

Our organization has an externally hosted website that displays data from a monitoring system. Data is currently provided by FTPing csv files. The data is stored in a SQL Server Database. The ...
3
votes
1answer
56 views

Handling sql column with mixed varchar and float data types

We have some Excel spreadsheets with parcel numbers for properties that should be in a standard varchar format similar to: [Parcel # 1] [Building Address] 038-60-171-16-000 1750 W 4th St ...
2
votes
1answer
166 views

App Domain unloaded when using GDAL/OGR ogr2ogr to insert many Geometry records

SQL Server 2012 x64, Total memory allocated 2GB, set to low value to enable us to reproduce "AppDomain unloaded" issues much quicker Windows Server 2012, Total Memory on Server 16GB (in production, ...
0
votes
3answers
77 views

Syntax on Changing return String by Concatenation?

I successfully created the scalar function FN_TotalBilled in SQL Server, which gives me the total amount invoiced to a company using tables Invoices(InvoiceID, InvoiceTotal,..) and Vendors(VendorName, ...
4
votes
2answers
53 views

Statistics for AlwaysOn Availability DBs

Can you please help me understand why there is a need for SQL Server to maintain statistics in tempdb for DBs that are part of an Always On Availability Group? Isn't "everything" that happens in the ...
3
votes
1answer
66 views

Correlated subquery to find total larger than state average

I have tables Vendors (VendorName, VendorState,....) and Invoices (InvoiceID, InvoiceTotal,...). I want to get the Invoices (as InvoiceId) that are larger than the Avg state InvoiceTotal. I know I ...
3
votes
2answers
78 views

Max date record for items for given set of dates

I am looking for some help to create an efficient SQL query (SQL Server 2012) that will identify the latest records (date) for all the items in the table (table 2 below) on each of a list of given ...
-3
votes
1answer
21 views

SQL Server 12 Instance / server name change

I created a sql server instance and the name show up differently in test and prod. How can i change the prod name to not have the names repeating ? Prod : select @@servername EHCPSQL12\EHCPSQL12 ...
15
votes
1answer
207 views

Multi-statement TVF vs Inline TVF Performance

Comparing some of the answers on the Palindrome question(10k+ users only, since I've deleted the answer), I'm getting confusing results. I proposed a multi-statement, schema-bound TVF which I thought ...
6
votes
0answers
102 views

SQL Server Sharding strategy optimization

I have implemented a sharding solution for our SQL Server databases as per the MSDN documentation here: https://msdn.microsoft.com/en-gb/library/dn589797.aspx This has been running for around 6 ...
0
votes
1answer
22 views

DR site SQL Server DB server not need Quorum Disk?

We have two SQL Server DB Servers and Shared disk in production site and 1 DB in DR Site. Production site has Quorum Disk on Shared Storage. Production site DB servers can access this share storage, ...
4
votes
1answer
341 views

Difference between clustered index seek and non clustered index seek

What is the difference between Clustered Index (CI) seek and Non Clustered Index (NCI) seek? Does one perform better than the other? The reason I am asking this is because I have a table with 50 ...
0
votes
1answer
18 views

Implementing a Scalable shared reporting platform

Im starting to implement a Shared Platform that will host multiple BI/Reporting applications. The platform is required to be as scalable as possible and im also thinking how to achieve Load Balancing ...
2
votes
2answers
60 views

Stopping SQL Server Log Reader Agent In 2012

We implement Transactional Replication with 2 publishing servers, 4 publications and 1 subscribing server. I need to shut down our distribution server for several hours. When restarted, will the Log ...