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
0answers
26 views

SSRS 2008R2 SQL Service Account Connection Issue

In our SSRS report manager page we get the below error on the Datasources. This all worked fine previously and seems to suddenly have stopped working. I have no idea what the issue could be. All SPN ...
-1
votes
2answers
50 views

Update code works in manual stored procedure but not when run as SQL Server Agent Job

I have a stored procedure that deletes all records from an existing table, and then inserts new records. After the insert I have several update operations that change the value of one field. If I run ...
4
votes
0answers
50 views

On Prem SQL Server: Log shipping via Azure Blob Storage: Possible?

This is about on premise, regular SQL Server 2014, Standard edition. This is NOT about SQL Azure. The only part of Azure in this conversation is Azure Blog Storage, as a transport for some bits (SQL ...
7
votes
1answer
98 views

DENY overrides GRANT in SQL Server?

I'm studying for exam 70-462 and I'm practicing with some exercises I find around the web. In the site "Microsoft Questions and Answers" there's one solution I don't understand. The solution's last ...
1
vote
1answer
37 views

Monitoring the rows in a table

I'm trying to achieve the following tasks in SQL Server. I have a table that I need to monitor its growth. The table shouldn't be containing more than X amount of rows, if there are that many amount ...
0
votes
2answers
34 views

Will reindexing use the empty space or just grow table?

I have a table which is 170 GB and it has 98 GB of free/empty space. The free space was created by a massive deletion. If I run DBCC REINDEX or ALTER INDEX REBUILD, will the index use that free space ...
2
votes
2answers
74 views

How should I (re) index the table while keeping the transaction log small?

I have a 170 GB table in a database. It has 70% fragmentation on its index (index has multiple columns in it). The last time I tried DBCC REINDEX the transaction log blew up in the hundreds of GBs. ...
1
vote
2answers
114 views

OLAP or OLATP - How to determine

I have SQL express server with database that is used by one application. I am trying to optimize the DB but am not sure if the DB is OLTP or OLAP. There is no analysis server installed, the DB is ...
0
votes
0answers
31 views

Moving results from an MS SQL query in Excel - line breaks in data

I select all the output from my query by clicking in the left upper corner in the MS SQL Server Management Studio results window. I right-click, then select "copy with headers." Then paste into ...
4
votes
1answer
130 views

How to avoid using Merge query when upserting multiple data using xml parameter?

I am trying to update a table with an array of values. Each item in the array contains information that matches a row in a table in the SQL db. If the row already exists in the table, we update that ...
0
votes
1answer
17 views

How to order the where clause and join columns in a covering index?

Simple query example: Select t1.A, t1.B, t1.C, t1.CustomerID from table1 t1 join table2 t2 on t1.CustomerID = t2.Id where t1.A = 'x' and t1.B = 'xx' and t1.C = 'xxx' I created a non clustered with ...
0
votes
0answers
13 views

Are linked servers always heterogenous connections?

I have a test server and a production server, both SQL Server 2008 R2. My app's testing is done on the test server, but a related app (not under my control) has test databases in the development ...
0
votes
1answer
30 views

SQL Server Table Index To big

I have a table that has approximately 450k records here is the structure of it CREATE TABLE [dbo].[Reviews]( [ReviewID] [int] IDENTITY(1,1) NOT NULL, [AuthorName] [nvarchar](50) NULL, [AuthorURL] ...
0
votes
1answer
43 views

DELETE from Linked Server table using OPENQUERY and dynamic criteria

I'm attempting to run a DELETE statement from my local MSSQL Server to delete appropriate records from a table in my remote linked server using OPENQUERY(). I'm using the following code, but it seems ...
3
votes
1answer
31 views

Change linked server login per-query

Given the situation below, can I specify that the pre-configured linked server login should not be used for a particular remote stored procedure call? I have two SQL Server instances: [LOCAL] ...
2
votes
1answer
55 views

CAST SUBSTRING to NUMERIC SSIS

I have a fixed width text file that I am bringing in through SSIS. As part of the input into SQL Server I am grabbing a string of characters and trying to CAST them as numeric in a derived column. The ...
1
vote
1answer
158 views

Remove string after second specific character occures from left

I have this type of values in table column 154646@8@486 45465@6464@654 etc. How can i remove everything after second @ character ? I need to display 154646@8 45465@6464 I can do it only for all ...
3
votes
1answer
68 views

Deadlock due to concurrent updates (with SIU lock)

We have 2 different wcf services which get invoked by a windows service. The methods in those wcf services are updating the same table inside different stored procedures. One thing is for sure: ...
0
votes
1answer
33 views

MS Migration Assistant (SSMA) index renamed

I am using Microsoft SQL Server Migration Assistant v6 (aka SSMA) to update a database from Access to SQL Server. I am getting informational messages that say "A2SS0029: Index name 'Name' was changed ...
4
votes
1answer
50 views

SQL Server Service Broker Compatability across versions?

I'm planning a project to upgrade internally-developed app from SQL Server 2005 to SQL Server 2012. I hope to use Service Broker as a bridge while in transition. Are there any issues to consider in a ...
0
votes
0answers
22 views

I want to uninstall every program that says “Microsoft SQL” in front of it [duplicate]

I just uninstalled SQL Server 2012 but there is a registryload of Microsoft SQL... entries in the Programs and Features. I want them all gone. I've had issues previously uninstalling them in the ...
2
votes
0answers
54 views

SQL Server changes in tables reverted after two three days in two different DBs

I'm having a strange issue in one SQL Server 2008 R2 I admin. Three days ago, a major renaming on the columns of a table was made due to a development. After the columns where renamed, the change was ...
4
votes
4answers
141 views

Disk Space usage

Is there a way i can get a report or create a custom report in sql server 2012 which can update me with disk space available & actual disk space for listed drives twice or once a day. I need this ...
4
votes
1answer
158 views

How to optimize: having COUNT(*)>1

Without considering the indexes, Is there a way to re-write this query and get the same result quicker? select fo.OrderNo, fo.OrderItemSeqNo, COUNT(*) from Facts.FactBackOrder fo group by fo.OrderNo, ...
1
vote
1answer
23 views

Verify failed SQL Server connections to instances on a given server and email them

I am trying to monitor the SQL Server instances on standalone server / cluster server. I would like to setup something from commandline to check for connectivity to each SQL Server instance on the ...
8
votes
1answer
228 views

Would it be better for query plans to be split by statement for re-usability?

From my limited knowledge of how query plans are compiled, stored and retrieved by queries I understand that a multi statement query or stored procedure will generate it's query plan which will be ...
2
votes
3answers
146 views

Save multiple SQL jobs in single files

I'm using SQL Server 2005 and I need to save every SQL agent job in single 'create in' *.sql files. The problem is that I got about 20 SQL Server with 15 (up to 51) SQL jobs. How can I export these ...
-1
votes
0answers
26 views

SQL table up to date from TM1 cube

Can anyone recommand a good approach to keep an SQL table updated with the data from IBM COGNOS TM1 cube ? is there any way to create a process that runs daily and extract data from TM1 in xls or csv ...
2
votes
1answer
53 views

Subquery returned more than 1 value. This is not permitted + Trigger Error SQL Server

This trigger will update Is_Confidential_or_VIP column to 1 or 0 based on the text inserted or updated into ConfidentialRegistrationFlag and VIPType columns : create trigger ...
0
votes
1answer
35 views

setting up multi-user, multi database server(sql)

here's the thing, i'm taking an advanced java class and we are going to be accessing a database to edit tables and such, we tried using freemysqlhosting.net but we all couldn't connect at the same ...
1
vote
0answers
39 views

Updating tables between different SQL Server databases

I have two SQL Server databases (A and B), and they are running on separate machines. In order to make A same as B, I used to backup B, copy the backup to A machine and restore it as A database. A ...
2
votes
1answer
49 views

Auditing/Logging Help

I'm working on a request to start logging some additional data for PCI compliance. I need to log who, when, and what changed on a set of tables. I set up SQL auditing which would work fine except ...
6
votes
1answer
92 views

Looking for a set-based solution for a rolling 30-day period

I have a stored procedure (MS SQL Server 2008 R2) that needs to see if 10 points/sales fall within a 30-day rolling window. So far, I have a solution that works, but it's not a "proper" solution as ...
0
votes
0answers
35 views

SQL server export wizard gets stuck

I'm using the SQL server export wizard to export data to text flat file or Access file. The wizard gets stuck at 92960/92945 rows of about 153000 thousands. Nothing happens. Only after hours it ...
4
votes
1answer
86 views

How do you get an average of job history times?

The following is a script I found online that has most of the elements of what I desire in the result set. The only thing missing is how I can get an average of the run times over a decided time ...
2
votes
3answers
78 views

Get last full backup and transaction log backup for each database

How to write script or a query that will display the last full backup and the last log backup for each database on each of the production servers using the system table "backupset" and related backup ...
1
vote
1answer
48 views

SQL Server : Changing Database Username

I have an odd situation and I hope someone can help me get out of this. The situation: I'm running an Azure SQL 2012 SP2 VM with Windows Server 2012. Since it's creation I promoted the server to be ...
0
votes
1answer
38 views

Distributor latency - slow sp_MSget_repl_commands performance

One of our publishers is subscribed to by three subscribers, each subscriber is hosted on its own physical server. Two of those subscribers are 2008R2 and the third 2012. The 2012 subscriber is ...
1
vote
0answers
33 views

Proxy Account SSIS and NETWORK SERVICE

I currently have an instance of SQL running as NETWORK SERVICE which for various reasons I can't change. I have a maintenance plan running under a proxy account which has access to a network share to ...
0
votes
1answer
56 views

Free universe tool monitoring all database [closed]

Is there any free tool to monitor most popular databases like Oracle, MySQL, MSSQL, PostgreSQL. I want to monitor the real time performance of all the above mentioned databases with a single tool like ...
0
votes
2answers
46 views

Error in setting a value in sql server trigger [closed]

I'm trying to make a trigger that checks which staff member have the least amount of assigned tasks, before adding the task, and assign it to that member. What I came up with was something like this: ...
1
vote
0answers
40 views

Setting up a new db-server with same name and ip. Backup/restore or detach/attach

I'm planning to set up a new Win 2012 server, with SQL server 2014 standard. This server is going to replace our current server, Win 2008R2, with SQL server 2008R2. The name and ip is going to be the ...
2
votes
1answer
71 views

Alter table Statement Failed -Msg 207, Level 16, State 1

I wrote a script to add a column in a table and on successful execution update its values. I know it’s just a simple script but what is wrong with the ‘IF NOT EXISTS’ statement why script between ...
2
votes
1answer
77 views

I can't create relationship in my database sql server

I have designed a database for my website. It has 3 tables: user, topic and comment. A user has many topics (or articles) A topic (or article) has many comments A user has many comments I ...
3
votes
1answer
53 views

MERGE a UNION query results down to one row per KEY value

This is a lengthy query, it polls one LIVE database for certain sales information, then a UNION runs the same exact query on the ARCHIVE database for the same information. The results show each ...
1
vote
0answers
70 views

Backup and FTP SQL Server databases

We plan to backup our SQL Server 2012 databases every night, FTP the backup files to our test servers and restore them. Then deploy the latest schemas to those databases. The reason for this is so we ...
3
votes
2answers
82 views

When does SQL Server determine to use a new index?

I have been performing some maintenance on a server that runs some software the company bought, so I can't really change how the queries have been written. I have used some tools to determine some of ...
1
vote
0answers
31 views

Find queries performing full scans

I have a monitoring system that is telling me that the Full Scans /sec on one of my servers is rather high. I am trying to determine which queries may be causing the issue. Is there a simple/easy ...
0
votes
1answer
36 views

How do you copy a TDE-encrypted SQL Server database using T-SQL programatically?

I need to copy a TDE-encrypted SQL Server database to a separate, non-encrypted, SQL Server instance using T-SQL, but only by reading the schema of the source database. This is because I'm going to ...
0
votes
1answer
26 views

Allow public use of functions without giving them database control

I came up with a set of functions that I would like to be accessed from a variety of places. SQL seemed like the best place for this due to accessibility, but I receive this error when trying to use ...