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

learn more… | top users | synonyms (3)

2
votes
1answer
48 views

How to use two actions and a function in an Extended Events Histogram for deadlocks?

I'd like to get a histogram through extended events that shows the count of deadlocks per databasename by date, but I'm hitting two walls: How get a histogram to include two actions How to get the ...
2
votes
1answer
47 views

Does the query optimiser re-use usable data?

This question is to expand my knowledge on how the query optimizer of SQL Server works. I like to know how stuff works behind the scenes so I can better optimist it/debug it. I have the following ...
1
vote
2answers
101 views

How can I pass a list of databases to sp_MSforeachdb?

I have the following script that when run gives me a comma delimited list of database names. SET NOCOUNT ON declare @db_list NVARCHAR(MAX) DECLARE @command varchar(1000) ...
4
votes
1answer
93 views

Table Joined To Itself Appears Inefficient

My ultimate goal is to compare two rows (only two will exist) and for a specific type and determine if its rows values are greater than the other rows type values. The result I came up with seems to ...
0
votes
0answers
37 views

In SQL server sys.sp_datatype_info_90 running for more time

From where is the stored procedure sys.sp_datatype_info_90 being triggered, and how can I stop or avoid this in my environment? Does it affect my server performance in production? Is it common in SQL ...
2
votes
1answer
147 views

SQL Server access issue

I am trying to connect 3 SQL servers using SSMS from a different landing server. The issue is I am able to connect 1 server but unable to connect other 2. The error I get is below: A connection ...
1
vote
0answers
65 views

Force collation when querying Visual FoxPro through OPENROWSET

How can I force collation in the following DBF select statement: SELECT * FROM OPENROWSET ('VFPOLEDB','FilePath\FileName.DBF';'';'','SELECT * FROM FileName') I've tried with COLLATE to each ...
3
votes
0answers
63 views

Import from dbf - collation

I select data from dbf files through OPENROWSET Visual FoxPro OLEDB. Despite forcing collation on columns (e.g. SELECT name COLLATE Polish_CI_AS FROM Employees) the polish specific characters keep ...
5
votes
2answers
83 views

Confusing Query: Mixing Aggregates and Non-Aggregates

Hope someone can clarify how to do this query from SQL Server 2012, or maybe what it is asking; it seems I am being asked to do a query that combines aggregates with non-aggregates, leading to what ...
1
vote
1answer
83 views

Getting “There is already an object named 'Mytable' in the database” error

I keep getting the following message: Msg 2714, Level 16, State 6, Procedure tr_AuditTableChange, Line 9 There is already an object named 'Mytable' in the database. Not sure what I am doing ...
8
votes
4answers
529 views

Query to select max value on join

I have a table of Users: |Username|UserType|Points| |John |A |250 | |Mary |A |150 | |Anna |B |600 | and Levels |UserType|MinPoints|Level | |A |100 |...
0
votes
1answer
42 views

Max redo speed on replica side in Availability Group

I heard about maximum 50 Mb/sec for receive and 50Mb/sec for redo. But really, I have only 20Mb/sec redo speed. This is speed from Perfmon, so I know about the following issue: AlwaysOn ...
2
votes
0answers
85 views

List of windows firewall exception for sql 2014 cluster [closed]

I am setting up a SQL Server 2014 cluster in Windows Server 2012 r2 Standard edition. I need to identify the inbound/outbound ports to be exempt in Windows firewall. I have compiled some already ...
4
votes
1answer
94 views

Why is sp_update_alert failing?

In SQL Server 2012, I have a Job Agent Alert set up as follows: EXEC msdb.dbo.sp_add_alert @name=N'Deadlock Alert', @message_id=0, @severity=0, @enabled=1, @...
13
votes
2answers
3k views

Newer Version of SQL Server Less Stable?

Our database architect told a client of ours that SQL Server 2014 is a poor choice over 2012 because it lacks the performance and stability advantages that 2012 has. Everything I've read contradicts ...
3
votes
3answers
103 views

Is connection string's default database used if queries are run against other databases?

Let's say I have an app that uses this connection string to connect to a SQL Server using "DB1" as the default database (a.k.a. initial catalog): Server=myServerAddress; Database=DB1; User Id=...
6
votes
1answer
115 views

Index Allocation Maps

I am a developer reading the book "Querying Microsoft SQL Server 2012." I have come across the following diagram: Why are the pages in the first two rows of the diagram (row 1 starting: 1:174 and ...
3
votes
1answer
184 views

The transaction log for database 'database' is full due to 'LOG_BACKUP'. Nothing works

I have about 30 databases on SQL server 2012. One of the databases is erroring with "The transaction log for database 'database' is full due to 'LOG_BACKUP'." I have spent several hours googling and ...
0
votes
0answers
15 views

Odd service broker behavior

I have an established service broker relationship between two databases in our production environment. We do a weekly restore of these databases to another server for the purposes of testing our ...
2
votes
1answer
83 views

Behavior of case sensitivity of RAISERROR when run remotely

I have a remote SQL Server that I can connect to using a local instance of SSMS. When raising errors, we use RAISERROR( 'This works', 16, -1 ) Remotely, this works fine if it's all uppercase, or ...
1
vote
1answer
210 views

SSIS ODBC: Mapping result set columns to variables returns error “Value does not fall within expected range”

In SSIS 2012, I'm using an "Execute SQL Task" to call a stored procedure that returns a single row with two columns. I'd like to map that result set to two SSIS user variables. Should be easy, right?...
0
votes
0answers
52 views

Timeouts on Full-Text Search when using CONTAINS(*, 'value1 OR value2 OR … valueN')

I have an odd problem when using the Full-Text Search in combination with CONTAINS on all columns (without specifying the column where to search). The problem is when I specify more than 5 or 6 values ...
4
votes
2answers
62 views

How to create a view with added rows for missing dates?

I'm not sure how to accurately phrase this question. Essentially, say I have a bunch of salespeople on different sales teams. Like, the Blue Region, the Orange Region, the Red Region, whatever. Now, ...
2
votes
1answer
89 views

How can I create a role to create,update,delete stored procedures and views

what permissions do I need to give in order to achieve the above task to get users the capacity to create,update,delete stored procedures and views to a database role.
1
vote
1answer
32 views

Can we create Fail over clustering for SQL Server 2012 standard edition on amazon EC2?

We are planing to move on amazon's EC2 services. So my question is that can we create fail over clustering on amazon EC2 using SQL Server 2012 standard edition ?
1
vote
0answers
37 views

SSIS: Trying to configure branching logic in Foreach loop

Full disclosure: I posted this on SQL Server Central yesterday but got no answers. I hope someone here can assist me. I'm working on importing flat files into a database. I have used a Foreach loop ...
0
votes
0answers
120 views

Why does OpenQuery hang for hours before raising Query timeout expired when query timeout on Linked Server is set much shorter?

In production have two SQL 2012 instances on separate servers, with a Linked Server set up between them. No problems there. In development, I have the databases for both in one 2012 instance, and have ...
-4
votes
1answer
43 views

SQL db deadlocks [closed]

could any one please tell me how to monitor SQL db deadlocks How to prevent deadlocks How to cancel deadlocks without restarting the service. really highly appreciate your information
1
vote
2answers
91 views

Referencing a SELECT subquery value in the WHERE clause

Complete query SET @vSelect = ' SELECT T1.BranchShortName AS BranchShortName, ( SELECT TT1.EmployeeName FROM [dbo].[...
2
votes
0answers
31 views

Very high avg_write_stall_ms for tempdb [duplicate]

What could be causing (and how to fix) my tempdb files (8 equal size) to have [avg_write_stall_ms] of 7300ms and the next highest data file is 47ms. System is Hyper-V fail-over cluster, SQL 2012 ...
4
votes
1answer
208 views

SQL 2012 CLR error: “The context transaction which was active before entering …”?

I am experience strange error with SQL 2012 and CLR: The context transaction which was active before entering user defined routine, trigger or aggregate "My routine" has been ended inside of ...
-4
votes
1answer
33 views

Can not connect to HP\SQLEXPRESS [duplicate]

Can not connect to HP\SQLEXPRESS a network related or instance specific error while spablishing a connection to sql server. The server was not found or was not accessible. Verify that instance name ...
0
votes
0answers
182 views

How to implement SQL Server Service Broker with external activator

I am trying to execute an external app using SQL Server Service Broker and the External Activator provided by Microsoft. I have created the following script: IF EXISTS (SELECT * FROM sys.databases ...
2
votes
0answers
26 views

Does Disabling Page Level Locking Have an Adverse Effect on Other DBs

I got the following from a vendor about what their software (“IM”) needs: “IM needs its own SQL Server Instance if the DB is installed on a shared SQL server. This is a mandatory prerequisite because ...
3
votes
1answer
214 views

How to Replicate data between a hosted database and a local database

I have a Cloud hosted Database, maintained by a different company. Here is my scenario: Cloud Hosted Database SQL Server 2012 - Need to connect through a VPN. We setup a local Server with with ...
0
votes
2answers
55 views

SQL With Multiple Condition and Column

I have 3 tables: Employee +----+--------------+--------------------+----------------+ | Id | EmployeeName | EmployeePermission | Position | +----+--------------+--------------------+------------...
3
votes
2answers
98 views

Modify linked server definition (Oracle) in SQL Server 2012

I have created a linked Oracle server in SQL Server 2012 using Oracle Provider for OLE DB and TNSNAMES.ORA (the Oracle database is clustered and, as far as I know, no other connection method works ...
3
votes
2answers
114 views

User has db_owner through AD group but cannot create table

We've setup a SQL Server 2012 Enterprise, and through certain domain user groups, users are granted access to several databases. For instance, group 'ADB' has for several databases following rights: ...
3
votes
2answers
235 views

Unable to create UNIQUE Filtered index with IGNORE_DUP_KEY = ON

I have a table , in SQL Server 2012 enterprise edition, for which I want to have a unique index with IGNORE_DUP_KEY = ON, however I only want this index (and ignoring the duplicates) to apply only to ...
3
votes
0answers
45 views

How to deal with Users Needing to Enter Mixed Data Types in MS SQL Server

I have a form in a C# application that I can't change with a data table bound to a query. The user enters a mark for a student's task or 'A' for absent. However, the person who designed this had the ...
3
votes
1answer
258 views

Error 909 restoring a database on Standard Edition

I ran into a problem with SQL Server 2012 Standard Edition (64-bit). I have rebuilt a system with the exact same specifications for software as it had been built previously (Windows 2012, SQL Server ...
4
votes
1answer
62 views

Advice on how to improve the efficiency of a stored procedure using lots of joins

I have a stored procedure that is returning search results for items in a database grouped by customers who own them. The user performing the search is restricted as to what items they can see by ...
-1
votes
1answer
45 views

SQL Server installation location [closed]

What is the best practice recommendations for installing SQL Server 2012 or 2014 with regards the installation files location. Can the installation files location resides on the system drive or should ...
0
votes
0answers
22 views

domain group is db_owner of database, yet has no right for CREATE TABLE

We've setup a SQL Server (2012 Full Enterprise), and through certain domain user groups, have given certain access to several databases. For instance, group 'ADB' has for several databases following ...
4
votes
2answers
119 views

SSIS OLEDB Command not firing triggers

Got a bit of a strange one that I can't seem to work out. We have a vendor database ( so we have no control over the table structure, foreign keys, etc...) that's on SQL Server 2012 SP2. We have a ...
2
votes
0answers
92 views

What is the correct way to rename/swap a table in production

I have two tables, tblCode and tblCodeAlternative tblCode has about 4100 rows and is used in production. tblCodeAlternative has about 4200 rows and is in the production database but not used ...
3
votes
2answers
973 views

Unable to create restore plan due to break in LSN chain

My backup plan is: Full backup - once a day Differential backup - every four hours Transaction Log backup - every 30 minutes. All database backup are stored on my computer. I add some wrong ...
5
votes
1answer
395 views

There is insufficient system memory in resource pool to run this query

Over the past year we have been suffering a situation where many different queries at the same time will fail with the following error (or a variation in a different resource Governor group): There is ...
1
vote
1answer
52 views

Do I need different linked server remote users?

I have inherited a project that uses a local Microsoft SQL Server 2012 Express Edition and a central SQL Server 2012 as a backup. There may be multiple local "machines"/databases that all are linked ...
2
votes
1answer
95 views

Get start time and end time of a trip in SQL Server

I have a table that contains zone in and out information about a bus, and its structure is like this: id zoneid status datetime 1 35 IN 2016-02-02 11:36:39 2 35 OUT 2016-02-02 11:36:...