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)

0
votes
1answer
11 views

Triggers on Insert or Update SQL Server (Spatial)

I am looking at creating a trigger on a live MS SQL spatial table that will update a field when a user either: 1. Creates a new feature 2. Updates the geometry of a feature in a GIS application. ...
0
votes
2answers
24 views

SQL Server user cannot select from a table it just created?

I'm having trouble understanding permissions in SQL Server (in this case SQL Server 2012, but not sure how version-dependent this issue is). I can create a database, create a login/user on master, ...
7
votes
1answer
62 views

How to optimize a query so that it seeks on one index first, and then another index after that

I have two sets of earth measurements from satellite data, each with time fields (mjd for mean julian date) and geography positions (GeoPoint, spacial) and I'm looking for coincidences between the two ...
0
votes
1answer
37 views

Restore user db from UNC

I need to create a job that restores all user databases from UNC to my SQL Server. All the backups, for 3 days, are located in the same folder and I need to restore the last modified backup. What is ...
0
votes
1answer
32 views

Replacing a Cursor with a single Query possible?

I have this challenge where I'm trying to figure out if I can write something in a single query rather than using a cursor. The problem is I need to get items from a batch table based on a list of ...
0
votes
1answer
32 views

Index cleanup/usage help

My question is this: When running sp_blitz, I get a lot of these 2 warnings/suggestions: Index Hoarder: Unused NC index and Feature-Phobic Indexes: Potential filtered index (based on column ...
0
votes
1answer
43 views

How to exclude weekends and holidays in a query

I have been tasked with creating a flat file. One of the fields that I need is a date field. I need the disco date to be LAST_EVENT_PROC_DT + 12 unless that date falls on a weekend or holiday,if so ...
0
votes
0answers
33 views

How to confirm if the backups are going to tape in SQL server 2005 and 2008R2

We have many of our SQL servers where we take the backup locally on the server as well as over the network to other server in case of disaster. Also, we have a process set that server support team ...
2
votes
3answers
494 views

How does unique key help to improve SQL query performance?

Suppose I have a table with an id column and and I am maintaining unique values manually while inserting and updating records instead of creating a unique key on that column (e.g. by using a date ...
2
votes
2answers
50 views

Changing an nvarchar column to datetime

I am new to SQL Server and I have a problem. I created a database to store dates in an nvarchar field but now I need to convert that field to datetime. I searched the internet and couldn't find a ...
0
votes
1answer
22 views

How to Store text of 15 to 20 KB file data in blob or as text? [duplicate]

How to Store text of 15 to 20 KB file data in blob or as varchar in sql Server?
-5
votes
0answers
18 views

sql server query [on hold]

In front end I am selected one number from dropdownlist if database table contains this number then gridview shows the number and some message else grid view shows the number and other message what is ...
-2
votes
2answers
24 views

how to join one select statement to another pivot select statement [on hold]

SELECT emp.UserId ,emp.EmployeeId ,emp.FirstName ,emp.MiddleName ,emp.LastName ,emp.MobileNumber ,emp.HomeNumber ,emp.OfficeNumber ,convert(VARCHAR(10), emp.USJoindate, ...
2
votes
1answer
16 views

SQL Server Active Directory login groups with limitation

I'm DBA in my organization and use SQL Server 2012 and 2014. I requestd to define multiple group in active directory such as Developer, DBA, supporter and ets... and add my users to this groups. after ...
0
votes
2answers
103 views

Calculating values from three related tables, without using join or union

I have a simple basic three tables on SQL Server database: What is needed is to get the quantity available, without using joins or unions which is calculated: Quantity Available = Items Opening ...
0
votes
1answer
24 views

Tracking Table Structure Changes [on hold]

I'm by no means a full DBA, so I'm kind of shooting in the dark right now, but we'll see how this goes. This is with Microsoft SQL Server 2014 with our applications written in ASP.NET. What we want ...
4
votes
1answer
70 views

Move live SQL Server database to a new server

I have a production server running SQL Server 2008 Web Edition, and it has to keep running 24x7 with almost no down time, and it's the time for us to move to a more advanced server hardware, also it's ...
1
vote
0answers
32 views

Overwhelmed with Sensor Data - Excel to SQL fails

I'm managing a lot of sensor data and need to do charting, smoothing, stats over time on the data. Currently I import the data from flat files using VBA to do ETL into Excel. The format of the data ...
0
votes
0answers
16 views

Log Shipping Fails to create backup after Server reboot

We made a change last week to point our log shipping backup jobs to a new Windows File Share. For three days everything was running successfully. On Saturday night we performed our monthly ...
0
votes
0answers
25 views

ASP.NET Session Database - what user to create?

I am migrating a .Net 3.5 website with SQL Server 2005 Enterprise databases to SQL Server 2012 Enterprise (website still .Net 3.5). It uses ASP.NET session state database of type "t" Temporary. ...
2
votes
0answers
52 views

bug in sp_rename

I've searched high and low, but I cannot find anyone mentioning that when you run sp_rename, then you should mark the objects for recompilation too. As in EXECUTE sp_rename 'fct.MyTable', ...
11
votes
2answers
610 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
28 views

How do I reduce SharePoint 2010 SQL server log files? [duplicate]

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
30 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
35 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 ...
4
votes
1answer
41 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
41 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
0answers
22 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
45 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
41 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
39 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
40 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
79 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
28 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
24 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
19 views

Can't start MSSQLSERVER service [on hold]

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

Replicate SQL Server 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
11 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 ...
2
votes
0answers
24 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
55 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
55 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
36 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
46 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
7 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
40 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 ...
1
vote
2answers
32 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
17 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
64 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 ...