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
1answer
54 views
+150

Why does my query search datetime not match?

select * from A where posted_date >= '2015-07-27 00:00:00.000' and posted_date <= '2015-07-27 23:59:59.999' But the result contains a record that has posted_date today: 2015-07-28. My ...
1
vote
2answers
45 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 ...
0
votes
0answers
6 views

How to Create Insert Statement from Table Data using sp_export_data without Id?

How to Create Insert Statement from Table Data using sp_export_data without the Id? I have the following statements and want to omit the Identity. How would I accomplish this? This is how I'm ...
7
votes
3answers
311 views

Find the identity of the client firing a query in SQL Server without using triggers?

I'm currently using Change Data Capture (CDC) to track data changes, and I wish to track the host name and IP address of the client submitting the query that made the changes. If there are 5 different ...
0
votes
0answers
27 views

SSRS Migration 2008 to 2014 - InternalCatalogException secDesc != null

We're migrating side by side from SSRS 2008 Web to SSRS 2014 Enterprise. I followed the steps: backup encryption key backup databases (ReportServer and ReportServerTempDB) restored databases on 2014 ...
1
vote
0answers
12 views

Can i use PGP for securing My database

I have considered TDE and cell level encryption mechanism for securing my database. but these two cannot fully satisfies my requirements.through surfing i found that PGP may help me, but it is mainly ...
0
votes
2answers
27 views

SQL Server 2012 window function

I've the following table which holds status of jobs in a history table. JobHistory jobOrderId | dateAdded | Status -----------|-------------------------|------- 4909 | 2015-08-26 ...
3
votes
0answers
12 views

Unable to uninstall Sql Server 2012 Express (With SP1)

My Stack: . Windows 10 Enterprise . SQL Server 2012 Express (with SP1 bundled). ISSUE: . Installed SQL to test for backward compatibility. . When I tried to Un-Install the following prompt is ...
2
votes
1answer
28 views

Can SQL Server Audit be used to track hostnames or IP adresses of the users performing DML on a table?

I have been reading about SQL Server Audit, and so far I have assimilated that it tracks the command that has been executed, and some other additional information(SPID, object ID and stuff). But can ...
3
votes
0answers
28 views
+100

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 ...
1
vote
0answers
35 views

Uninstalling MS sql server 2012 issues

I'm trying to uninstall ms sql server 2012. But when I click Microsoft SQL Server 2012(64 bit) and choose remove option it shows like this. Then how can I remove the MS SQL Server 2012? Please help. ...
0
votes
0answers
8 views

Sql Server remote connection to 2nd instance impossible

After installation of another SQL-Server 2014 instance to a server where a default instance of Sql-Server 2008 R2 is present, I cannot remote connect remote to the new named instance. The default 2008 ...
7
votes
2answers
111 views

Should I mark a composite index as unique if it contains the primary key?

Given some table with a primary key, e.g.: CREATE TABLE Customers ( CustomerID int NOT NULL PRIMARY KEY, FirstName nvarchar(50), LastName nvarchar(50), Address nvarchar(200), Email ...
4
votes
4answers
125 views

Routing data from one SQL Server to another

Is there a way in SQL Server 2012 to have data being written to one table routed to another SQL Server on another host? To clarify, we are using Hibernate Envars to write audit logs. Hibernate Envars ...
3
votes
2answers
42 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 ...
1
vote
1answer
217 views

Can we use TDE as an anti-injection technique

TDE prevent unauthorized access to the data by restoring the files to another server, because it requires the original encryption certificate and master key. If i applied a table level encryption ...
2
votes
1answer
117 views

Updating large table worked before, now taking hours

BACKGROUND: I am using a non-production SQL Server to manipulate a large data set and run a few basic calculations. The original data file I have, which is about 30M rows, is missing records (not ...
18
votes
5answers
391 views

In Sql Server, is there a way to check if a selected group of rows are locked or not?

We are attempting to update/delete a large number of records in a multi-billion row table. Since this is a popular table, there is a lot of activity in different sections of this table. Any large ...
6
votes
3answers
71 views

Totals(sums/counts) across multiple child tables query optimization

We have 12 types of expenses in our database, some have fairly differing data minus the Amount fields. We have multiple places in the application and reports that require single and multiple expense ...
0
votes
1answer
103 views

Can scheduled and continous replication configurations exist side-by-side on the same master/slave servers?

Environment We have a core sql server cluster. This cluster contains some databases that get replicated to a load-balanced sql cluster of currently 3 servers. These databases are replicated each 12 ...
3
votes
1answer
30 views

sql server deadlock error - Shared (S) and Intent-Exclusive (IX) locks under Serializable isolation

Deadlock errors such as below happen frequently on our 3rd party vendor database: <?xml version="1.0" encoding="utf-8" ?> - <deadlock-list> - <deadlock victim="process743288"> ...
1
vote
1answer
33 views

How to measure the performance improvement that NUMA brings?

I am testing how one of our stored procedure is working on SQL Server Standard vs SQL Server Enterprise editions. I have created two virtual machines and install a SQL Server(SQL Server 2014) and ...
0
votes
0answers
9 views

Replication from log shipping database

I have a secondary database on a standby and read only mode. The question is .. Can I replicate this database ?
0
votes
1answer
19 views

Restore / Create a database with a data file (MDF) from backup the same but with two data files (MDF and NDF)

I must restore/create a db (in a new instance) in one file(mdf) from a backup of the same but with two files of data (mdf and ndf) How can I do it? This is what I try... but it did not work ...
3
votes
1answer
93 views

Select where bit is not 0

I have made the following query to select a record that isn't 0. SELECT * FROM Table WHERE Bit != 1 OR Bit IS NULL; Why is the check Bit != 1 not enough for a nullable BIT?
2
votes
1answer
59 views

Using a Linked Server to import data from Excel

I have read a lot about linked servers being bad when there are multiple hops across servers and distributed joins. What if I am just using a linked server to import data into SQL Server from an ...
9
votes
1answer
102 views

Why my database mirror break down after changing file group settings from RESTRICTED_USER to MULTI_USER?

My environment is the following: VMWare 5.5 vitalized server MS Windows Server 2008R2 Enterprise domain and SQL Server 2008 R2 Enterprise. Centralized storage with fibre-channel connection. I have ...
-2
votes
1answer
28 views

How to give a user “create any database” permission in SQL Server? [on hold]

Is it different from the dbcreator permission? Can anybody explain the process?
1
vote
1answer
23 views

Where does SSMS Last database backup date come from?

The backup date for several of my databases do not appear in msdb.dbo.back upset yet the correct date appears in SSMS when I select a db name, right click, properties, there in the general tab is the ...
1
vote
1answer
15 views

Is it okay to clear SQL Server Buffer every weekend or month end?

We have started using SQL Server 2014 Enterprise edition on our new server having 32 gigs of RAM, and in less than 3 weeks the server process is accumulated 13 GB and plus of RAM. Including IIS ...
3
votes
2answers
79 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
18 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 ...
0
votes
0answers
8 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
2answers
821 views

Identify rows that match on a key but differ in other columns [duplicate]

Supposed I have table temp A and table temp B: IF OBJECT_ID('tempdb..#A') IS NOT NULL BEGIN DROP TABLE #A END IF OBJECT_ID('tempdb..#B') IS NOT NULL BEGIN DROP TABLE #B END CREATE TABLE #A ( ID ...
1
vote
1answer
24 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 ...
2
votes
1answer
31 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
16 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 ...
0
votes
1answer
174 views

copying data from a SQL server-table to a SQLCE-table

I want to copy some data from a MSSQL table to a SQLCE table in database.net. I used the following query, connected to the MSSQL db; update [SQLCE-table] ([column]) SET (column) FROM [MSSQL] I keep ...
6
votes
1answer
20k views

Finding the last time a table was updated

The query: SELECT name AS TableName, create_date AS CreatedDate, modify_date as ModifyDate FROM sys.tables order by ModifyDate; ...will tell me the last time a table was created ...
0
votes
0answers
18 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 ...
0
votes
1answer
445 views

SQL Server replication - set PollingInterval in sp_addmergepushsubscription_agent

I am trying to create replication subscriptions to and SQL Server 2008 R2 via a script. There are 3 subscribers so this script creates the subscriptions by calling sp_addmergesubscription and then ...
5
votes
1answer
2k views

How to restore replication after server crash

We had two databases on one SQL Server 2005 instance with transactional replication between them (3 tables as articles). This server acted both as publisher and distributor. Then the RAID on the ...
2
votes
2answers
173 views

Replication error after server name change

I have changed the computer name of the server where SQL Server 2008 R2 is installed. Old name was WIN-OUJEKRMGXXX New server name is KASURDYYY When I try to configure replication, the following ...
3
votes
1answer
144 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 ...
1
vote
0answers
58 views

Step by step establish a connection between SQL Server 2014 and Oracle 12c

I have two servers (both servers are on Windows OS): Server_A running Oracle 12c Server_B running SQL Server 2014 I want these servers to be able to see each other, so I can SELECT anything I want ...
7
votes
1answer
147 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 ...
2
votes
0answers
26 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 ...
6
votes
3answers
333 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. ...
4
votes
3answers
84 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 ...
1
vote
1answer
110 views

How to create a dummy Linked Server in SQL Server 2012

I have a database in two different production servers. I want to keep the schemas consistent between the two. One has jobs that call stored procedures that reference a Linked Server. The other does ...