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

SQL Server 2005 merge replication failure

We have a customer who, when trying to sync a client (subscriber) to the server (publisher,) receives the following error: 2012-11-30 21:03:33.334 Percent Complete: 18 2012-11-30 21:03:33.334 Data ...
2
votes
3answers
2k views

ASPState Log file growing tremendously - SQL Server 2008

Microsoft SQL Server 2008 (SP3) - 10.0.5500.0 (X64) Web Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1) I have an ASPState database online, and its log file ASPState_log is growing ...
-3
votes
3answers
2k views

Join tables on a partial string match

input: I have a table containing (any number of) user-supplied strings: ╔═══════╗ ║ Value ║ ╠═══════╣ ║ To ║ ║ An ║ ╚═══════╝ And a table of user details: ╔════════╦══════════╗ ║ UserID ║ ...
5
votes
2answers
4k views

Separate stored procedures for inserts and updates?

I have a table in Microsoft SQL Server. Sometimes I need to update, and sometimes I need to insert. I could write 2 stored procedures: InsertNewPerson UpdatePertsonById But I was thinking to write ...
6
votes
1answer
369 views

Estimated versus actual query plan with function calls

I have this query on SQL server, a merge replication query: SELECT DISTINCT b.tablenick, b.rowguid, c.generation, sys.fn_MSgeneration_downloadonly ( c.generation, ...
3
votes
1answer
828 views

Performance effects of database file size and available space

I have set the autogrowth and maxsize properties to: By 10 MB, Unlimited When I look at the Properties -> General Tab by right-clicking the database in SSMS, I see the file size is 2249MB with 6.1 ...
2
votes
1answer
170 views

Shrink a large log file for a “Throw Away” database

I have a copy of my prod database on a development server. I am using it to test a deployment script. But when I run it, it says that the log file is full. I checked and it is at 10 GB (Almost the ...
1
vote
1answer
223 views

Correct Selection of SQL server instance db owner login name

I am attempting to connect RSA Archer (5.2) to an instance of SQL server 2008 r2 on WS 2008 R2. When Archer attempts it's initial connection I get - The ConnectString property has not been ...
2
votes
1answer
520 views

Only a single WITH MOVE clause should be specified for any logical file name

I'm trying to do a copy database by scripting a backup and restore. I have the backup procedure working correctly but I keep getting the error Conflicting file relocations have been specified ...
20
votes
3answers
9k views

Is the SQL Server Express memory and CPU limit per instance?

If I have 8GB of RAM in a server and I run 4 instances of SQL Server Express, will the total memory limit used by SQL Server be 1GB or 4GB? Would it be advisable to run multiple instances like this ...
2
votes
5answers
5k views

Is it possible to shrink an .MDF file on a drive with low free space?

Is there a way to shrink mdf file of database in SQL Server 2008 without using additional space? Total space in hard disk is 136 GB, the .MDF file size is 124 GB, and the log file size is 2 GB. I ...
4
votes
1answer
1k views

Agent job will not run

I created a JOB to run a simple package that runs a query and saves the results to an Excel file. If I try to run the job In SQL Management Studio I get an error saying: SQLServerAgent is not ...
9
votes
1answer
4k views

SQL query for combinations without repetition

I need a query which can be used in (or as) a function and retrieves all combinations of n values. And I need all combinations of length k where k = 1..n. Extended sample input and result so input ...
2
votes
1answer
158 views

User already exists error

I've created a stored procedure that creates a database, creates a set of tables, copies all of the data from a linked access database into those tables then creates a user and assigns that user to ...
11
votes
1answer
1k views

Is it possible to record incoming parameter values in a procedure call while tracing in SQL Server Profiler?

Using SQL Server Profiler (I'm on SQL Server 2012), I'm trying to generate a useful trace that shows the parameter values, not just the SQL with variable names. The stored procedure walks through a ...
5
votes
2answers
1k views

considerations when using triggers on a replicated (target) database

Our SQL Sever 2008 application database is replicated from Server A to Server B (push replication). We use the copy, let's call it database_b, on Server B to create reports and run other queries so ...
1
vote
1answer
325 views

Microsoft Synchronizer Framework

I'm planning to synchronize a pc that has SQL Server 2008 running on it, and the server has a SQL Server 2008 R2 running on it. Are there going to be any problems with data loss or compatibility?
6
votes
1answer
7k views

Login failed for user - Error 18456 - Severity 14, State 38

Message that SQL Server Log File Viewer shows: Login failed for user [User] Error: 18456, Severity: 14, State 38 What it actually means: Failed to open the explicitly specified database My ...
1
vote
3answers
180 views

Check of SQL Server upgrade success

I have performed SQL Server upgrade from 2005 to SQL Server 2008. Is there any tools/possibilities to check, whether the upgrade from SQL Server 2005 to SQL Server 2008 has been accomplished ...
10
votes
1answer
2k views

SQL Server Cache Flush and Disk I/O

We're busy load testing an OLTP system we've developed in .NET 4.0 and runs SQL Server 2008 R2 in the back. The system uses SQL Server Service Broker queues, which are very performant, but we are ...
4
votes
2answers
135 views

We are running database maintenace with indexing the system, indexing fails due to locking?

We have been trying to do re-indexing in our system, there are users still using the database during the indexing. While doing index for certain tables there is failure of indexing this seems to be ...
5
votes
1answer
682 views

Transactional Replication not sending all commands

I have a transactional replication topology as follows: NY Publication Database same server holds distributor NY - Subscriber LON - Subscriber HK - Subscriber We are using bog standard, one-way ...
5
votes
1answer
2k views

Why SQL Server doesn't support foreign key constraints on views?

I know that SQL Server doesn't support using a view as the reference for a foreign key constraint, is there a reason (i.e. something to do with the relational model) this is the case? It seems like ...
3
votes
3answers
956 views

Rollback group of DDL statements

Working in SQL Server 2008 R2, I am trying to rollback a set of DDL statements as a group (think of an upgrade script for a database), but am running into trouble. Take the following code: begin try ...
5
votes
3answers
9k views

T-SQL query to report disk space allocation and used space for auto-grow SAN databases

We are using 6 databases in total for an application, and we can only share 4TB of space for all 6 databases (via SAN storage). I'd like to write a query (report) for a single database indicating the ...
1
vote
2answers
198 views

Can this SQL be made more efficient and combined into one select?

I have the 4 SQL queries below that I combine into one result set at the end. I am guessing that since I am operating on the same tables in each of the SQL sections, there is a cool way to get my ...
0
votes
1answer
633 views

How to test permissions on an empty database?

It's usual in an organization I work in that I need to request a database creation to the DBA group (I am a developer). As such, they will also create a user for me to use and a database dedicated to ...
33
votes
5answers
9k views

Why does ALTER COLUMN to NOT NULL cause massive log file growth?

I have a table with 64m rows taking 4.3 GB on disk for its data. Each row is about 30 bytes of integer columns, plus a variable NVARCHAR(255) column for text. I added a a NULLABLE column with ...
2
votes
3answers
2k views

Software tool to visualize and print DB diagrams [closed]

I have some SQL Server databases and use SQL Server Management Studio to manage them. However, I find that is not very friendly to create, design and print database diagrams (for existing tables). ...
2
votes
2answers
104 views

Workflow for SQL Server + Azure SQL development?

Lets assume the following: 5 devs all working on laptops Each develops/debugs on Azure compute emulator (code) and SQL Server (db) - both running locally on their laptops. I'd like to have ...
5
votes
3answers
3k views

How can I inspect the security settings of a SQL Server Endpoint?

I am in the process of creating a TEST environment for our SQL Server development staff. In production we have 3 SQL Servers, SQL01 contains several databases that are mirrored to SQL02. SQL03 ...
2
votes
1answer
143 views

Transaction level difference between using a large IN filter VS. “BEGIN TRAN/COMMIT”

I would like to delete about 100,000 records with minimal server overhead. I've had a few nagging questions I haven't been able to test properly so I figured I'd ask some experts here. Which would ...
1
vote
2answers
205 views

Query Linked Server Logins

I'd like to produce a listing of linked servers and their mapped logins. Anyone know how? sys.sysservers will show servers, but no login information is presented.
6
votes
1answer
474 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
313 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
429 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
669 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
173 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
67 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
13k 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
573 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
824 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
268 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
202 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 ...