This tag is specifically for SQL Server 2012
5
votes
2answers
130 views
How best to maintain SQL log file sizes
I'm somewhat of a new DBA and I'm managing a SQL Server 2012 instance that has a fair amount of activity. I'm running in Full Recovery mode because we need point in time recovery.
Right now, I'm ...
1
vote
1answer
62 views
Paging in SQL Server 2012 vs. previous versions
I have used lot of paging code in SQL Server 2008. The format is
With CTE(
-- SQL With RowNumber
)
-- SELECT ALL Page N
This is working fine. But I have heard that SQL Server 2012 has better ...
1
vote
2answers
48 views
Dictate edition during unattended install?
I am creating an automated build of SQL Server installation which is run from a batch file. Is there any way to change the registry, or other method, of deciding which SQL Server edition (Either ...
1
vote
1answer
43 views
How can I identify the number of times a View is called in SQL Server?
How can I identify the number of times a View was called in SQL Server?
I am looking for an answer that is similar to this below which shows how it can be done for stored procedures.
How can I ...
3
votes
3answers
97 views
Conditional WHERE Clause in a Table Valued Function
I have a table valued function
CREATE FUNCTION [dbo].[DateRange]
(
@StartDate date,
@EndDate date,
@Location varchar(25),
@Device varchar(25)
)
...
2
votes
2answers
79 views
Identity proceeds as normal, but with a leading 10…?
So I noticed a very strange thing when tinkering with my database.
I had just inserted a row which was ID 47, then after inserting some more, I realised that somehow my Identity had skipped all the ...
7
votes
2answers
139 views
How to flatten results of a table with two related “many” tables?
I've reorganized some tables in my database to be more flexible but I'm not really sure how to write the SQL to extract meaningful data from them.
I have the following tables (somewhat abbreviated ...
1
vote
0answers
32 views
Does SQL Server place shared locks on scanned records when using REPEATABLE READ [duplicate]
Assume a SQLCmd session which is using transaction isolation level REPEATABLE READ.
In this session I start a transaction and execute an UPDATE statement with a WHERE clause on a non indexed column. ...
6
votes
1answer
104 views
LATCH_EX Waits on Resource METADATA_SEQUENCE_GENERATOR
We have a process that generates an inventory report. On the client side, the process splits of a configurable number of worker threads to build a chunk of data for the report that corresponds to one ...
2
votes
2answers
145 views
Best practice for tempdb log file
I have read many blogs here and there about how to configure tempdb data files but i didnt found any information regarding the tempdb log file.
Here's the strategy that I'm presently using with my ...
0
votes
1answer
42 views
Different Results between stored proc and udf
I am getting different results between my stored proc and my SVF.
The jist of of the both of them is that, it queries a remotely linked server, jams those results into a temp table/table variable, ...
5
votes
1answer
139 views
How does SQL Server generate a query execution plan that adds up to 6,000%? [duplicate]
Today I was on The Heap and was looking at a query plan for something I thought could be improved. However, it created something that shook my belief in the SQL Server query optimizer. Can I still ...
1
vote
4answers
301 views
SQL Server 2012 AlwaysOn: need to automatically add databases by script- T-sql or PowerShell
I've installed and successfully configured our SQL Server 2012 AlwaysOn 2-node servers for our new "Intranet" that is coming out. I've gotten AlwaysOn working great, and our Front End servers for the ...
1
vote
1answer
43 views
SQL Server 2012 Availability group disk configuration options
Background
I am quite far into the process of setting up a 2 server SQL Server 2012 Always on availability cluster to provide redundancy with a readable secondary replica of all our databases.
Since ...
0
votes
1answer
68 views
MSDTC on SQL Server 2012 with mount point for data disk
I have installed a new SQL Server 2012 instance on a cluster. The installation went fine but when I've added the MSDTC as resource of the instance, it went wrong. When I just added it, the MSDTC was ...
4
votes
2answers
107 views
Is high Extent Fragmentation a problem?
DBCC SHOWCONTIG scanning 'MyTable' table...
Table: 'MyTable' (2048062382); index ID: 1, database ID: 28
TABLE level scan performed.
- Pages Scanned................................: 1019182
- Extents ...
1
vote
1answer
80 views
SQL Server 2012, Network for: AlwaysOn Availability Group with AlwaysOn AlwaysOn Failover Cluster Instances
Setup: I have two data centers. In site1, my primary site, I'd like to deploy an AlwaysOn Failover Cluster Instance (FCI). In site2, my data recovery site, I'd like to deploy a single-node instance of ...
1
vote
1answer
91 views
import csv data stored in a blob column
Here's what i need to do:
Users will upload CSV files into SQL Server 2012 blob column
Each night, i would like to take each file and import the data into table
I will have 2 web sites using the ...
4
votes
2answers
96 views
SQL Server AFTER INSERT trigger
I want this trigger to be fired after an insert is made with the text married on the marital_status column, this is what I have so far
ALTER TRIGGER [dbo].[marriage]
ON ...
2
votes
2answers
79 views
Suspended in index rebuild
In SQL Server 2012, an Index Rebuild job is taking a very long time (up to 8 hours). However, not even one Index rebuild completed, so I stopped the index job.
In monitoring SQL task:
state = ...
1
vote
1answer
76 views
SQL Server bulk insert performance
I’m running sql server 2012 and the installed ram on that machine is 128 GB. The performance of the bulk insert is very low. The bulk insert of 10 million records takes about 2 hours. We have checked ...
4
votes
1answer
63 views
Are the cost percentages in this SQL Server plan over 100% for a valid reason?
I'm looking through the plan cache, looking for low-hanging optimization fruit and came across this snippet:
Why are many of the costs listed above 100% ? Shouldn't that be impossible?
3
votes
2answers
105 views
SQL Server how to detect unused views and/or get usage stats
Is there a way to determine in SQL Server if a view is no longer being used? (without removing it)
Ideally i would like to know usage for SQL Server 2000 as well as 2012 if that is possible.
I am ...
0
votes
1answer
87 views
Linked Server to SQL Server 2000 server from SQL Server 2012
I have a new SQL Server 2012 instance, and am migrating a database from SQL Server 2000. Some of the stored procedures in the DB I am moving reference another database back on that 2000 server. What ...
1
vote
1answer
67 views
Unique index for subquery with RANK() function
I have the following tables:
CREATE TABLE Revision (
RevisionId INT PRIMARY KEY IDENTITY,
UserName NVARCHAR(256) NOT NULL,
DateTime DATETIME NOT NULL DEFAULT GETDATE()
)
CREATE TABLE ...
1
vote
1answer
30 views
Adding users to a list and sort by category?
I'm using SQL-Server 2012 and I would like to know how to solve this program.
So:
I want to create a page that allows admins to manage a project, and part of it, would be to add members/employees to ...
4
votes
2answers
67 views
Database Install Issue
I was navigated over here from Stack Overflow, hopefully you can help me out.
So I've got a dilemma. Our company has bought a volume license for Microsoft SQL Server 2012 Standard Edition. We ...
4
votes
2answers
177 views
Securely generate a UNIQUEIDENTIFIER in SQL Server
I intend to be using a UNIQUEIDENTIFIER as an access key that users can use to access certain data. The key will act as a password in that sense.
I need to generate multiple such identifiers as part ...
3
votes
0answers
111 views
Is SQL Server data compression categorically good for read-only databases?
Some literature on SQL Server data compression I read state that the write cost increases to about four times what would normally be required. It also seems to imply that this is the primary downside ...
0
votes
1answer
124 views
Login Failed for Domain\ServerName$ when trying to create a new SQL Server Reporting Services Application in SharePoint 2013
Basic setup:
All of the following is installed on Domain\Servername:
SharePoint 2013 Standalone Install (Trial version)
Currently using an instance of SQL Server 2012 SP1 Express for basic
...
3
votes
1answer
76 views
How can I determine what is using a particular resource (table, view, or function, etc) on my SQL Server?
I've been looking for tables that could use better indexing. I've created a stored procedure that provides a list of tables that have no indexes other than a primary key:
CREATE PROCEDURE ...
1
vote
1answer
42 views
SQL Server 2012 catalog.executions to sysjobhistory - any way to join them?
I have exhausted my resources and can't find a foolproof way to join the ssisdb.catalog tables to the jobs that run them. Trying to write some custom sprocs to monitor my execution times and rows ...
3
votes
2answers
142 views
Relating ExecutionInstanceGUID to the SSISDB
The 2012 release of SQL Server Integration Services, SSIS, has delivered an SSISDB catalog which tracks the operations of packages (among other things). The default package execution for solutions ...
0
votes
3answers
100 views
SQL Server 2012, rebuild not lowering avg fragmentation
I have a script identifying what indices to rebuild.
select
'alter index ' + name + ' on ' + @dbname + '.dbo.' + OBJECT_NAME(a.object_id) + ' rebuild;'
from sys.dm_db_index_physical_stats ...
3
votes
5answers
240 views
How can I tell if a SQL Server backup is compressed?
We have recently upgraded from SQL Server 2005 to SQL Server 2012. Under SQL Server 2005 there is no option to create compressed backups as there is in 2012.
If you attempt BACKUP DATABASE ... WITH ...
0
votes
1answer
163 views
SQL Server Express on Windows 8 isn't locking MDF database files
Historically, if I go to rename a database that is currently being used by SQL Server, I get an exception.
On this Windows 8 desktop I'm in.. my primary desktop.. I'm able to MOVE SQL Server ...
3
votes
5answers
124 views
Can SQL Server 2000 and SQL Server 2012 CoExist?
We have OLTP Databases on SQL Server 2000 on my client's Prod Server. Planning to create Data Warehouse on the same Server but use SQL Server 2012. Can I install without any issues?
4
votes
1answer
152 views
SQL Server database design for “archived but available” data
We have this large database (>1TB) that we intend to "shrink". The database revolves around one main entity, let's call it "Visit". For discussion, let's say it is a database for a medical practice.
...
1
vote
1answer
248 views
How to connect Powershell to the SQL Server named instance?
When I run
# Load the SMO assembly
[void][reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo");
$ServerName = "[local\s12]";
#Get a server object which corresponds to the ...
-5
votes
1answer
40 views
SQL server 2012 installation [closed]
i'm installing SQL server 2012 x64 on windows 7 professional x64 and when i install it said to me your operating system doesn't meet the requirements !!
2
votes
1answer
74 views
IntelliSense alternative using SSMS 2012 in a contained database as a contained user?
According to this answer about contained database disadvantages:
If you connect to a contained database as a contained user, SSMS will
not fully support IntelliSense. You'll get basic ...
2
votes
1answer
74 views
Even when user has 'bulkadmin' role, query says user does not have role - SQL Server 2012
I am facing a weird issue with SQL Server 2012.
I have a user (say RS\sqluser) which has bulkadmin role.
Now when i run this query
Select IS_SRVROLEMEMBER('bulkadmin', 'RS\sqluser')
output is 0. ...
0
votes
1answer
139 views
Upgrade SQL Server 2012 Express to Evaluation Edition
Is there a way to upgrade an instance of SQL Server 2012 Express to SQL Server Evaluation Enterprise?
I tried using the SQL Server Installation Center and clicking Maintenance, and then Edition ...
0
votes
2answers
76 views
SQL Server sync databases between enterprise - web edition
We have an enterprise version of sql server 2012. we need to synchronize its data to a web edition database. what would be the best option t do this ? further to add on to this we need to provide ...
1
vote
1answer
122 views
Backup stored procedure for full, differential and log backup
I wrote a simple stored procedure for backing up FULL, Differential and LOG backup. This is my stored procedure:
Alter PROCEDURE BackupDB
(
@BaseLocation varchar(1024),
@BackupType ...
1
vote
0answers
59 views
sp_testlinkedserver taking long time to time-out
I'm using the following code to check if a linked server is available before running queries on it:
declare @srvr nvarchar(128), @retval int;
set @srvr = 'my_linked_srvr';
begin try
exec @retval ...
2
votes
2answers
277 views
When is it appropriate to use SQL Server Developer Edition?
Do you use SQL Server Developer Edition on server-class machines in DEV and STAGING environments?
I am working on a large project where (if it passes the proof of concept stage) we will have several ...
2
votes
2answers
50 views
How do I write backup procedure
I've read that a decent backup strategy would be:
1) Full backup weekly
2) Differential backups daily
3) Log backups every 5 minutes.
Now question is how do I write this stored procedure and create ...
6
votes
1answer
137 views
How do you move a SQL Server 7 database to SQL Server 2012?
I would like to move a database from SQL Server 7.0 to SQL Server 2012. They are not compatible for a backup and restore. Is there a way to export from SQL Server 7.0 and import it to 2012? I only ...
0
votes
1answer
34 views
Accessing a SQL Server Denali CTP1 database with Management Studio 2012 SP1 Express
I had Management Studio 2011 Denali CTP1 installed before but I have uninstalled it.
Now I have installed the Management Studio 2012 SP1 Express without any database instances.
I have a webserver ...


