Microsoft's SQL Server is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It originated from the Sybase SQL Server codebase, which is why both products use the extension of SQL called Transact-SQL (T-SQL).

learn more… | top users | synonyms (2)

1
vote
0answers
7 views

SQL AlwaysOn Availability Groups network performance

Our customers are asking to implement our products while configuring AlwaysOn Availability Groups ( between two FCI with Asynchronic commit ). The DR server is geographically far from the Production ...
1
vote
2answers
4 views

TDE on Replicated Databases

I have implemented Master-Slave replication between two databases, now i have to implement Transparent Data Encryption(TDE) in master database. is it possible to implement TDE in master only? whether ...
1
vote
0answers
5 views

Using sp_getapplock to implement a queue. Is it correct? Is there a better way?

I've been reading a series of posts by Paul White about SQL Server Isolation Levels and came across a phrase: To emphasise the point, pseudo-constraints written in T-SQL have to perform ...
0
votes
0answers
3 views

SSDT project with working linked server references

I have a VS 2013 solution with two databases. One of them is supposed to got to about 10 of production servers. The other ohne will have a linked server object for each production server and will ...
1
vote
1answer
19 views

Whay does the SQL Server Service account has the “”Impersonate a client after authentication" Right?

Our database is running on SQL Server 2008 hosted on a Windows 2008 Server. We have found that the security policy “impersonate a Client after authentication” is enabled for the SQL Server service ...
0
votes
0answers
12 views

Howto avoid queries to get considered in statistics [duplicate]

Is it possible to run my (administrative) queries in a way that they do not get considered in Sql Server statistics like e.g. Cpu intensive queries, long running queries etc.? Is there an option like ...
2
votes
1answer
26 views

How to create test environment for lost transactions

I have a problem that I hope you can help me to solve. I'm using SQL Server 2008 R2. I need to create a test environment in which I'll be able to artificially 'create' lost transactions. Due to ...
0
votes
0answers
15 views

Compare 2 tables and display only the columns that do not match [duplicate]

I wanted to compare 2 identical tables and displat only the columns that do not match.. Suppose I have table temp A and table temp B, IF OBJECT_ID('tempdb..#A') IS NOT NULL BEGIN DROP TABLE #A END ...
3
votes
1answer
131 views

Is REPEATABLE READ the right choice for validation before modifying data?

In my database I have a Task table. This table has a number of fields that are foreign keys to other tables. There are also a few link tables, that have Task on one end. When a new task is created ...
6
votes
1answer
127 views

Is there a performance difference in committing and rolling back a read-only transaction?

I open a (repeatable read) transaction (BEGIN TRAN) to do some work on certain records. First thing I do is checking if the data I need to change is in the database. In some cases there will be and ...
0
votes
0answers
9 views

What does a blank DQS Status column mean?

I'm attempting to use a DQS Transformation in SSIS to harmonize geographic data. For each column being cleansed, there are three output columns- _Source, _Output and _Status. The _Status column ...
0
votes
1answer
32 views

Index planning for many columns with different usage

I've a table with 80 columns and that is a base table for most of the application. Daily load inserts almost 8,000 records and update upto 2,000 records. This table is now having more than 5 million ...
-2
votes
2answers
48 views

What does the FullAccess. infront of table mean in SQL Server query? [on hold]

What does the "FullAccess" in the below query refer to? I have a table named ReceivedClaimFact but I do not have any Schemas named FullAccess in my Database. The query runs successfully though. ...
1
vote
1answer
15 views

Query Relating Rows W/O A Corresponding Value

I have a table setup like this: ID Code DateActive DateInactive statusCode 15 20090413 null A 15 null 20090416 I 15 20100101 ...
0
votes
0answers
33 views

SQL Server : create table within stored procedure

I have a stored procedure that will be run by a user with public permissions. When operational, it will be called from an Excel spreadsheet and the results presented on a given tab. The procedure has ...
2
votes
0answers
22 views

How do I provide a failsafe for retrieval of data from excel to SQL

So say there is a process in place for importing data from excel spreadsheet to SQL using SSIS. And there are two tables, one with new data and one with data from its previous run. I sometimes have ...
2
votes
0answers
25 views

SQL Server 2014 Avaliability Group DbMgrPartnerCommitPolicy

I have an environment with 2 Windows Server 2012 R2 servers, both with SQL Server 2014 Expensive edition. Whenever a change happens in the AGs (such as: AlwaysOn Availability Groups connection with ...
-1
votes
0answers
32 views

How can I take table as input dynamically from user?

I am new to SQL server and want to take table name and column names as input from user dynamically. Also, need to perform cursor implementation of comparing records on it. I have completed the ...
8
votes
1answer
107 views

How to set up indexed view when SELECTing TOP 1 with ORDER BY from different tables

I am struggling to setup an indexed view in the following scenario so that the following query performs without two clustered index scans. Whenever I create an index view for this query and then use ...
-2
votes
0answers
18 views

Upgrade from SQL Server Express Edition to SQL Server 2008 R2 [on hold]

Can I upgrade from SQL Server Express to SQL Server 2008 R2? If there is away can you please provide the steps for me.
2
votes
0answers
9 views

Does RSS Profile has an effect on SQL Server with NUMA setup?

I'm curious whether the RSS Profile which is default NUMAStatic on Windows 2012 R2 could/should be changed for SQL Server with a NUMA setup. Has anyone done performance benchmarks on high load SQL ...
4
votes
1answer
43 views

Select when group by contains more than one row with the same value?

I am trying to write a query that returns one row from table A whenever a column in joined table B contains multiple distinct values for a single matching row in table A. (A -> B is a 1 -> many ...
0
votes
0answers
11 views

Cannot Generate SSPI Context Error [duplicate]

I have a weird situation, in my instance i created 2 AG (AG1 and AG2) using the same service account. for couple of both are working fine connecting to Listener1 and Listener2. Last week, one of the ...
1
vote
1answer
45 views

Aggregation by positive and negative values

I have a table called "PROD_COST" with 5 columns: +----+----------+------+-----------+-------------+ | ID | Duration | Cost | COST_NEXT | COST_CHANGE | ...
0
votes
0answers
9 views

Connection between SQL Server 2014 and Oracle 12c [duplicate]

I have to server: 1.Server_A with Oracle 12c 2.Server_B with SQL Server 2014 I want these servers see each other, though I can SELECT anything I want in Server_A from Server_B and vice versa. I ...
2
votes
0answers
24 views

SQL Server Always On Failover Cluster Design

I have two databases. One I'd like to set up in an availability group between two servers (two instances, one on each server). The database is not huge and I'm not expecting it to grow ...
5
votes
2answers
37 views

Allocation strategy where tables regularly grow and shrink by large amounts

I have a SQL Server 2014 database with 100+ tables that have a 5% growth rate over the course of a year. Lots of reading, very little writing. This database is going to expand by another set of 20+ ...
2
votes
1answer
73 views

What server configuration and database should I use?

I am new to Database's and want to work toward installing a Database in the small company I work at for production and eventually other uses. The company has only 15 employee's and three departments. ...
0
votes
0answers
16 views

Sql Dependency with Service broker working fine when sql server presents local system but its not working when database is at remote system [on hold]

I have an application which uses sql service broker and sql dependency in c# application. Its working fine when my database is at the local machine but it does nothing when the database is at remote ...
2
votes
1answer
55 views

Remote access to SQL Server 2008 R2 on Windows Server 2012 R2?

I have SQL Server 2008 R2 (named instance) on a Windows Server 2012 R2: Enabled remote access to SQL Server Enabled shared memory & TCP/IP protocols & named pipes for the SQL Server ...
6
votes
1answer
166 views

Azure: Many Failed Login Attempts Logged

I run a SQL Server on an Azure Virtual Machine. I have noticed in the Event Logs of the server lots of failed SQL Login attempts using a ton of different usernames (none of which exist): Login ...
0
votes
0answers
24 views

Event 17058 - initerrlog: Could not open error log file (SQL Server)

I'm new to SQL Server and encountering an error when running sqlservr.exe (Microsoft® SQL Server® 2008 R2 SP2 - Express Edition) Error 17058, Severity: 16, State: 1. initerrlog: Could not open ...
0
votes
0answers
25 views

Sharing a database over the local network [migrated]

We have some plate nesting software at work which I use daily. Recently, I thought I'd try to get the shared database up and working so the boys in the workshop could use the software on another PC ...
-4
votes
0answers
24 views

SQL Server stored procedure clockin [on hold]

How to create a stored procedure with clockin, clockout columns and I want to show the time worked from them and the min_leave_time when user clockin and out for breaks on a 8 hr. shift with lunch ...
4
votes
3answers
83 views

Return even empty groups when grouping by date

I have the following query: SELECT DISTINCT COUNT(CD_BarCode) ,CD_Carrier ,SUBSTRING(CONVERT(VARCHAR,DT_Arriving,103),1,11) Date FROM TB_AGIL WHERE ...
2
votes
1answer
52 views

RAID 10 array configuration for SQL Server

I have a question regarding RAID 10 and SQL Server. My plan is to purchase an HP DL380 G9 with the 24 drive config. The question is how to break up the array. The drives will be divided between the 3 ...
6
votes
3answers
318 views

Tell SQL Server a query is ad hoc and not to optimize based on it

Is there a way to run a one-off query against a production SQL Server database and tell it not to make any future judgments based on that query. E.g. Store execution plans, recommend indexes, etc. ...
2
votes
2answers
63 views

Add a flag when certain conditions are met

I have a table where when an employee works LEAVE1 and LEAVE2 paycodes on the same day then in the new column called 'FLAG' we need to put a 1 for LEAVE1 and a 2 for LEAVE2, when these paycodes are ...
2
votes
1answer
27 views

Availability Group environment clone

I've been assigned a project where we have an active secondary environment that I'm confident that Availability Groups would address but have some questions that I hope someone can answer for me. ...
0
votes
2answers
54 views

How to create Date table

I have problems when I try to create my DimDate. That's what I have tried: CREATE TABLE [dbo].[DimDate] ( /*[ID] [int] IDENTITY(1,1) NOT NULL--Use this line if you just want an ...
1
vote
0answers
31 views

Transactional replication taking hours to replicate

I have a bunch of tables replicated from my_publisher to my_subscriber via my_distributor. Some of these tables, not all of them, when updated on my_publisher, take a couple of hours to be updated on ...
4
votes
1answer
178 views

Running a SQL Server query with as little impact as possible

I'm looking to create some basic scripts that are aimed at running on production systems. I want them to run with as little impact as possible. They shouldn't affect performance whenever ...
3
votes
3answers
41 views

Finding out what permissions are required by the SQL Server Agent Jobs

I've been looking at this for a while and I can't work out an easy way to do this. As it stands every job in the database runs under SA level rights (horrifying thought) I'm sure some of the jobs ...
3
votes
1answer
188 views

Gigantic gaps in IDENTITY column

This question is about strange behavior in SQL Server 2008 R2 SP3 Standard Edition x64. I have read many questions about IDENTITY increments in SQL Server and strange gaps between them. But basically ...
2
votes
1answer
37 views

Meaning of SERVERPROPERTY ('ResourceLastUpdateDateTime')

I have researched a while, a lot of articles name it and tell us to use it - but none really explains the meaning of the date and WHEN exactly it changes. Does anyone know? Samples for articles not ...
3
votes
1answer
27 views

Wide clustered index vs multiple narrow nonclustered indexes?

Say I have a contrived Student table like so: CREATE TABLE Student ( Id IDENTITY INT, SchoolId INT NOT NULL, FirstName VARCHAR(20) NOT NULL, LastName VARCHAR(20) NOT NULL ) ...
-1
votes
3answers
24 views

Selecting multiple rows as one row with “AS” [on hold]

If I have a table of users, for example, and I want to include the users in a query like so: SELECT gameId, player1id, player2id, users.username as player1, users.username as player2 FROM players, ...
0
votes
0answers
34 views

SQL SERVER 2014 windows administrator locked and sa password lost [duplicate]

I am missing the sa password for a SQL Server 2014 instance. Unfortunately the Windows Administrator user is also locked. How can I reset my sa password?
1
vote
0answers
66 views

Routing data from one SqlServer to another

Is there a way in SqlServer 2012 to have data being written to one table routed to another SqlServer on another host ? To clarify, we are using Hibernate Envars to write audit logs. Hibernate Envars ...
2
votes
1answer
62 views

Scramble the data output of a stored procedure

I have a stored procedure that produces data for a call center system every morning. However, the data is sent in the same order daily. Is there a way to send the day in a different order every day ...