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
2answers
54 views

Migrating from text and image to varchar(max) and varbinary(max)

I have a SQL Server database which contains a number of image and text columns, and I'm studying potential problems that might arise from migrating them to their non-deprecated counterparts ...
3
votes
3answers
120 views

Make a column for each count(*) in a day of the week

I have a table of people who are doing piece work. Every entry in the table has a user-ID, name, and a Date for each report they enter. I need to make a weekly report of what these people have done ...
1
vote
1answer
49 views

What is the best option to easily fix fragmented heap indexes?

I have SQL Server 2008 R2 SP2 and also SQL Server 2012 SP2 on these servers. I have a database in which there is a lot of heap indexes which are more than 90% fragmented. What is the best option ...
3
votes
1answer
30 views

Insert a range of numbers from a call to sp_sequence_get_range

Given the following code: CREATE SEQUENCE dbo.NextTestId AS [bigint] START WITH 10 INCREMENT BY 2 NO CACHE GO DECLARE @variableNumberOfIdsNeeded INT = 7, -- This will change for each call ...
5
votes
2answers
342 views

Why is MS-SQL Server 2014 consuming so much RAM with no active data stored?

I'm running MS-SQL Server 2014 on my laptop - along with a ton of other installed applications, from Visual Studio to video games. This is obviously not a production server, but for development and ...
0
votes
1answer
29 views

Filtered index throwing error - UPDATE failed because the following SET options have incorrect settings: ANSI_WARNINGS

While executing proc1, I am getting error as below: UPDATE failed because the following SET options have incorrect settings: 'ANSI_WARNINGS'. Verify that SET options are correct for use with ...
4
votes
0answers
15 views

Move content between filestream containers

I have a server running SQL2012 with Multiple Filestream containers on a single table. I need to split one of the existing filestream containers into two parts by creating a new filestream container ...
3
votes
1answer
43 views

Mirror db from production to test and acceptance nightly or weekly

I have read this Easy or Schedulable way to move data from Production to Test and it seems not automated. I would like to have a daily or weekly push of my production server data to one or two ...
0
votes
0answers
31 views

SQL FullText Search and pdf

First of all, thank you for comming here : I wrote a script in SQL able to find words in a file, with a lot of help of some websites ...
0
votes
0answers
11 views

All actions denied on MS SQL Server on Go Daddy Hosting

i have a website hosted on GoDaddy and I need to create a database for it. So headed to the Databases section and created a MS SQL Database then on my local pc I tried to access the database via SQL ...
1
vote
0answers
13 views

Hyper V replication - vs - sql replication solutions

I need to establish an offsite copy of a number of production servers, including SQL server. Hyper V replication has been chosen as a simple solution (all servers are virtual). This is to supplement ...
0
votes
0answers
18 views

Using fetch is it possible to take the first n rows based on a grouping column

I am using pagination concept to fetch the list of records using Fetch. But I have a problem here. Since I am using split on in my API,I will return redundant records from the stored procedure. My ...
2
votes
2answers
57 views

concatenating columns from multiple unrelated 1-row resultsets

Assume I have these two queries in SQL Server 2014, both of which return one row from unrelated tables: SELECT SUM(A) A, SUM(B) B FROM X SELECT SUM(C) C, SUM(D) D FROM Y I'd like to combine these ...
0
votes
2answers
43 views

SQL Server Database recovery from corrupt database [on hold]

Last week I backed up my SQL Server by using Backup Exec 2012. I named the file "SQL Server BAK" which contained copies of my SQL Server databases. A few days ago I lost some part of my data due to ...
1
vote
1answer
50 views

Least Privilege for SQL Agent to run DISKPART

The DISKPART script SELECT DISK 1 ONLINE DISK runs fine as long as SQL Agent has admin rights on the server; otherwise the script fails with this message: Message Microsoft DiskPart version ...
0
votes
1answer
21 views

Redirect Connections to a SQL Instance

I have a LAN in which clients connect to the SQL installed on a Server with the IP address of 192.168.1.10 (SERVER_A) . I have another SQL instance installed on another server with the IP address of ...
1
vote
0answers
32 views

SQL Server vs Oracle [on hold]

I am transitioning from SQL Server DBA to Oracle DBA. I have minimal experience with Oracle, and I have found that the best way for me to traverse if by correlating terminology and database engine ...
2
votes
1answer
26 views

Table structure for validating data using category and subcategory fields

I am creating a simple budget application, and the primary table will be a transaction table that contains things like the amount of the transaction, date, account, the category and subcategory (the ...
1
vote
1answer
34 views

SQL Server: Time Series Table Design

I am creating a time series database that follows the table structure here: Storing intervals of time with no overlaps. The difference with my design is that the FinishedAt column changes every time ...
0
votes
0answers
89 views

Datediff with many dates causes poor performance?

I am a system programmer and entered the forum to understand a little more of the database. Currently I picked a query with a lot of data and I had to check there is a gap between today's date and the ...
4
votes
2answers
53 views

Strange looking where clause in sql server

I've found fa strange looking code in T-SQL. Here is the strange looking part: WHERE @term1 IS NULL OR (@term1 IS NOT NULL AND (businessLogicCondition)) The query works well, but what is the point ...
0
votes
0answers
23 views

msdb.dbo.sp_start_job got stuck in stored procedure

I have a stored procedure USP_A with logic like following: ...... BEGIN TRY exec dbo.usp_Log 'Start to run job job1' Exec @intErrorCode = msdb.dbo.sp_start_job 'job1' IF @intErrorCode <> 0 ...
3
votes
2answers
241 views

Is there a standard for naming foreign keys when two columns reference the same table? [on hold]

I've always used the name FK_CurrentTableName_ReferencedTableName. I just ran into a situation where I've got a table with CreatedById and ModifiedById both pointing to the same (users) table, so this ...
1
vote
2answers
32 views

Reorganize Index Task [on hold]

Can the Reorganize Index task (maintenance plan or SSIS package) be used to tune performance? Is this an adequate step of triage for degraded application/query performance?
4
votes
1answer
118 views

How do I choose the right job owner?

This morning I had three failed jobs (no biggy) used for custom reporting DOMAIN\USER is no longer with the company. Error Message The job failed. Unable to determine if the owner ...
1
vote
2answers
67 views

check when last backup was taken

Brent Ozar had an interesing newsletter on 2015-06-22; How do you manage dbas measuring backups, where he thinks that a good DBA should check when the last backup was done it was last restored ...
0
votes
0answers
14 views

unsigned right shift '>>>' Operator in sql server [on hold]

How to write unsigned right shift operator in sql server? The expression is like value >>> 0 Here is the e.g. -5381>>>0 = 4294961915
0
votes
1answer
23 views

how to set default value of column 0 when NULL is inseerted

I have a table with a column which has default value to 0. However when null is inserted to this table, I want it to set it to default. As the insert query is generic and used by other databases too, ...
2
votes
0answers
23 views

Why my database mirror break down after changing file group settings from RESTRICTED_USER to MULTI_USER?

My environment is the following: VMWare 5.5 vitalized server MS Windows Server 2008R2 Enterprise domain and SQL Server 2008 R2 Enterprise. Centralized storage with fibre-channel connection. I have ...
2
votes
2answers
67 views

Conceptual ERD Multi-table many to many, or possibly recursive?

I'm creating a conceptual diagram [yes, I know I've included attributes and keys - but this is just for me to consolidate what I'm doing whilst learning] -- so please treat it as Conceptual with the ...
-2
votes
0answers
25 views

Keep connections alive when disconnected from network

In SQL Server, is it possible to keep a connection alive if the end user was disconnected from the network? Specific situation: If I am working with SSMS and create a temp table - is there a way to ...
-3
votes
0answers
27 views

Create database in SQL Server 2014 [on hold]

I have installed SQL Server 2014 on my laptop and I have not created new databases in SQL Server 2014 yet. Before creating a database, should I first create a private key and a certificate? If so, ...
0
votes
1answer
23 views

BCP - Different Schema

I have a transactional Replication (Non-SQL Server Publishers - Oracle) implemented for one SQL Server Database. Let's say Publishers: A, B Subscriber: C Note: I can not modify the Oracle DBs. The ...
4
votes
0answers
59 views

Which to trust?

We are troubleshooting a long-running issue with a vendor. Their software has a tendency to freeze up and stop working once or twice a week causing major disruptions to our operation. They have been ...
0
votes
1answer
22 views

SQL Server : multiple databases with transaction log on one SSD array

I know for HDD arrays that having multiple log files from different databases has a performance hit as it changes the IO pattern from sequential to random for the array. So having an array per ...
-5
votes
1answer
24 views

How to copy my SQL Server 2008 database [on hold]

In my SQL Server 2008 copy database option is not present. Can you help me to copy the database?
2
votes
0answers
34 views

How to verify replication data integrity in SQL Server when using external replication engine

I am looking for a way to verify that data I am replicating between SQL Server databases is making it to the destination OK. Data is being replicated using an external replication engine, no built-in ...
0
votes
2answers
21 views

Merge replication throws PRIMARY KEY violation during the initialization of Subscriber

I am using SQL Server 2014 SP1 to set up merge replication on Windows 2008. The databases (Publisher & Subscriber) are restored from the production back up of SQL Server 2005 publisher database. ...
-1
votes
0answers
41 views

Need Review - Index Rebuild and Index Reorganize strategy?

I've written a block of code to design Index Reorganize and Index Rebuild strategy based on following recommendation. I'm considering only Clustered and Non-clustered index, not Heap. Does anything ...
1
vote
1answer
47 views

Alternatives to SQL Server TDE

Due to the high cost of SQL Server Enterprise Edition which includes the Transparent Data Encryption feature I am looking for an alternative product and have only found a couple of options: ...
1
vote
2answers
154 views

order of inserting record is mismatching

Please check the below table structure and records to be inserted in that table. CREATE TABLE [tabGeneraltable]( id int identity, [codGenLedger] [uniqueidentifier] NOT NULL, [codInvoice] ...
0
votes
0answers
14 views

Replay Trace Results Slower On Better Server

I have captured a trace and replayed it using SQL Profiler on my new server capturing another trace at the same time. I am using DBSophic Qure Profiler to compare the traces as it compares each query ...
1
vote
1answer
65 views

INSERT [TableName] SELECT * FROM [TableName]

I just ran across a query: INSERT [TableName] SELECT * FROM [TableName] Note that it is the same table. This query causes serious blocking on one of my test databases (I wanted to drop it but ...
1
vote
0answers
11 views

SSDT sqlpackage.exe CreateNewDatabase Parameter Not Respected

Originally asked this on SO but that question seems to be populated only by tumbleweed so wondered if this might be a better forum for it. I have a VS2103 solution which includes a database project ...
3
votes
1answer
42 views

SQL Server 2012 mirror setup - how to reduce transaction log files [duplicate]

We just upgraded our Windows Server 2003\SQL Server 2005 setup to Windows Server 2012/SQL Server 2012. Both configurations have a mirror with NO witness server. On the old setup the transaction logs ...
0
votes
0answers
3 views

Replication Conflict tables in SQL Server 2000

Due to previous several replications during these years in a database I'm working with, there are several tables with names with this format : *onflict_AllData_[Tablename] which * can be a, b, ... ...
1
vote
1answer
43 views

Dynamic Partition Elimination when using “OR ” or “IN”

Say I have a query like this: SET @ContainerId = 5 SELECT * FROM Container.Container_Partitioned WHERE containerId = @ContainerId When I run this, I get a query plan with Actual Partition ...
1
vote
1answer
49 views

SQL errors Microsoft.ACE.OLEDB.12.0 on dev box, but works on server

I'm inserting into a .xls spreadsheet from TSql code. Runs fine as an Agent job and on command from the server, but not on my dev box. Both complex and simple commands like: Insert into ...
2
votes
0answers
42 views

SQL Server DB Backups WaitTypes

I am backing up a database to a network drive. I am seeing the below Wait types for the backup. I have also tried backing up to a local drive and same issue (though backup does run much quicker). ...
0
votes
1answer
20 views

Talend collation issue in mysql

I am using Talend to backup MSSQL TO MYSQL Server. Everything goes well, I have a connection, data flows from one db to the other... however I cannot correctly copy diacritic signs. On MSSQL I have ...