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

Transaction Log won't shrink, DB thinks it is replicating

I've got a database MSSQL2008R2Express DB running Kaspersky Security Center, and I have no idea under what circumstances the install happened, but the database appears to think that it's being ...
0
votes
0answers
17 views

Accessing SSRS receive System.UnauthorizedAccessException

Trying to log into localhost/reports I get the following error on the screen. An internal error occurred on the report server. See the error log for more details. (rsInternalError) Access is ...
2
votes
2answers
64 views

InnoDB inserts 100 times slower than SQL Server inserts

I have a simple table with two columns: id (autonumber) and name (char(255). When I use C# to insert 100 records in a loop it takes about 30 milliseconds per insert. This is way too slow. So I ...
3
votes
2answers
105 views

Stored Procedure slow after weekend

When I come to work on monday some stored procedures take several minutes to execute and STATISTICS IO shows a lot of PHYSICAL READS and READ AHEADS going on. However, after running the procedures ...
2
votes
2answers
52 views

Adding around 200 rows in a table grows size of the table by 400kb where avg row size is 0.2KB

We are running into an issue where if we look at the avg row size (0.2kb) x number of rows (200) inserted in one of our table, the size should grow by around 40 KB. However the total used space has ...
5
votes
2answers
2k views

Find which session is holding which temporary table

We have a SQL Server 2005 database the temp database has become full. By going into SQL Server Management Studio I can see all the temporary tables in the tempdb. Is it possible to tell which session ...
9
votes
2answers
270 views
+100

How to recursively find gaps where 90 days passed, between rows

This is a kind of trivial task in my C# homeworld, but I don't yet make it in SQL and would prefer to solve it set-based (without cursors). A resultset should come from a query like this. SELECT ...
2
votes
1answer
586 views

Inline edit SQL Server database rows from Visual Studio

I'm pretty sure Microsoft have pulled one of the most useful features for performing quick edits on a SQL Server Database within the Visual Studio IDE. It seems to have only affected SQL 2012 ...
0
votes
1answer
14 views

SQL Server 2008R2 - how to install replication components

I am trying to install the Replication components for SQL Server 2008R2, on technet website it says: 1.On the computer that is running IIS, insert the SQL Server 2008 R2, SQL Server 2008, or SQL ...
0
votes
1answer
22 views

Recover data from corrupt .mdf and .ldf files

The server was crashed due to some hardware problems. I was able to recover .mdf and .ldf files but when I tried to attach them an error message appears that. I am running MS SQL Server 2000 SP4. ...
2
votes
2answers
102 views

SQL Server doesn't use expected index

I have the following query (simplified from an Entity Framework query, I don't have direct control of the SQL): SELECT TOP 15 HouseHoldingRuns.Id, ( SELECT TOP 1 ManCoId FROM ( SELECT TOP ...
2
votes
1answer
43 views

how to compare time slots?

I have a table called pricelist startHour endHour Price and another table that containes the actualuse startDate endDate jobID My data is pricelist startHour | endHour | price ...
1
vote
1answer
147 views

Why is casting a string to DATETIME not accurate to the ms? [on hold]

Why does SELECT CAST('2014-11-28 15:06:02.165' AS DATETIME) return: 2014-11-28 15:06:02.167
0
votes
2answers
62 views

How to save and then restore permissions after refreshing a database

A database in a STAGING environment is overwritten every N weeks with a PRODUCTION copy that is more recent. What is the proper way to save and then restore users, roles and explicitly granted ...
0
votes
0answers
25 views

How to find what is causing large transaction log backups in MS SQL Server? [duplicate]

Most questions, including Why Does the Transaction Log Keep Growing or Run Out of Space? and other articles deal with people who have a transaction log file that keeps growing, usually due to them ...
0
votes
1answer
44 views

SELECT with lots of left join is very slow in SQL Server 2014

I've got a query with, more or less, this structure: SELECT MAINTABLE_ID FROM MAINTABLE WITH (NOLOCK) LEFT JOIN TABLE_1 WITH (NOLOCK) ON TABLE_1_FK_MAINTABLE_ID = MAINTABLE_ID LEFT JOIN ...
0
votes
0answers
19 views

SSIS cannot access the file

I have a SSIS package which performs a few tasks using SQL Server Agent. First it executes a script task, then accesses Excel files, executes a SQL query and moves files to another directory. The ...
1
vote
0answers
11 views

How to create a “match result” data type?

I'm building a football match table which contains one column "match result", which should consist of data like "3-1","0-0"... I'm wondering what kind of data type is best appropriate for it, varchar ...
3
votes
1answer
1k views

Log Reader Agent is not running - The job failed

I created a transactional replication on PRE-PROD (via TSQL) and everything works as expected. On PROD platform replication is not working. While inspecting Replication monitor, I get this error ...
2
votes
3answers
742 views

Twice job results in sql server, last one is left in progress

I have the job MP - Create CSV which execute a package SSIS in sql server 2008, when I check for the job history I see the result at step 0, I expand and I have 2 results for the step 1. Fist result ...
0
votes
0answers
14 views

How can I copy a database from Sql Server to Azure Sql Database?

The local database has settings that Azure will not accept and that we must keep in the local copy. I tried using SSDT and with that I could publish to a new database on my local Sql Server a schema ...
3
votes
1answer
79 views

dbcc memorystatus - buffer pool target on VM higher than max memory

I'm doing some digging into potential memory/configuration problems on a sql server 2012 SP2. I stumbled upon something that seems a bit strange in the performance counters as well as the dbcc ...
1
vote
1answer
51 views

SQL Server 2012 Setup error Attempted to perform an unauthorized operation

Below is the detailed error message. I Can't proceed with installation for the last one week? I've given full rights to registry keys that are associated to SQL Server but nothing has worked out. For ...
0
votes
1answer
263 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 ...
2
votes
1answer
80 views

SQLIO and its Flags

Any feedback on this will be highly appreciated. 1.-t flag(Threads) – If I capture worker thread information using this query SELECT SUM(current_workers_count) as [Current worker thread] FROM ...
6
votes
1answer
4k views

Why does SQL Browser service get disabled?

I have an intermittent problem with a software installation package that installs our product (written using InstallShield/InstallScript). During the process of the installation, we restart the SQL ...
4
votes
1answer
577 views

SqlPackage does not pick up variables from profile

I want to upgrade a database using .dacpac and sqlpackage.exe here is how I run sqlpackage: SqlPackage.exe /Action:Publish /SourceFile:"my.dacpac" /Profile:"myprofile.publish.xml" The ...
1
vote
1answer
34 views

Need to Send a formatted HTML Email via Database Mail in Sql Server 2008 R2

My requirement is to create the automated email as ( A formatted HTML Email via Database Mail) The basic requirement has been completed where when the Job is triggered it inserts the data into a Table ...
-1
votes
1answer
85 views

EXCEPT operator vs NOT IN

The EXCEPT operator was introduced in SQL Server 2005 but what is the difference between NOT IN and EXCEPT ? Does it do the same? I would like a simple explanation with an example.
2
votes
2answers
310 views

Table with 4 million records - different size and performance in development and production

At my company we use SQL Express 2008 R2, which supports databases up to 10GB. We have 2 databases with almost the same number of rows in all tables. But, one of them is 4.5 GB in size (which is in ...
3
votes
1answer
38 views

Help with indexing narrow table with many millions of rows

I have a good amount of experience with SQL Server, but not much with indexes and I fear I'm a little bit out of my depth in trying to figure out how to correctly structure a table that has 100+ ...
0
votes
1answer
27 views

Columns count in SELECT query and SQL Server buffer cache

Let's assume that I have a table with 30-50 millions records. It has ~40 columns. Currently when I request data it always requests all columns because of legacy ORM that we use. I know that if we ...
2
votes
2answers
155 views

SQL Server - Logical Reads lowered, Execution time remained the same

A view executed Select columns from view where col= "date range" (view contains calculation in it Col1+Col2*col3 AS Col4). It took 7 seconds for 500K rows to return, logical reads some 144k. Added ...
1
vote
1answer
13 views

Get trigger query using query analyzer

I have a server in which there is no SSMS installation, and only query analyzer is available. And all I need to do is find the trigger information (basically trying to find out what that trigger ...
1
vote
2answers
56 views

PAGEIOLATCH_SH and LCK_M_IX wait type

I'm seeking for a resolution into wait types I observe on one of my servers. I've been keeping wait statistics for a long time and can positively say that the top two are PAGEIOLATCH_SH and LCK_M_IX ...
2
votes
2answers
926 views

What's the meaning of the Collation Code (blank, 90, 100, 110) in SQL Server 2012

During the installation of SQL Server 2012, in the Collation tab, i can choose between French_CI_AS and French_100_CI_AS. What do they mean and which one is newer? When there's no Code, is it newer ...
3
votes
1answer
144 views

ProcessID Owner with third party app

I am having problems trying to audit a third party app with a SQLServer backend. The app manages users and user access via a SQL table, using a single SQL login to access the databases. I am trying ...
0
votes
2answers
1k views

SQL Server Reporting services migration (2008 to 2012)

We have a SSRS 2008 (not R2) instance with a few hundred reports, and now, on a new machine we have installed a 2012 instance of SSRS. We need to migrate all the reports, while keeping all their ...
3
votes
1answer
67 views

resource wait SQLCLR - wait_type CLR_SEMAPHORE by SPID 0

UPDATE In the comments under Aaron's post is an extensive explanation why I want to find this out, please read it if you want to know. The system is running some ETL, reporting services and a ...
-1
votes
1answer
83 views

How το find last time database was accessed and the inventory of all application and users accessing it? [on hold]

I am doing an inventory of all my databases (around 120) and need to find: Last time a SQL Server database has been accessed Detail information: The inventory of all applications and/or users ...
4
votes
2answers
223 views

Fulltext search limiting users possibilities

We have a web site with a search box. The search uses a fulltext index column. However, we just cant feed the text the user has input into this stored procedure. CREATE PROCEDURE [dbo].[SearchPages] ...
0
votes
0answers
22 views

How to import data to a table with 14 columns via BCP if my data file has less than 13 delimiters? [on hold]

Sorry for the extremely awkward wording in that question. I'll explain. I have a table with 14 columns in which i'm trying to import data to via BCP. My data comes from a text file. This text file is ...
0
votes
0answers
11 views

Getting new and updated data with an archive column

I am trying to optimize an SSIS package that retrieves data from a very large transaction table that gets millions of new records daily. The plan is this: Archive column, smallint - 0=new (default ...
6
votes
2answers
162 views

AlwaysOn Availability Groups log_send_rate

On all our AlwaysOn setups, running Windows 2012 and SQL Server 2012 in virtual machines and on bare-metal, I find that the log_send_rate in sys.dm_hadr_database_replica_states is consistently ...
0
votes
1answer
31 views

How to move data from SQL Server to MySQL database

Our MSSQL database has a table that has about 4 million rows of data. My original plan was to copy it over to a MySQL database and place it in a more optimized format. For some reason, the people ...
2
votes
1answer
66 views

Query shows SELECT 0

I'm looking through the queries being executed by a third party application. The application was flagged as being slow by some of our end-users. It seems to INSERT records into a HEAP, then DELETE ...
1
vote
3answers
265 views

AlwaysOn Availability Groups Delayed Replica

With AO SQL 2012, is it possible to configure one of the member as delayed replica? I know ideally we would like this to be synced but in case of human error, it would give us the ability to check on ...
3
votes
1answer
104 views

SQL Server SSL connection

Is it possible if I wanted to set up SQL Server 2008 R2 instance so that it only accepts SSL Connection? I am getting different answers and based on my testing, it will accept non-SSL connection even ...
3
votes
2answers
4k views

Reduce Clustered Index seek cost SQL Server 2008 R2

I am running a query and it has records in the hundreds of thousands, it takes more than 20 mins to fetch data. After running the execution plan i noticed that clustered index seek cost can be be the ...
0
votes
0answers
28 views

SQL Query to get the Sales Qty of the Item and the its Returned Quantity for past 6 Months

I want retrieve the Sales Qty and return qty of the Items in the following format for the past six months. From two different tables,I TxnInvoice Table :Invoice header TxnInvoiceLine Table :Invoice ...