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)

2
votes
3answers
777 views

Moved Model Database and now my SQL Server doesn't work

I moved my Model data and log files: ALTER DATABASE Model MODIFY FILE (NAME = 'modeldev', FILENAME = 'D:\Data\model.mdf') ALTER DATABASE Model MODIFY FILE (NAME = 'modellog', FILENAME = ...
0
votes
1answer
2k views

Keyword Search a single SQL Server table for multiple search terms and create a new table from results?

I am not a database administrator. Most of my experience is with MySQL. However I think what I want to do is in the realm of possibility. I want to text query a single large table in a SQL Server ...
5
votes
1answer
186 views

Placing an ASSERT in a SQL Server query

As part of a MERGE query that I want to run I'd like to assert at runtime that a certain condition holds. When a MERGE-match is found I'd like to update a certain column and have the following logic ...
2
votes
1answer
2k views

Does SQL Server allow INSERTs into tables and indexes to be written in parallel?

If I have a table that has many indexes, and I run a statement that inserts rows into the table, will SQL Server insert rows one-at-a-time, or will the rows be inserted using parallelism?
0
votes
2answers
236 views

Is it possible to speed up this PARTITION BY query?

I've got a timeserie table. Each datapoint has also a statut field which indicates its providing source. I'd like to request last available datapoint as of date T but there could be several results, ...
0
votes
2answers
454 views

How to create a versioning DDL/DML change script for SQL Server?

I have an application which has a database, and some versions of the application introduce schema changes. To make installation easier (?), I figured I want to create a meta table which contains the ...
0
votes
0answers
385 views

SQL Server: mirroring several tables in different databases

I want to keep several tables in two different databases mirrored. Both databases are within the same server, and both are SQL Server dbs. This mirroring only affects the data they contain, not the ...
0
votes
1answer
309 views

NTEXT,Indexing, and lob logical reads

We have an query that would benefit from a covering index but one of the columns that would be returned is a NTEXT data type. I know this can't be added to the index and I also know it would be good ...
3
votes
4answers
6k views

SQL Server 2012 copy database failed

I want to make a copy of database in the same SqlServer . so, When i using the Copy Database Wizard, it throw error: ( I did this steps with a test DB and it works fine !!!!) config: sa user ...
3
votes
2answers
2k views

Backup name in Maintenance plan

I used to have SQL Server 2005 installed on my server. In my maintenance plan, the backup name format was like this: mydatabase_backup_yyyymmddhhss.bak. Now I am using SQL Server 2012 but I am ...
5
votes
2answers
578 views

Any advantage of having a second index with included columns on a primary key?

I'm reviewing our database and noticed that on a particular table we have the following indexes: Table: Col1 INT IDENTITY(1,1) Primary Key Col2 INT ... about 15 more columns .... ColN ...
0
votes
0answers
3k views

Restore a backup from SQL Server 2008 R2 to SQL Server 2014 [closed]

How can I restore a backup from an earlier SQL Server 2008 R2 version to SQL Server 2014? The error I get is 38: reached the end of file although the file is not corrupted. Thank you.
0
votes
1answer
191 views

Table Valued Parameter not pulling the correct data for my sp?

http://sqlfiddle.com/#!3/b2643/5/1 http://sqlfiddle.com/#!3/b2643/5/0 This link above has the sample database tables I created on SQLfiddle. I have 3 main tables in my stored procedure: ...
2
votes
1answer
184 views

Does Index Intersection work with Included Columns?

I've been asked by a report designer whether it is acceptable to add a new index to a table to speed up a particular report. The index would be on a single column, CreatedDate, but would have ...
0
votes
1answer
49 views

How to determine consumption of data for archiving in sql server?

I was told that it could be possible to analyze the consumption of a given row. I already know I can use sys.dm_db_index_usage_stats to see the reads / writes on a given index (thus the table) but I ...
2
votes
1answer
121 views

Replace consective numbers from a string

So if I have a table with values: Name ID ---- --- James 100 James 101 James 102 James 200 James 201 James 202 Alex 100 Alex 101 Alex 102 Alex 105 Alex 106 Alex 109 ...
0
votes
0answers
23 views

Help understanding SQL Server Developer License when users test via webserver [duplicate]

I'm trying to understand how many licenses I may need if we decide to pursue a SQL Server Developer license for our Testing environment. We would have 5 actual developer and DBA's physically ...
12
votes
1answer
855 views

How can I design a query to pause / sleep / wait for a specified amount of time?

I am testing a monitoring application against a SQL Server 2000 instance. How can I write a T-SQL query that takes an amount of time that I specify? For example, most scripting languages have ...
6
votes
1answer
3k views

Move log file without taking database offline

I need to move a database log file to a new partition without taking the database offline. The normal way of doing this would be to detach the DB, move the log file then reattach the db. Is it ...
1
vote
0answers
22 views

Large transaction log won't truncate [duplicate]

I ran a full backup on SQL server 2008, but the transaction log stayed in tact. I though a full backup would make a new transaction log. What do I need to do to get my trn to a normal size?
7
votes
1answer
6k views

How to clone a user in SQL Server 2008 R2?

Is there a way to clone users' security and permissions in Microsoft SQL Server, preferably using the SQL Server Management Studio GUI?
1
vote
1answer
549 views

Sync postgreSQL with SQL Server database- on data change event

I have one PostgreSQL database and its data are being changed regularly. I want to sync all its data with my SQL Server database. One thing I can do is use query to check all required tables and ...
3
votes
1answer
2k views

Understanding sys.dm_exec_query_stats execution_count vs creation_time

I've just downloaded the SQL Server 2012 'Performance Dashboard Reports' and am having some issues interpreting the data shown by one of the results and linking it back to the DMV ...
0
votes
0answers
36 views

Designing a database with Ints [duplicate]

Pretty much a newb when it comes to SQL Server. The question is, in 2014, should I be optimising my int columns - tinyint for status, smallint for fixed size lookups, int/bigint for transaction ...
1
vote
2answers
53 views

How can I set myself as owner of a database ? just using sql

As I want to view dependencies of just a couple of tables in my clients database I want to set myself as the owner of the database. If the database is called MyDatabase and my userName is ...
-2
votes
1answer
620 views

How to restore a database from a .bak file to an existing database via GUI? [closed]

How can I restore a database from a .bak file to an existing database via the GUI instead of using the commands? Will the database be inconsistent if I restore a previous backup and what will happen ...
2
votes
1answer
3k views

Time out errors - MS access front end with SQL backend

First of all I don't know anything about SQL, so I apologise if I make no sense. I have created a MS access database and our IT area migrated the tables to SQL server 2008 and linked the tables to ...
4
votes
2answers
712 views

Why is my plan guide not being used?

We recently ran into the tipping point issue and some of our report queries that used to complete execution within a couple of seconds are now taking more than 2 min because the query optimizer simply ...
1
vote
0answers
37 views

data conversion error in SSIS 2005

I am encountering a tough problem when doing data conversion. My work is to generate fact table in ssis 2005, and there are several data that should be converted to other data type, so I use data ...
3
votes
1answer
55 views

Safe to start Mirroring on Production Server?

We have a 350 Gig DB on SQL Server 2008. We intend to backup and restore it then immediately start mirroring. Is starting a mirror a dangerous operation to do on a production database ? Can I expect ...
2
votes
1answer
213 views

A large percentage of unused space in the table

SQL Server 2005. I have a table size 16GB. Table has 14 GB of free space. sp_spaceused 'FREECLIENTDOC' name rows reserved data index_size unused --------------- ------ ...
2
votes
1answer
2k views

CTE Error (nvarchar to numeric)

I'm using a CTE to convert SSRS stored proc's into BO stored proc's, as apparently I can't use temp tables with Business Objects. I'm having this query: ;WITH cte1 AS ( SELECT cv.issue ...
7
votes
1answer
2k views

Database design for handling 1 billion rows and counting

We receive real-time GPS data at a rate of around 5000 pr. minute (from 4 TCP servers). Each server uses a single connection to insert the data, and buffers data in between inserts. Every 15 minutes ...
1
vote
1answer
143 views

Cannot login using SA with SQL Authentication

I can not log in to SQL Server 2008 in sa mode. I can only log in using Windows Authentication Mode. I chose only defaults while installing SQL Server 2008 R2.
2
votes
0answers
472 views

BobMgr::GetBuf: Sort Big Output Buffer write not complete after 60 seconds [closed]

One of our production servers showing below error msg in Sql Server Log from last week, SQL Server has encountered 20674 occurrence(s) of I/O requests taking longer than 15 seconds to complete on ...
1
vote
0answers
121 views

How to copy a subset of SQL objects across databases within a transaction?

We already have a .dtsx package to copy a subset of tables (about 20) from one database to another (at least once in every month). It is using "Transfer SQL Server Objects Task". However this does not ...
-1
votes
1answer
2k views

pivot a table with cell name as column name

I have a table structure is : year | code | name| value | wef | 2014 | a001 | abe | 2000 | 2014-04-01 | 2014 | a001 | def | 3000 | 2014-05-01 | 2014 | a002 | abe | 2000 | 2014-06-01 | ...
-1
votes
1answer
163 views

Backup and Restore Database Method

I have a production database. I am using FULL recovery model. I am taking regular FULL backup every week. I am planning to take LOG backup every day. Now, if my database crashes or failed to load due ...
3
votes
3answers
9k views

A transport-level error has occurred when sending the request to the server

In our Vb.net application(userd within a local network connection inside a office), which is used from long time now some of the users get the errors only sometimes a day A transport-level error ...
3
votes
1answer
3k views

SQL Server PerfMon: Compilations/sec > Batch Requests/sec

I've been looking at various PerfMon metrics on one of our client's SQL Server instances trying to get a good gauge of where our database (or server) could use improvements. One measure that has me ...
0
votes
1answer
59 views

SQL Server Alerts on VMs

Newbie here.. Hello Searching online and I could not find any articles/blogs that pointed, related or had any opinions regarding SQL Server and SQL Server Alerts installed/running on virtual ...
2
votes
2answers
194 views

Backup and Restore of Development

I am wondering if anyone can provide information on taking a differential backup and then restoring that differential backup to another SQL Server database? I have a production environment that is ...
1
vote
0answers
17 views

How to enable Parallel Data WareHouse? [duplicate]

How do I enable Parallel Data Warehouse on my Microsoft SQL Server. I am trying to run this SQL statement below and received this error. ERROR: Msg 11305, Level 15, State 10, Line 2 The Parallel ...
4
votes
3answers
2k views

Looping through values stripping 1 character at a time

I want to loop through values and strip 1 character at a time from the values and display the result. So if I have a table with values: ID ___ 34679 13390 89906 I want the result to look like this ...
0
votes
2answers
755 views

Mirroring between two Ms-sql servers for Migrating server from one Datacenter to other Datacenter

I have a query about microsoft sql server. I'm looking for migrating ms sql server from one vendor to another vendor(Datacenter). I'm looking to have a mirror configuration between servers since my ...
1
vote
1answer
88 views

Is there a common approach to encrypting data at the database level?

Is there a common approach to encrypting data at the database level? The application I am working on will be storing sensitive data that only users of the system themselves will be able to view.
1
vote
1answer
297 views

Retrieve next queue item

I have a simple table in SQL Server 2012 which implements a processing queue. As data has been inserted the query to retrieve the next item has gone from <100ms to a constant 5-6secs. I would be ...
1
vote
2answers
563 views

Restoring database from a server that uses data compression

In our environment our production server is using MS SQL Server 2008 Enterprise Edition. We have a development and test server that runs MS SQL Server Standard Edition and the table structure between ...
-1
votes
1answer
166 views

Stack overflow when parsing a lengthy query

I have a lengthy T-SQL Script. When SQL Server attempts to parse the script, it raises this error: Msg 565, Level 18, State 1, Line 106620 A stack overflow occurred in the server while compiling the ...
7
votes
3answers
602 views

Restricting users to COPY ONLY backups

I am looking to deploy log shipping in my production environment. This will mean I will have to manage backup chains which could be disrupted by people taking backups to refresh development ...