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)

6
votes
1answer
539 views

Executing Powershell SMO against a cluster with elevated privileges to update service accounts

I'm working on a Powershell script to update service accounts on named SQL instances in a failover cluster. I'm trying to use the SMO and WMI to update this so that I can update the service account ...
3
votes
1answer
362 views

Renaming SQL Server Agent operator

I want to rename SQL Server Agent operator, that is change it's name. Is this a "valid" thing to do? I noticed that trying to change name in SSMS via Operator/Properties dialog doesn't actually do ...
2
votes
1answer
522 views

Clustered Index vs Primary Key Performance

I'm trying to tune a stored procedure which has a temp table used for matching (only retrieval, no updates or inserts). We're considering applying a clustered key to a temp table. We're also ...
2
votes
2answers
804 views

how to get avg() size by day using two decimal places

does this simple query result in grouping the attachments by day and giving me the total number of daily attachments as well as the average size? the only table i am querying is attachmentdetail ...
3
votes
4answers
1k views

limiting sql server backups inside .bak file

I have a job scheduled to run a few times everyday. The job backups my databases, like: BACKUP DATABASE [databasename] TO DISK = N'd:\sqlserver\backup\databasename.bak' I can track the backups in ...
3
votes
1answer
191 views

How to update views outside of update/insert transaction in SQL Server

Looking at SQL Server indexed views I see that these views are updated within a transaction that updates dependent tables. I wonder if there is a way around it? There will be about 10 views with 20 ...
3
votes
1answer
3k views

How to create a partitioned table based on date?

I'm trying to create a partitioned table where partitioning is determined by OrderDate. I'm trying to create a clustered index on OrderDate and a nonclustered primary key on OrderID. But I get an ...
5
votes
2answers
2k views

How to balance SQL Server memory with SQL Server Analysis Services memory

We have many systems that have the same configuration One Server (virtual or physical) Running SQL Server (SQL) and SQL Server Analysis Server (AS) multiple cores 16gb RAM Each night the SQL ...
0
votes
1answer
68 views

Changing column value [closed]

Normally used to MySQL so need help on syntax check. with SELECT * FROM Bit WHERE CustomerID='3512242' I have a field called Filer. I want to change it from a P to a D. Do I use UPDATE to change the ...
4
votes
2answers
170 views

Display all tables and their columns

Is there a way to display the layouts for all the tables to see their columns? I am trying to find tables with a certain column names. I am using the web app Web Data Administrator Example: table1 ...
10
votes
3answers
15k views

Can I use SQL Server Management Studio 2012 on a 2008 server?

My school is using SQL Server 2008. Last time I used it I only installed (at home) SQL Server Management Studio 2008 part, and used VPN to connect to school's server. Now I want to install SQL Server ...
4
votes
1answer
609 views

SQL Server Buffer Pool Utilization under VMWare

I recently migrated a physical SQL Server box (2012) over to ESX (5.1) simply for ease of administration. It is and will be the only guest on the server. As expected there was a marginal performance ...
4
votes
1answer
955 views

What permissions are needed to view dependencies?

My company is moving to a much more restrictive security model in the near future. As part of that we are changing specific servers to the new model and testing all our existing processes. One of ...
5
votes
1answer
291 views

How does SQL Server order results when joins are used?

How does SQL Server figure out the order of the records in the result set of query execution? I am trying to make heads or tails of it but find myself scratching my head. When I change the fields I ...
1
vote
3answers
4k views

sql server instance using maximum cpu usage

I have a SQL server 2005 instance installed on the server machine with two vm Server Specification are *Processor:* Xeon Ram : 6GB OS: window server on vm ware It is running asp.net application ...
1
vote
2answers
2k views

Import Excel Table to SQL Server - with date column

I'm trying to import a excel table that has a column with dates. My query works without the column date. I'm using ODBC to import. strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & ...
3
votes
4answers
210 views

Does it make sense to use full recovery if the data and log files are on the same HD?

We have a database that was set up to use full recovery and my guess is that the reasoning was only to prevent data loss if a failure happened between backups. We make daily full backups of the ...
4
votes
1answer
500 views

SQL Server Row Count sp_spaceused rows discrepancy

I am researching a performance problem with an application running on SQL Server 2005. I've conducted performance tuning, and I realize that a key table is poorly structured(poorly chosen clustered ...
3
votes
1answer
240 views

SELECT multiple sensor values in one query

Background I have a couple of devices, each with a couple of sensors. I log these every now and then and stores them in a table described below. When someone requests a web page, I fetch a couple of ...
2
votes
1answer
7k views

SQL Server permissions to create, restore, delete only some databases

On MS SQL Server 2008 R2, I need to have user which can create, restore, DBCC CHECKDB and then drop databases. But he must not be able to access or delete specified databases on server (security ...
2
votes
2answers
97 views

Can I see the RAID group name for my SQL Server Database files?

Is it possible to see the RAID group name that my database (and log) files are sitting on, in one of the DMVs (or some other system table) ?
42
votes
4answers
7k views

Are SQL Server in-place upgrades as ill advised as they used to be?

I have been working with SQL server on and off since SQL Server 6.5, the old advice that still rings in my head was never to do an in-place upgrade. I'm currently upgrading my 2008 R2 DEV and TEST ...
5
votes
1answer
467 views

SQL Server / MySQL to DTD (+XML)

Is there any way I can at least export a table schema from MSSQL or MySQL to a DTD file? Also the same for the data of the tables to XML. I am really not getting how to write DTDs, so I badly need a ...
4
votes
2answers
2k views

SELECT/INSERT Deadlock

This instance hosts the SharePoint 2007 databases (SP). We have been experiencing numerous SELECT/INSERT deadlocks against one heavily utilized table within SP content database. I have narrowed down ...
3
votes
1answer
504 views

Will one nvarchar column affect query performance?

I have one column that I recently converted to nvarchar(100) to store Asian characters. The other columns in this table, and the other tables in the same database, use varchar, int, bit and datetime. ...
3
votes
1answer
2k views

Real Time SQL Server Analysis Services Cube Processing Report

I would like to know if there is a way to generate a report to determine which SQL Server Analysis Services cubes are processing using SQL Server Reporting Services? I would like to be able to run ...
9
votes
2answers
467 views

SQL Server Filetable document properties

I'm using SQL Server 2012's Filetable to store documents and search them with Semantic Search. I was wondering if there is a way to list all the document properties (meta data). There is a way to ...
7
votes
2answers
969 views

Options for setting NOLOCK hint in dataset queries

Some context: At first we wrote reports just "straight up", without any locking hints in the queries. With the larger reports this would sometimes cause locking problems. At first we remedied this by ...
2
votes
1answer
420 views

Understanding SQL Server encryption (by password)?

After asking this I still have a question. A company need to store sensitive data. Please let's not talk about certificate right now. A DBA does the following : CREATE SYMMETRIC KEY ...
10
votes
2answers
6k views

How To Profile Stored Procedures

I am using SQL Server 2012 and was wondering how to profile stored procedures For instance can profiler capture each individual SQL statement in a stored procedure, what it is, and how long it takes ...
4
votes
1answer
1k views

Is a clustered index locked while a (clustered index) scan is in progress?

The question is pretty simple, as the title says. However, I cannot find any references to confirm or contradict this. The problem leading me to this question is that I have a view joining several ...
4
votes
1answer
2k views

How to force the use of row locks?

I am trying to get my table to use row locks. I have already disabled lock escalation. The isolation level is READ_COMMITTED_SNAPSHOT alter table <TABLE_NAME> SET (LOCK_ESCALATION=DISABLE) go ...
3
votes
2answers
161 views

Does the Query cost in Sql Server account for buffering?

If I am comparing 2 queries by checking their relative "Query cost" as a high level indicator of performance, does the buffer status have any effect on the values shown in the execution plan?
1
vote
0answers
58 views

How To Use Publication Without Precompiled Partitions

I am using SQL 2012 with merge replication. Our setup is quite complicated and thus it seems running the publication with precompiled partitions is not going to work. The merge agent is slow to do ...
4
votes
1answer
571 views

Besides attaching the debugger, is there any other differences between “(local)\Instance” and “MyLocalName\Instance”?

When using SQL Server Management Studio for SQL Server 2008 R2 connecting to a local SQL Server 2008 R2 instance (version 10.50.2500), I know that if I am using the instance name (local)\sql2008 it ...
3
votes
0answers
94 views

How To Diagnose Slow sp_mssetupbelongs

I am using merge replication with SQL 2012. When performing a clean sync using the merge agent I am getting a timeout on this stored procedure, sp_mssetupbelongs I am wondering what the best way to ...
4
votes
1answer
901 views

Can I connect to SQL Server 2008 R2 database from SSIS 2012?

I need to redevelop an ETL process and I'm evaluating options. I'm running SQL Server 2008 R2 database, and SSIS 2008 will take too long to develop and test the required packages. I understand that ...
5
votes
2answers
300 views

Running queries against multiple servers

I want to use a Central Management Server, with a server group underneith, to run management queries against multiple server. I know how to run a query against the whole group through SSMS, but I ...
2
votes
1answer
302 views

How compatible are Sybase and SQL Server clients connecting to the alternate back end?

Given the shared history of the Sybase and SQL Server products, and their use of a similar (identical?) wire protocol in TDS, what definite statements can be made, if any, about cross compatibility. ...
4
votes
0answers
313 views

ERWIN create and use database

Im trying to generate physical database from my logical model using ERWIN 7. All is well in the script that is generated automatically, there is only the problem that the model is created in the ...
-3
votes
2answers
851 views

Optimisation sub query SQL Server

I would like to optimise the query below because it's actually taking 40% of the time in the real one. I HAVE to get the first line in the table 2 for each line in the table 1. The relationship is 1 ...
2
votes
2answers
255 views

Invalid data types in restore headeronly resultset

I'm trying to write a SQL Server script to iterate through .bak files in a directory and then restore them to our server. In doing so, I've created three temp tables: #Files to keep track of the ...
9
votes
5answers
14k views

What is the fastest way to export a table to a text file

I will have a SQL Server 2012 database and a table with 3 million rows and maybe 50 columns. What will be the fastest way for an unattended background .net process (maybe issues some SQL or Powershell ...
5
votes
2answers
223 views

Why Do Replication Deletes Require sysadmin Access

I am running merge replication with SQL 2012. There seems to be a nasty consequence of the delete triggers added for replication in SQL 2012. Inside the delete triggers are this, select @xe_message ...
2
votes
2answers
3k views

Error on SQL Server 2008 backup (.bak file) restored on SQL Server 2012

When I try to restore a database in my new SQL Server 2012 instance I get this error : Restore of database 'MyDb' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks) ...
3
votes
1answer
581 views

“Thread was being aborted” error when inserting 25k rows

I need to store about 25k rows worth of data into a single table about once a week. To achieve this, I'm creating an object (created from parsing XML), and sending the data within that object to a ...
3
votes
1answer
320 views

Named pipes connection closed when subjected to load

We're hosting a service where we have a messaging service. When a message arrives, it checks which subscribers it should be sent to by connecting to the database, and querying the subscriptions ...
5
votes
1answer
317 views

When should startup parameter -E be used?

We are starting to build a data warehouse system using SQL Server 2008 R2. One of the senior DBAs told us to consider using a startup parameter -E for the SQL Server service. I read from Books Online ...
0
votes
1answer
132 views

How triggers are called when we have two triggers?

In a table I have two triggers. When it is called for the first time the first trigger does not fires while the second trigger's got fired. On the next call both first and second trigger action take ...
6
votes
3answers
526 views

How can I organize my tables?

My database contains more than 200 tables. When I want to modify or insert a table, I find it difficult to find it among all those tables. Is there any way to collect related tables in a folder ...