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

SQL Server query disk write/sec limit

I am facing an issue which it looks like the server is hitting disk write limit. But after some test, I realize it wasn't. I was running the following query: DECLARE @MyCounter int; SET @MyCounter = ...
0
votes
0answers
7 views

Adding a new partition to the partitioned table is skipping the last filegroup

I have created one partitioned table and trying to add a new partition to that. I ran the following scripts to create a new filegroup and add a new partition to the table. But when I run the alter ...
0
votes
0answers
13 views

Concatenate distinct columns of duplicate rows?

Preface: I know that this sort of question has been asked before, but I can't seem to adapt answers that I've found to work with my code. That said, thanks in advance for any help. I have this ...
0
votes
0answers
16 views

Table with multiple lookups

I bet this may be a duplicate and I'm not forming the question correctly, so feel free to point me in the right direction. Background We have a SQL Server with some legacy data. They're all ...
1
vote
1answer
34 views

Use of NOLOCK with CDC capture tables

In using SQL Server's Change Data Capture, I notice that the fn_cdc_get_all_changes_... table valued functions all use NOLOCK when querying against the capture tables. Is this a recommended practice ...
1
vote
1answer
23 views

Database cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery

I have received a database file and the instructions for loading it is to install SQL Server 2005 and then attach it using SQL Server Management Studio. After installing everything, I tried to attach ...
1
vote
3answers
34 views

Programatically copying data from table from offline database to online database

I have a local database and an online database. When i make an entry into my local database, it should also automatically make an entry in the online database. Can anybody tell me how I can do that?
1
vote
2answers
36 views

Loop through all databases and remove all users

We are doing a conversion from one system to another which is requiring backup/restores. I am trying to create a process that will remove all users after the restore on the new servers as no user ...
2
votes
1answer
38 views

Clustered composite key high fragmentation and fill factor

I've recently made a table to hold the language preferences of my users as follow: CREATE TABLE [dbo].[systemUserLangPreference]( [systemUserID] [int] NOT NULL, [langID] [int] NOT NULL, ...
1
vote
1answer
22 views

Translating a query from MS Access to SQL Server

I have a legacy query from years ago that was written for an MS Access backend: DELETE category.* FROM category LEFT JOIN product_category ON category.id = product_category.categoryid ...
0
votes
0answers
18 views

sql server 2000: no longer able to expand jobs in sql server agent

In SSMS on a Windows 7 machine, while connecting to a server running SQL Server 2000, I am no longer able to click on the Jobs to see the Object Explorer Details. Previously, this was not an issue, ...
0
votes
1answer
37 views

Get first login-Hit on huge table

I have table like this in my database : ID (pk,int,not null) UserID (int,null) HitDate (datetime,null) Every time a user has any transacation in my application one hit inserted in this table. ...
0
votes
1answer
43 views

data warehouse design help

I'm struggling with the design phase for a data warehouse. It's not the traditional sales example you find on MSDN or all books etc. I've been tasked with creating an education data warehouse, that ...
1
vote
2answers
29 views

Location of #th iteration of a character or a word in a sql text field

How can I get the location for the #th iteration of a character or a word in a sql server text field?
2
votes
3answers
64 views

Listing indexes and constraints

I am looking at a SQL Server database for an application I have inherited. I have not looked into SQL Server for approximately 10 years, so please bear with me. The database table I am looking at has ...
0
votes
1answer
30 views

Slow performance of remote restore

Over the weekend, I was participating in a DR test. On the database side, that meant restoring backups from the production system to the DR system. What struck me as odd about the performance of the ...
1
vote
3answers
48 views

Inserting Serbian Latin and Cyrillic characters

I am using SQL Server 2012 Express as part of my asp.net development workstation. Database and table collation is set to Latin1_General_CI_AI. Attribute types are nvarchar(max) and varchar(max). ...
1
vote
1answer
32 views

Spy sql queries generated by an application

I need to know what SQL queries is generating some application. It is possible to see it in some kind of sniffer or what? I tried look in Management studio, but it shows only most expensivie queries.
-3
votes
0answers
34 views

SQL Server 2014 v/s NoSQL(MongoDb, RavenDb, CouchDb) [on hold]

Now SQL Server 2014 is out and there is lot of excitement regarding SQL Server 2014. How can we compare SQL Server 2014 v/s NoSQL(MongoDb, RavenDb, CouchDb)?
5
votes
2answers
179 views

Why do Indexed Views not permit non-unique clustered indexes?

I've been looking into using Indexed Views to increase performance on a few of our most commonly used views. However Indexed Views do not support non-unique clustered indexes which goes a little ...
1
vote
1answer
34 views

Full text index search returns an unexpected result

When I search TaxIdentityNumber using contains an unexpected result is returned; the result contains numbers that are not matched to query. For example, I search using '"5689523657*"' and get ...
0
votes
1answer
14 views

SQL Server distrb.exe & Logread.exe using huge SQL.txt file in C:\Users\sqlsrvacct\AppData\Local\Temp folder

I have the following situation: SQL server 2008 R2 SP2 I have both the Distribution and Subscription database in this server. LogReader agent and Distribution agent are running in continuous mode the ...
0
votes
1answer
38 views

TSQL change column constraint between null and not null

I am doing a exercise to change a column's constraint between null to not null. Table name: Production.categoriesTest. Please review my question and give me suggestion on what I did wrong and how to ...
2
votes
2answers
44 views

Running query progress indication

I have a query: SELECT * FROM OPENQUERY ( oracle, 'SELECT * FROM [some_table]' ) It runs for about 7 hours. I only need to run this query once to import data into a new system when we ...
0
votes
1answer
34 views

Execute stored procedure in another server from sql agent job

I am trying execute stored procedure in remote server in sql agent job using sqlserver 2008 r2 select * from openquery([1.1.1.1],'exec [DB_Name].[dbo].[sp_ProcName]') Or EXEC ...
0
votes
0answers
22 views

Can't connect SQL Server through firewall [duplicate]

I know this has been asked before however I've tried all the solutions presented and it still does not work. I am attempting to connect to a SQL Server 2008 running on a Windows8.1 machine through ...
1
vote
2answers
24 views

Can I get OSQL if I install SQL Server Client Tools?

We have some legacy .bat scripts full of osql commands to existing SQL Server instances / dbs on our network. We've tried running the .bat scripts from our app server (Win Server 2008) but get the ...
0
votes
0answers
21 views

SQL Server DTC: is it possible to automatically replicate data that is created on Oracle DB?

I have a SQL server with a table that is spec'd exactly like a table in an Oracle database. What I would like to do is automatically copy the data from the Oracle table to the SQL server table... Is ...
0
votes
0answers
13 views

MS Access: ODBC Err 3146 - Timeout related?

I have an AccessDB that queries that appears to function as expected under light loading (i.e., 1-2 users), no errors, SQL Server returns the desired results. We tried to test using 8 concurrent ...
0
votes
0answers
13 views

What is the best way to backup and restore a subset of data within a subset of tables in a sql server database?

I need to be able to periodically backup & restore a subset of data in a sql server database. I only want to backup data in the tables which contain a specific column name - column1 (for example) ...
2
votes
1answer
44 views

Making a recursive CTE like query, but for many records

I have a table with a hierarchy ( with a recursive parentID column), for one record, I know how to get the last parent record, with the following code : declare @Id integer ;WITH CTE AS ( SELECT ...
5
votes
1answer
69 views

SMS Suggesting covering all columns in an index?

I'm still a bit newer to indexes and database works, so I may very well be missing something obvious. SMS suggested adding a covered index to one of my tables that Indexes on the column I believe ...
4
votes
1answer
37 views

Reference assembly in sqlproj not being deployed to server

I have a Visual Studio 2013 Database Project which takes a modified version of fastJSON as a reference. I selected Generate DDL in the reference properties as shown in this screenshot: And in the ...
1
vote
0answers
38 views

RETURNING syntax with multiple columns

Again, another question related to the answer of the one there: Insert with OUTPUT correlated to sub query table So I ended up with this query, written for SQL Server: CREATE TABLE tempIDs ( ...
0
votes
1answer
71 views

Sort Totals By Months

I need to show the count of all rows grouped by month and then pivot it Appreciate an easy solution for that Or alternatively if someone can help me fix this I've used dynamic pivot query DECLARE ...
0
votes
1answer
20 views

Create a certificate with a private key

Reading this answer I have a question about it: How can I create a certificate with a private key in my app database?
-3
votes
0answers
53 views

Fastest way to Restore 50TB DB [on hold]

I am trying to find out if there other ideas as what the fastest way is to restore a 50TB DB.
2
votes
2answers
573 views

“Cannot insert the value NULL”, but there is no NULL values!

This question follows the answer of my other question there: Insert with OUTPUT correlated to sub query table The Person.LastName column has a NOT NULL constraint. When I execute this code: CREATE ...
1
vote
1answer
26 views

Drop permission from a dbowner

How can we remove the drop permission from a user or a role like dbowner? Want to restrict the dbowner from dropping the database.
7
votes
1answer
147 views

Deadlock when update different rows with non-clustered index

I'm solving a deadlocking issue while I noticed the lock behavior is different when I use clustered and non-clustered index on the id field. The deadlock issue seems to be solved if clusted index or ...
0
votes
0answers
29 views

SQL query to return a column per date in date range with sum of contract utilisations (value/duration)

My question is similar but more elaborate than another already in stackexchange.com "SQL query to return a column per date in date range?" I have the following data: Customer Start_date ...
0
votes
1answer
47 views

SQL Server 2012 Tuning process exited unexpectedly. DTAEngine

I am using Windows Server 2012 x64 and SQL Server 2012. I am running the Database Tuning Advisor with these settings : Advisor plan cache. Database workload master. Check my database all the ...
2
votes
1answer
26 views

How to search double quotes in fulltext search in sql

I have double quotes in my Keyword. How can I search this in my fulltext search query. I have this query SELECT top 10 K.[KEY], 10, K.[RANK] FROM CONTAINSTABLE(ProductKeywords, Keywords, '("19*") ...
2
votes
1answer
41 views

How to pull a list of applied service packs and cumulative updates from SQL Server 2008 R2?

I want to list all the SPs and CUs applied to a SQL Server 2008R2 instance. Example: 10.50.4260 2720425 http://support.microsoft.com/kb/2720425 CU#1 for SQL Server 2008 R2 SP2 10.50.4000 2630458 ...
1
vote
0answers
44 views

Multi-victim deadlock in SQL Server

I have been seeing a lot of deadlocks occurring on a system with deadlock graphs similar to this one: I have been advised that it is a multi-victim deadlock but I cannot re-create a deadlock graph ...
1
vote
1answer
54 views

Insert with OUTPUT correlated to sub query table

I am modifying the structure of a database. The content of several columns of the table FinancialInstitution has to be transferred into the table Person. FinancialInstitution is linked to Person with ...
0
votes
1answer
40 views

Is this application creating stored procedures on the fly? [duplicate]

We are running a transaction program that uses MS SQL Server. Lately as our number of users and locations have grown, speed/response seems to be an issue. When looking at *sys.dm_exec_sql_text*, I ...
3
votes
0answers
18 views

Object Auditing with Availability Groups

We are about to implement Availability Groups and it brought up a question. We currently use auditing to see which objects are no longer used in production. We also take a backup each night to use ...
3
votes
2answers
73 views

SQL Server Database Mirroring is going to die. How can I guarantee high availability now?

The Database Mirroring feature of SQL Server is going to die: This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan ...
0
votes
0answers
20 views

Computation of Server Capacity in regards to Records [closed]

right now i am doing an upgrade for a server and i want to know the possible capacity of my storage given the number of records from table(database)... what will be the computation? Thank you very ...