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)

3
votes
2answers
182 views

Why these characters are all equal in SQL Server?

I just don't get it. See this SQL query: select nchar(65217) -- ﻁ select nchar(65218) -- ﻂ select nchar(65219) -- ﻃ select nchar(65220) -- ﻄ if nchar(65217) = nchar(65218) print 'equal' if ...
1
vote
1answer
18 views

How do I reduce SharePoint 2010 SQL server log files?

I have a work place portal built on SharePoint 2010 and the SQL Server drive space is full. I am using SQL Server 2008 R2. Of the 800 GB disk space, the log files have taken approximately 730 GB. ...
-4
votes
0answers
26 views

Estimated and actual execution plan for a Parallel Query [on hold]

for a parallel query, there is a big difference between estimated and actual execution plan. Does anyone know the reason?
0
votes
0answers
13 views

Moving Database SQL Server 2012 to 2008/R2 [duplicate]

I'm planning to move a Large Database from SQL Server 2012 to 2008/R2. I tried the scripting thing, it works on a small-medium type of database but not on Large database w/c is about a hundred MB. Any ...
3
votes
1answer
28 views

How to tell if a backup file contains CDC?

Using SQL Server 2008 through to 2014, I know how to backup and restore a database with Change Data Capture enabled (CDC), but what I am looking for is a way to query a full backup file to determine ...
1
vote
1answer
40 views

Having issues with a CTE in a Nested Join [on hold]

I'm unfortunately dealing with someone else's code here, but needing a little push. What I have happening is that I have a CTE that is needed to run in a nested join. ...Start of CTE INNER JOIN ( ...
0
votes
1answer
16 views

How to update both the source and the target using MERGE?

I have two tables that I want to merge. Each has row contains the last time it was modified. I want to merge the tables such that the newest value is assigned to both tables. This is the code I want ...
0
votes
0answers
21 views

Transactional replication of stored proc execution and stored proc parameters

I'm trying to design how we might go about setting up replication of just the execution of a stored procedure. If the stored procedure on the source takes one or more parameters, will those same ...
1
vote
1answer
32 views

How to perform a pivot on multiple columns

I have a list of data that includes values and the time those values were recorded. I would like to pivot this data so that i have as columns the individual types of observations and the date/time ...
0
votes
1answer
36 views

SA login history in sql

Is there any PowerShell script to get the SA log in history? I need to do an audit on SA login.
1
vote
2answers
37 views

Can SQL Server Transactional Replication do this?

We have a production server and a reporting server, with transactional replication in place to move all inserts/updates/deletes from production to reporting. We're using SQL Server 2008 R2. We have ...
2
votes
2answers
39 views

Database recovery procedure

I recovered a database with last full backup, all differentials after the full, and then all log backups after the last differential. Can I trust the database is right or do I have to do it again the ...
2
votes
1answer
77 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
26 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
21 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 ...
0
votes
0answers
17 views

Can't start MSSQLSERVER service

The SQL Server (MSSQLSERVER) service terminated with this message: service-specific error WARNING: You have until SQL Server (MSSQLSERVER) to logoff. If you have not logged off at this time, ...
-1
votes
0answers
32 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
10 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
1answer
9 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
22 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
43 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
6 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
37 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
26 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
16 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
57 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
49 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
24 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
31 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
571 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
23 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
33 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
26 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
56 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
43 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
46 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
62 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> = ...