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

learn more… | top users | synonyms (3)

1
vote
1answer
32 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.
0
votes
1answer
16 views

SQL Server 2012 - Powershell Agent Job Hangs

I have a SQL Server Agent Job on one of my 2012 SQL Servers which runs a powershell script inside the job step, where the 'Type' is set to powershell, and is running under the SQL Server Agent Service ...
1
vote
1answer
14 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
17 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
13 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 ...
-5
votes
0answers
31 views

I want to write query as per business requirement [on hold]

Universe Addition for Historic Data: Expired Contact Company Associations with companies as defined in universe, provided the record has either Committee or Compensation info, and belongs to Company ...
-4
votes
1answer
37 views

SQL db deadlocks [on hold]

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
3answers
44 views

Get Column Value from Subquery in Stored Procedure

In my stored procedure I got code like @Select = '... (Select ...) AS NAME ... AS AGE ... AS CLASS ' @Where = 'CLASS = ...' I can make validation ...
2
votes
0answers
30 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 ...
2
votes
1answer
29 views

Working SQL script fails to create objects when run as SQL Agent job

As a crude 'integration test' style environment, I am updating a copy of production with a delta script based on "development vs prod". The tool used to create said delta script is free, and as such ...
-2
votes
0answers
45 views

Want to setup full database in sql server 2012 [on hold]

I need to setup full database let say want to create tables, stored-procedures, cursors, functions etc. I have one xml file and all the related scripts. I need to know is there any way that I can ...
3
votes
1answer
33 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
24 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
25 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 ...
0
votes
0answers
32 views

While querying view using linked sever getting error as “Requested conversion is not supported” [on hold]

While querying a view using linked sever getting below error as: "Requested conversion is not supported." OLE DB provider "SQL11" for linked server "DB_SQL" returned message "Requested ...
2
votes
0answers
22 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 ...
2
votes
0answers
71 views
+50

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
50 views

SQL With Multiple Condition and Column

I have 3 tables: Employee +----+--------------+--------------------+----------------+ | Id | EmployeeName | EmployeePermission | Position | ...
3
votes
2answers
36 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 ...
0
votes
0answers
46 views

Slow application performance [on hold]

We are experiencing slow application performance on a couple of apps. We are on SQL Server 2012 Standard Edition 64 GB. This is installed on a Windows 2012 R2 server. The database is without mirroring ...
3
votes
2answers
29 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
165 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
37 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
49 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 ...
7
votes
3answers
79 views

Find the source of a recurrent mass SQL edit on a server

I'll try to explain my problem as clear as possible. The server of a company I support runs many websites. This server runs Windows Server 2012 with Microsoft SQL Server 2014. Almost all of the ...
4
votes
1answer
56 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
41 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 ...
4
votes
2answers
37 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
43 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 ...
8
votes
2answers
105 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 ...
4
votes
1answer
82 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
28 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
41 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 ...
2
votes
0answers
31 views

Could you please explain clustering in SQL server? [closed]

I'm new to clustering concepts. I would like to know more parallel processing with multiple DB nodes to have load balancing for the incoming requests. Our main goal is to achieve performance and lot ...
1
vote
1answer
33 views

Get Table Name from Transaction Log query

I can't figure out why this join isn't working to return the table name when querying the transaction log file. SELECT [Transaction ID], [Current LSN], PartitionId, sp.object_id, ...
6
votes
2answers
122 views

Selecting Distinct Rows but Counting All Rows

I have the following table: ---------------------------------------------- | ID | interestingData | timestamp | ---------------------------------------------- | 1 | 400 | ...
4
votes
1answer
248 views

'CONCAT' is not a recognized built-in function name

A client reported that they were running on SQL Server 2012, and we delivered some test queries for testing prior to a final delivery, however: 'CONCAT' is not a recognized built-in function name. ...
3
votes
1answer
62 views

Select data divided in groups evenly distributed by value

I would like to select into 4 groups the data from a table having the sum of a values in the groups as evenly distributed possible. I am sure that I am not explaining it clear enough so I will try to ...
5
votes
1answer
97 views

Datawarehouse indexing

I have a table with nearly 6m records. The business key that identifies a unique row is quite large. Our update processing is now taking a lot longer since I added this new table for a new cube. I ...
9
votes
5answers
268 views

Getting a scan though I expect a seek

I need to optimize a SELECT statement but SQL Server always does an index scan instead of a seek. This is the query which, of course, is in a stored procedure: CREATE PROCEDURE dbo.something ...
0
votes
1answer
29 views

Generic stored procedure for results sets comparison

Some of the tasks in my team are related to stored procedure optimization. I am mainly a .NET developer, but I thought of writing a generic procedure for data comparison while procedures are being ...
5
votes
1answer
84 views

First-In and Last-Out times for Night Shift Employees

I can get FirstIn - LastOut out of Day shift employee using min and max: select UserId, [date], min(convert(char(5), [Login], 108)) as FirstIN, max(convert(char(5), LogOut,108)) as ...
1
vote
2answers
167 views

How to use SET operation in CASE clause in SQL?

I have the following structure, and I'm doing a SET operation in a CASE clause but it is producing an error: Incorrect syntax near SET Query: DECLARE @tbl_Result TABLE ( RowID INT ...
-2
votes
1answer
38 views

I have created a zip file using 7z for backup but its taking time to open [closed]

I have created a zip file using 7z for backup but its taking time to open. Any possibility of making fast. Please suggest me.
0
votes
1answer
41 views

SQL Server 2012 Remote Access to Certain Users [closed]

Recently, I've started working on SQL Server 2012. As there is a risk in allowing anyone to access SQL Server remotely, I'm trying enable remote connections only to specific users within my developer ...
-1
votes
2answers
68 views

Calculating multiple medians

I have defined function with table value parameter which returns median as per values passed to it. Function defined as: CREATE FUNCTION [dbo].[fn_GetMedian](@List TypeMedian READONLY) ...
10
votes
1answer
153 views

Does CREATE TABLE SomeSchema.#TempTableName have a bug?

Simple test-bed: USE tempdb; GO /* This DROP TABLE should not be necessary, since the DROP SCHEMA should drop the table if it is contained within the schema, as I'd expect it to be. */ ...
2
votes
1answer
77 views

How to select a subset from a query result

I have a query which calculates the Time Difference and Distance Between the Next and Previous Row: SELECT * FROM ( SELECT iVehicleMonitoringId AS PreviousId, ...
-2
votes
1answer
42 views

why unable to execute table-valued function?

Here is table-value function I have declared like: CREATE FUNCTION fn_GetMedian(@List TypeMedian READONLY) RETURNS INT AS BEGIN RETURN ( Select ( ( ...
4
votes
2answers
343 views

How can I pass column to function in sql?

I'm calculating median as: DECLARE @TEMP TABLE ( ID INT ) Select ( ( Select Top 1 ID From ( Select Top 50 Percent ID ...