All versions of Microsoft SQL Server (not MySQL). Please also add a version-specific tag like sql-server-2016 if that is relevant to the question.

learn more… | top users | synonyms (2)

3
votes
1answer
125 views

Create table in Oracle as select from SQL Server - varchar size

I am trying to create table in Oracle 11g as select from a table in SQL Server 2012 via database link. The table in SQL Server contains column: hslakkis varchar(3) In Oracle it created the table ...
6
votes
2answers
137 views

SQL server Database statistics degrading after execution

I have been experiencing timeouts while querying my SQL Server DB in particular one table. I tried updating the statistics and it fixed the performance issues for a couple of days. I started digging ...
7
votes
2answers
198 views

Transparent Data Encryption

Are there any best practices when configuring TDE in SQL Server 2008? On SQLMag, the article "Transparent Data Encryption FAQs" says the CPU may have increased usage by up to 30%? Other than adding ...
9
votes
1answer
438 views

Where does an execution plan come from?

Is there a way I can determine if a plan was just generated for a particular query, or was found in the plan cache?
0
votes
2answers
15 views

Enable user access to all DBs and tables in MS SQL server managment

I create a new user in MS SQL via MS SQL server managment in / SECURITY / LOGINS part. User is set and can connect , however dispite the fact he see all databases he can get data just from one of ...
-2
votes
2answers
35 views

Migrate a table from MS Access to SQL Server 2012? [closed]

How to migrate a table from MS Access to SQL Server 2012? Suppose I am inserting data in MS Access, how will it get upgraded in SQL Server 2012 without dropping or recreating a table?
0
votes
0answers
22 views

I am seeing 99 archives of the same SQL Server errorlog

On my dev SQL Server 2014 sp1 instance, I have configured 99 archives of the errorlog. After a bounce, I am seeing 99 archives of the previous errorlog with the same timestamp. This appears to be a ...
7
votes
1answer
182 views

Improving a DbGeography query

I am still new to database administration and I'm trying to optimise a search query. I had a query which looked like this and took 5-15 seconds to execute in some cases, and also was causing 100% CPU ...
0
votes
0answers
66 views

sqlevn70.rll - Failed to Load Format String for Error 345

I have been receiving the following alerts from this error message as shown below: Operating system error: 317(The system cannot find message text for message number 0x345 in the message file for ...
3
votes
1answer
200 views

Update multiple Ids when SET = (Sql Query)

I want to update multiple records however the value being set is based on the primary key of the given record. This is not an issue with a single record as I can use: UPDATE T1 SET A1 = (SELECT ...
6
votes
2answers
118 views

SQL Server Backup transaction error

Hi I am attempting to backup the transaction log file to setup mirroring in SQL Server I execute BACKUP LOG CUSTOMER TO DISK ='K:\JonDB\CUSTOMER.trn' WITH INIT GO And I receive Processed 6587361 ...
3
votes
1answer
50 views

Is it possible to use Change Tracking on a Replication target?

We have a setup where the production SQL Server databases are replicated to an offsite location using SQL Server Replication (transactional replication). I am looking at using SQL Server Change ...
3
votes
1answer
112 views

SQL Server 2014 Always On .. can i have replication without a listener

I am still a novice with SQL Server Always On, having recently converted from a standalone server to an always on configuration. I currently have 2 nodes in the same subnet configured in my ...
0
votes
0answers
45 views

database design for a filing system in educational website

i'm designing a database for a filing system in educational website. user can upload files ( files_table) user has a library (library_table) user can add a file to his/her library each library ...
0
votes
0answers
54 views

SQL query for 3 table combinations using multiple full outer joins

I have a multiple full outer join query that I am trying get working. The code is in a SQL Fiddle and basically I'm trying to get 3 tables of data and 1 many-many join table to output the results ...
5
votes
2answers
137 views

Is execution plan cached “better” for stored procedures than for a non-dynamic query?

Reading different explanations about execution plan caching by Microsoft SQL Server, I'm confused about the benefits of using stored procedures instead of non-dynamic queries. By a non-dynamic query ...
7
votes
3answers
103 views

SQL Server: Using Dual Databases for Performance?

We have a SQL database that stores application usage logs for about 3000 PCs. These PCs send their usage data to the SQL server around 10-20 times per day. We used to store only the most recent 60 ...
1
vote
1answer
77 views

How to set SSIS flat file connection row delimiter to blank line?

I have a text file with the following format: DataColumn1 DataColumn2 DataColumn3 DataColumn1 DataColumn2 DataColumn3 DataColumn1 DataColumn2 DataColumn3 Each row with text in the file delimits a ...
1
vote
1answer
28 views

General info on Resources for Running MSSQL Queries [closed]

Does anyone know of online or otherwise resources for running queries? My copy of MSSQL did not install correctly, after many attempts on my part. Does anyone know of any resource in which I can ...
3
votes
0answers
180 views

SQL Server 2014 log file very large [duplicate]

I have a database with a memory optimized table and table partitions. The log file is over 300GB in one .ldf file, and another 40GB in another. I have tried shrinking the db, files, log DBCC ...
0
votes
0answers
18 views

Shrink Database in SQL Server [duplicate]

I have 700 GB database and I want to shrink it. What are the risks of this operation and my data will be deleted during this operation ?
4
votes
1answer
70 views

NOT IN (together with join) query

I have two tables : Part, OrderLine: Part (PartNum PK, PartDesc, Price) OrderLine (OrderNum PK, PartNum PK, QtyOrdered) And I want to find out the parts that were not ordered. I think I have a ...
10
votes
4answers
848 views

Where to start to understand a unknown database

So, the title sums it up. I've got a SQL Server database with 28 tables and 86 stored procedures that must be reverse engineered. I'm pretty sure that some tables are never used and that not all ...
0
votes
2answers
100 views

SQL server 2012 service pack installation

which service pack I should apply first after installing sql server 2012 enterprise edition either sp1 or sp2 ? Thanks in advance.
0
votes
1answer
98 views

Getting a logical consistency-based I/O error error in sql server

I am using SQL Server 2008 R2. My server got accidentally shutdown. After restarting it, I am not able to access my database. I am getting the following error for a few tables: SQL Server detected ...
2
votes
1answer
50 views

SQL Server 2008: Unused Clustered Index

I have an MS SQL Server 2008 R2 database that contains a table that has just under 100 million rows & is both read and write heavy. It contains Tweets, and the id of each Tweet is one of the ...
3
votes
1answer
62 views

Copy SQL DB files/backups

We have a task to copy 2TB of DB files/backups over LAN in a most efficient and speedy way. We are brainstorming amongst our team to come up with a best solution. These files are multiple backups and ...
2
votes
1answer
24 views

Detail of all transactions on a specific row

I've a User table and It's data can be added/ updated from a User Screen. I want detail of all transactions on any row. For example, I have data in table like this Name - Age - Salary ...
3
votes
0answers
51 views

Proc Cache Drop Assistance [duplicate]

We are noticing performance issues with one of our applications. When the application issues begin the procedure cache size goes from 4.5GB to 0. The plans are then rebuilt and still the application ...
5
votes
4answers
211 views

Implicit conversion warning despite persisted computed column vs. performance hit from UDF in persisted computed column definition

I have a need for a computed column to resolve an implicit conversion problem. I have a column that is declared as a VARCHAR that should only ever store integers, but is occasionally populated in ...
8
votes
3answers
159 views

Tuning query with multiple joins

i have this query .. 214 Execution/min , 44.42 Avg CPU(ms) is there a way to make it much faster SELECT P.Id id0, P.ProgramId ProgramId1, P.ProgramName ...
23
votes
1answer
310 views

Is the eager spool operator useful for this delete from a clustered columnstore?

I'm testing deleting data from a clustered columnstore index. I noticed that there is a large eager spool operator in the execution plan: This completes with the following characteristics: 60 ...
0
votes
0answers
65 views

How do you stop an SSIS when an empty text file is processed

I have an SSIS package that pulls a file from an SFTP server, decrypts it, pushes it into a table, then merges into a text file, on to uploading to another SFTP server. This package runs flawlessly ...
-2
votes
1answer
27 views

Account AppUser not able to access SQL Server Agent job “AppSQLAgentJob”

I have added appUser to SQLAgentUserRole and have granted him below permissions grant execute on dbo.sp_start_job to appuser ; When I am trying to run AppSQLAgentJob, I am getting following error "...
7
votes
2answers
387 views

DBCC CHECKIDENT ('table name', RESEED, 20000) not working

When I run the script DBCC CHECKIDENT ('table name', RESEED, 20000) the output of the message is Checking identity information: current identity value '200000', current column value '...
1
vote
0answers
22 views

Changing the Replication Distributor Server

Scenario: We have Server A, a current distributor server that also does some publishing (but not the exclusive publisher servers). We have servers C, D, E, F and G. All of these are subscribers to ...
1
vote
0answers
146 views

Database Mirroring: Cannot set witness in Microsoft SQL Server 2014 using Azure

I am using Azure. I am unable to connect to a witness server though Microsoft SQL Server 2014 for database mirroring. Everything I have researched seems to point to this article https://support....
9
votes
3answers
347 views

What is the use of restore headeronly when performing a backup?

When I monitor my backups with the following query: SELECT command, percent_complete, 'elapsed' = total_elapsed_time / 60000.0, 'remaining' = estimated_completion_time / ...
10
votes
1answer
3k views

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

I'm using SQL Server 2014 - 12.0.2269.0 (X64) on Windows Server 2012 and I'm experiencing some memory issues. When I run a stored procedure that is doing a quite "heavy" calculation, I get an error ...
5
votes
1answer
50 views

Which type of repair level is “DBCC CHECKDB (databasename, repair)”?

The MSDN's article about the command "DBCC CHECKDB" explains three ways to perform a database repair in the syntax section: - REPAIR_ALLOW_DATA_LOSS - REPAIR_FAST - REPAIR_REBUILD But I found the ...
2
votes
1answer
101 views

Inner Joins between Subsets of the Same Table

All, I am trying to figure out the syntax for doing joins between subsets of the same table. I have: Employee ( EmpId PK , EmpFirst, EmpLast, EmpMid, DateHired, SSN, DateBirth, Gender, PhoneNum, ...
3
votes
1answer
45 views

How to handle Schedules when moving Jobs to another server?

We are migrating our SQL Server 2008 R2 to another physical server. For this, I will script out all jobs and run it on the target server. My question is about handling the schedules: When a job is ...
3
votes
1answer
35 views

Setting rowlock order

We have a deadlock issue in our environment. We need to select some rows and then update them. Those queries are very frequent so we use a rowlock and updlock hints in select statement. Those queries ...
3
votes
0answers
33 views

Incremental statistics with failover

We have two AlwaysOn availability replicas - secondary readable. We do have an incremental statistics on a large table. When a failover happens, SQL Server tries to update statistics on that table ...
-4
votes
1answer
46 views

Why all ranking is 1 for this query [closed]

Declare @ranking_term char set @ranking_term ='Amount' select case (@ranking_term)when'Amount' then ( select Dense_rank() over (order by Amount desc) ) else( select ...
6
votes
1answer
41 views

Update an Indexed View “Online”

Say I have an indexed view that looks like this: ALTER VIEW dbo.MyIndexedView WITH SCHEMABINDING AS SELECT ord.SomeColumn, COUNT_BIG(*) AS Count FROM dbo.Ordered ord WHERE ord....
11
votes
2answers
58 views

Why do my Batch Requests increase when doing a Differential Backup

I have started doing some long-term tracking of various activities on our 2012 SQL Server and I have noticed an increase in Batch Requests during our incremental backups. To give an idea, normal day-...
6
votes
1answer
48 views

Indexed (Materialized) View for Parent and Newest Child

Say I have parent->child tables setup. Call them Shipment and Widget. Is there anyway to create an Indexed view that will have the PK of the parent (ShipmentId) and the created when of the newest ...
7
votes
0answers
232 views

How to reload a linked server?

I am using Microsoft SQL Server 2014 Enterprise Edition. A problem occurs with the linked servers where it is necessary to restart the server, or to stop the MSSQLSERVER service. When the server is ...
10
votes
1answer
154 views

Computed Column Index Not Used

I want to have a fast lookup based on if two columns are equal. I tried to use a computed column with an index, but SQL Server doesn't seem to use it. If I just use a statically populated bit column ...