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
1answer
16 views

Can I backup (Full) the Log-Shipping Secondary Database?

I have a Highly pressured Production Environment with Database name DB1. And I want to run a weekly DBCC CHECKDB process on one of the databases there. (You can understand,I can't do it on my ...
1
vote
0answers
18 views

Suggestion for SQL distributed transactions via MSDTC

Currently we do not use MSDTC in our company. Our developers would like to start using MSDTC for Distributed Transactions within their applications. Questions: Is it okay to use MSDTC for SQL ...
0
votes
0answers
16 views

Incoming Tabular Data Stream Error

I created a SQL Server Agent Job with two different schedules. One is at 6 AM, the other is at 11 AM. When it runs at 11AM, it works fine; but at 6 AM it fails and gives this error message; The ...
-1
votes
0answers
28 views

Split Column Sentence Into Word [duplicate]

Id Name 1 xyz abc xxx www 2 aaa 1 bbb c 3 ggg 4 ccc j I want to split the words in the name column and insert into another table. Expected result: name ---- xyz abc xxx www aaa 1 etc ...
0
votes
0answers
7 views

Replicate SQLserver tables between AWS RDS instances

We are running an RDS instance in AU region and would like to replicate some tables to RDS instances in other regions. A lag of a few hours is acceptable between master and slaves. As we're on RDS ...
0
votes
0answers
6 views

I keep getting an error 10060 trying to connect object explorer in Visual Studio 2013 to an Azure Database

Using Win 7, Visual Studio 2013, (or Sql management tool 2014) This is for a class and its all software on the trial period. In Visual Studio server explorer - I can connect to the Azure Server I ...
1
vote
0answers
19 views

Why can't we have multiple cascade paths?

You can see that many questions have being asked about multiple cascade paths. For example: http://stackoverflow.com/questions/851625/foreign-key-constraint-may-cause-cycles-or-multiple-cascade-paths ...
2
votes
1answer
53 views

BACKUP AND RESTORE FileGroup (PRIMARY) - WHY after restore I still see Other FileGroups?

/********************************** CREATE DATABASE PiecemealDB *************************************/ use [master] go if exists (select * from sys.databases where database_id = DB_ID('PiecemealDB')) ...
1
vote
1answer
54 views

Why is this select statement not returning what I've provided?

I have 3 tables in my SQL Server I am wondering why is my select statement not working or giving the result with my condition in the where clause. I learned back there to use this kind of method.. ...
0
votes
1answer
34 views

INTERSECT query rewrite as JOIN?

I have two queries written in PHP against a Microsoft SQL Server database (I know this is weird). I'm querying one table. I want the records shared by both results sets ONLY. Here is query #1: ...
5
votes
0answers
39 views

Low PLE on NUMA node 000, high on 001

I'm looking at PLE (Page Life Expectency) across NUMA nodes on our SQL Servers, and came across a rather weird distribution. Numa node 000 has a very low PLE compared to 001. I'm unsure why this is. ...
0
votes
1answer
18 views

Remote connection to DB instance from fresh formatted system?

I have 1 win7prof fresh system. Now I want to connect to a DB instance remotely via sqlcmd/any other way. My req is to connect and execute select query? is there any method/software needed to be ...
0
votes
0answers
5 views

Cannot Deploy SSAS Package into VM / TCPIP

I'm sure that this is just a simple settings problem but I just don't get my head around it. I installed SQL Server 2014 incl SSAS in a VM on Server 2012 (using HyperV in win 8.1) and have VS Data ...
0
votes
0answers
30 views

How to break down a sql select query into smaller chunks? [on hold]

I'm querying my SQL Server database from C# and the resulting dataset throws a MaxReceivedMessageSize exceeded exception. My MaxReceivedMessageSize size is set to size 40960000, and I'd like to keep ...
0
votes
2answers
25 views

Why do we have negative length for character maximum length for geography and varchar(max) data types?

Why do we have negative length for character maximum length for geography and varchar(max) data types? Character_Maximum_length = - 1
-1
votes
0answers
15 views

Trying to match transactions from two tables and list all unmatched rows

I'm having two tables of transactions and there are couple same transactions in both tables (same trade date, same quantity, same amount, same index). I'm having problems while two trades have same ...
4
votes
3answers
56 views

Is there an advantage to not partition aligning an index?

I have the privilege of managing a large partitioned OLAP table. While reviewing this table I noticed one of the indexes is not aligned with the partitioning scheme. Since the author is not ...
0
votes
1answer
47 views

Will restarting SQL Server clear my transaction log? [on hold]

I have a client that restarts his SQL Server instance to clear an application problem he is encountering. I find this is very odd, I don't think you should ever restart the database in normal ...
0
votes
0answers
21 views

SQL Server Windows authentication: VMs versus others

This really seems like a weird one to me. I have two VMs of interest, one is running Win2k8 R2 x64 and the other is running Windows 7 X64. The server is hosting SQL Server 2k8 while the latter has SQL ...
1
vote
1answer
29 views

Insert into table select * from table vs bulk insert

I just wanted to know that SQL Statement INSERT INTO TABLE1 SELECT * FROM TABLE2, will work same like bulk insert ? If no, Is there any way exclude index while inserting records. Process is inserting ...
1
vote
1answer
13 views

How to manually invalidate a pull merge replication snapshot from the publisher

XY Problem background info: I have a pull replication publisher in which I want to add or alter a index and have those changes be applied to the subscriber. The solution to that problem I would like ...
0
votes
0answers
38 views

Can a critical section cause deadlock in SQL Server? [duplicate]

We get the next ID for our tables from a separate table with two columns, TABLE_NAME and NEXT_ID. We have a stored procedure which reads the NEXT_ID and then adds an increment to the NEXT_ID. The work ...
8
votes
6answers
559 views

Migrate from SQL Server 2000 to 2012 without a 2005 or 2008 instance

I have come across three old databases sitting on SQL Server 2000 which I need to move to 2012. I believe the standard approach is to restore into a 2005 or 2008 instance, update, re-export and ...
0
votes
0answers
22 views

Database Log Files Getting out of control [duplicate]

We have a database in which the transaction log file is blowing up to 100GB with the actual database being 1GB in size. It blows up pretty quick as this database is pulling data from another database ...
2
votes
2answers
37 views

sp_send_dbmail stored procedure send with attachment

I've been tasked with sending a small monthly report to for one of my customers. The report has previously been run manually on the instance, the output copied to a spreadsheet and send to the ...
0
votes
1answer
32 views

SQL AlwaysOn Data Sync

We are in the planning phase to implement AlwaysOn Availability Groups. What is the best practice to setup the file share for data synchronization? Network path or local machine (creating a share on ...
0
votes
0answers
24 views

2PL and Real Application Contest, a 2013 Questions? [on hold]

In 2PL (two phase locking), what advantage(s) does the rigorous model have over the strict model? I) There is no advantage over the strict model. II) In contrast to the strict model, it ...
9
votes
1answer
131 views

Does sys.sql_logins.is_policy_checked mean that the policy has been checked?

When I look in sys.sql_logins, I see a column called is_policy_checked. Can I trust that my password policy has been checked for all of the logins where this column is 1?
1
vote
1answer
55 views

Possible to restore a damaged database's PRIMARY filegroup only?

I have a database (MyDatabase) with 2 filegroups, [PRIMARY] and [SECONDARY]. The [SECONDARY] filegroup has 2 datafiles, [DataFileA] and [DataFileB]. [DataFileA] is damaged (even after DBCC CHECKDB ...
-1
votes
1answer
41 views

SQL Server Agent Job Error running an SSIS Package

I've set up a SQL Server Agent job to run an SSIS package, but it is failing with an error: This Job failed. The Job was invoked by Schedule 1114. Does anyone know why I'm getting this error? ...
4
votes
6answers
1k views

How to find the nth highest salary in SQL?

I have found a query to find the nth highest salary from Employee table , but i don't understand the logic of (N-1)? EmpID Salary 1 90000 2 80000 3 54000 4 ...
1
vote
1answer
45 views

Database design - load multiple excels daily

My first post ever :) Apologies if I am not so clear with my question - here I go... I have a design problem from database schema perspective. My use case is following: On a daily basis, system ...
0
votes
0answers
36 views

How not to keep the database offline when not accessed for a lengthy period of time?

May I know how I can manage the SQL Server database not to keep offline when not accessed for a lengthy period of time? I'm using SQL Server 2012. Almost everytime on the very first run of the query ...
1
vote
3answers
59 views

How to store a query result into a variable? SQL Server 2008

I have two tables and I want to store the result query of my stored procedure into a variable. UserTable: UserID int primary key identity CredentialsID int AccountType nvarchar(15) ModifiedDate date ...
0
votes
0answers
12 views

Adding cores to sql server license [on hold]

We need to double the number of cores attached to out sql server license (4 cores to 8). Anyone done this? I have a quote for the extra cores but haven't seen any documentation on how to complete the ...
2
votes
1answer
30 views

Display multiple IP address values for one system in a single row

I cannot for the life of me get the systems with multiple IPs to display under one row. Below is the current SQL statement I have. systems with more than one IP show up as duplicated on the report. ...
2
votes
2answers
55 views

String that contains letters representing a negative number

I would like for every string that has a letter on the end make it a negative value. <field> = '00000000014545p';--Varchar(15) <field> = '00000000012645x';--Varchar(15) <field> = ...
1
vote
2answers
61 views

Normalization of library book table with multiple authors

I have a database structure with two tables: The first one is called Author, has two columns (AuthID, AuthName) and its Primary Key is (PK_AuthID). The second one is called Book and has three ...
0
votes
0answers
19 views

How do I tell what roles a Windows Domain Login is in in SQL Server [duplicate]

The following question answers what roles is a user in in SQL Server: http://stackoverflow.com/questions/3609318/listing-users-and-their-roles-in-sql-server That only works for SQL Users, it doesn't ...
0
votes
1answer
34 views

Fastest way to disable indices and drop constraints and rebuild SQL Server table

Below are some T-SQL commands that we're running on a table with a few billion records. Most of the database's size is taken up by 5 tables like this. What is the quickest way to perform these steps ...
1
vote
1answer
38 views

Fail to attach database : MSDTC Check status of transaction

I am attaching a database from a snapshot taken of the production database volumes. These databases will be anonymised and then restored to our DEV servers. Here is my attach statement: CREATE ...
4
votes
2answers
593 views

How to Randomly Select a Date?

I am using in a Bash Shell Script this code for retrieving a random date. Is there a way to do that also in Microsoft SQL Server? I can imagine that through a single SELECT query and probably by ...
0
votes
2answers
66 views

Why is Full Recovery model a requirement for AlwaysON? [closed]

We have all our production databases in simple recovery model, and are very happy about it because it fully satisfies our RPOs and RTOs. Now we want to implement AlwaysON DR solution for our ...
0
votes
2answers
36 views

export data from SQl to text file/MongoDB

I have some data in multiple tables (ACTTAB, APTTAB, ...) How do I export this data from SQL and insert into a text file? How can I import this data into MongoDB?
2
votes
1answer
99 views

Improve SQL Performance with LIKE '%ABC%' QUERY

I know that using a LIKE '%ABC%' query will not use indexes and there is little that can be changed to the query to improve this, however what can do to make execution quicker? At this stage we ...
0
votes
0answers
30 views

SQL Server pre-login handshake error

I am working on a system where sometimes request/sec increase up to 680. It's a .NET 4.0 web api. In normal situations when requests are fewer, everything is fine, but sometimes when the number goes ...
4
votes
1answer
31 views

Does NTILE work over floating point numbers?

I am trying to use NTILE on my data using a float data type in my PARTITION BY clause. Please excuse the contrived example, but I think the best way to illustrate my question and confusion is through ...
1
vote
1answer
41 views

Using a CTE in IF EXISTS Query

Is it possible to do something similar to the following in SQL Server 2012? IF EXISTS ( WITH DATA AS ( SELECT *, ROW_NUMBER() OVER(PARTITION BY column ORDER BY Column) AS rn ...
0
votes
0answers
44 views

DBCC checkdb - DATAFILE is corrupted [closed]

I run on one of my SQL Server databases the command "DBCC CHECKDB". you can see below the output. From the output I get the pageid (9:xxx) select object_name(9) >> I get that it is about ...
1
vote
1answer
72 views

high PAGEIOLATCH_SH waits on server [closed]

EDIT: I know this question is closed, but I hope it will help someone. The problem is on our disks ( cluster ). Using PerfMon, I could create some counters ( disk reads and writes ) and the reads ...