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)

1
vote
1answer
25 views

Instant File Initialization on Backup drive

I know IFI (Instant File Initialization) is good to have enabled on SQL Servers. How about backup archive locations? We backup our DBs to a local SSD drive (so it backs up quickly), then throughout ...
0
votes
1answer
8 views

Restored DB Server Using FQDN Causing Distribution Issues

We had a complete RAID failure on one of our SQL Server 2008R2 SP1 servers. I setup a new server and restored everything and we're basically up and running again. But, I have one small issue. I am ...
0
votes
0answers
27 views

Unable to copy/move DBs in SQL Server 2012 with Wizard

I'm trying to move a SQL2012 Standard instance to a new server, by copying the DBs using the copy DB wizard. Every time I attempt to run a copy, it fails with (edited): The server principal "" is ...
0
votes
1answer
48 views

SQL Server counting rows

I have an imported database and I'm running a query. I want to count the rows found and output it. Here is my query: select mualbum.album, mutitle.title, mutitle.comp from MUALBUM inner ...
0
votes
2answers
32 views

Looking to find a way to determine replicated objects from subscriber

I am trying to create a process to script out items that have been added to subscriber databases in transactional or snapshot replication - sometimes we find users have added a view or proc to a ...
6
votes
1answer
181 views

Convert clustered primary key to non-clustered and use another column for the clustered index

I have a large table with a primary key (GUID) that is also the clustered index. There is already a integer sequence based field. So I want to leave the GUID as the PK and make the integer column the ...
1
vote
0answers
66 views

DBCC SHRINKFILE EMPTYFILE not emptying

Trying to remove an extra database file from a database using EMPTYFILE on SQL Server 2008 R2. use [MYDATABASE] DBCC SHRINKFILE (MY_DATABASE_7, EMPTYFILE); use master ALTER ...
0
votes
0answers
116 views

Azure SQL slow to delete 30K records

I have SQL Database (Business Standard, with 10GB plan). from last 10 days we are facing "Timeout" while deleting the records in bulk. We have been delete 50-60K record with easy till end of Jan 2015. ...
1
vote
1answer
32 views

Select all most recent records

I have this two tables (and their main fields): Target: Message: Id IdMessage Id IdMain IdReply DatePosted ================ ...
2
votes
1answer
63 views

Selecting the most specific row match based on multiple potential column values

I have a bit of a convoluted situation and I'm hoping someone here might be able to offer some insight. I have a series of tables that list certain criteria that are configurable by our clients. ...
0
votes
0answers
35 views

Many to many update query

SQL Server 2012 Notification Source can have multiple deliveries type and each delivery type can have one notification templates (For future, Each delivery type can multiple templates). ...
0
votes
2answers
89 views

One MySQL Database or Many MSSql Databases

At the moment I have an in-house Access database, data stored by our online survey provider, and data stored by our project management provider, both in databases. What I want is an in-house database ...
0
votes
2answers
35 views

Problems with Insert( simple query - can't think something )

I have 2 tables Tblservicedesk and Tblservicedesk_temp Collumns: CodServiceDesk ID_Solicitacao Solicitante Departamento Tecnico Grupo Status Prioridade ...
1
vote
1answer
43 views

SQL Server 2012 extended event session to expose the network protocol

I am using SQL Server 2012 (11.0.5058.0) extended events, and wish to know the network protocol used by each connection (TCP/IP, shared memory etc). Event session created for the login event via: - ...
0
votes
1answer
33 views

SQL Server Log Shipping: Copy copies 0 files

(This is SQL 2014, but applies to several recent versions) I had the SQL Server log shipping wizard create the script for the primary and secondary. Since the primary already backs up logs every few ...
0
votes
1answer
33 views

Deployment script always re-create constraints and indexes

When generating deployment script from SSDT. It always generate a codes that drop the foreign key constraints, indexes then create again those constraints and indexes. How to remove the codes that ...
0
votes
1answer
24 views

Data warehouse: Can I tell any details from Source System on delays or blocks? [closed]

I have a MS SQL Server 2012 machine that is acting as our data warehouse currently. We are having issues with long running jobs, and am curious if there is a way to get detailed historical logging on ...
2
votes
1answer
33 views

How to execute maintenance job from script and get back the result

I am trying to find a way to execute a maintenance job from script and have it return if the the job was successful or not. I know that I can use msdb.dbo.sp_start_job to execute the maintenance job, ...
-1
votes
1answer
55 views

shrink transaction log

Can I shrink transaction log when database in online using below command ? DBCC SHRINKFILE(transactionloglogicalfilename, TRUNCATEONLY) FYI my database is in production server & highly critical ...
1
vote
4answers
122 views

NVARCHAR column as PRIMARY KEY or as UNIQUE column

I'm developing a SQL Server 2012 database and I have a doubt about nvarchar columns as primary keys. I have this table: CREATE TABLE [dbo].[CODES] ( [ID_CODE] [bigint] IDENTITY(1,1) NOT NULL, ...
0
votes
0answers
17 views

Setting up Pull Subscriptions in SQL Server 2014 Web Edition

When I setup a pull subscription for a SQL Server 2014 Web Edition subscriber to a 2008r2 Standard Edition publisher, I'm not getting any local agents to handle the synchronization. I expand the SQL ...
0
votes
3answers
94 views

A more efficient way to write multiple CASE statements [closed]

SELECT CASE WHEN ( Table.COLUMN1) IS NOT NULL THEN 1 ELSE 0 END, CASE WHEN ( CASE WHEN ( Table.COLUMN1) IS NOT NULL AND ( Table.COLUMN2) IS NOT NULL THEN CASE WHEN ( Table.COLUMN1) - ( ...
1
vote
3answers
62 views

Best practice - Update Primary Keys

What's you opinion about Update a primary Key in SQL? I have a "link" table with 3 key from 3 other tables. Should the administration let people to edit one of the keys? I usely said no, dont change ...
0
votes
1answer
51 views

Best practice for archiving old data? [closed]

We are migrating 3 slightly different SQL databases into one (SQL Server 2008R2). We want to keep old databases "alive" for some period of time but once we've gone live we don’t want staff ...
5
votes
3answers
207 views

REORGANIZE seems to work as well as REBUILD all the time

On this MSDN Page it says if you should reorganize or rebuild based on the amount of fragmentation: 5% to 30% -> ALTER INDEX REORGANIZE Over 30% -> ALTER INDEX REBUILD WITH (ONLINE = ...
0
votes
2answers
93 views

Is it possible to set stand-by database to active, do changes and then continue restore chain?

Basically, I'm using a custom log shipping method on a sql 2012, where the transaction files are manually copied to an offsite location. The files are then restored using something similar: RESTORE ...
1
vote
1answer
55 views

Shrink log file after configuring backups properly

I had a database that was working in FULL recovery mode but never had transaction log backups done. The consequence of that was the fact that the log file kept growing and now its 10 GB in size. I ...
2
votes
0answers
36 views

Change Tracking across several Tables

I'm looking into providing DB level change tracking within my system. I need to be able to track changes at an entity level, rather than just individual tables. Right now, we have triggers on each of ...
7
votes
1answer
53 views

very poor cardinality estimate on a geometry intersection

I'm intersecting a point with a set of polygons. The query is indexed, and the polygons do not overlap but the query plan seems to think that instead of 1 row, i'll return 18k rows, and this results ...
3
votes
1answer
88 views

SQL Server log shipping: How to give SQL Agent the needed rights to remote share?

This is an old topic, and somehow I have not been able to find a clear answer. Setup: Two stand alone SQL Servers. They have full network visibility to each other. They are NOT in a domain. There is ...
0
votes
1answer
29 views

Unable to update or insert values table with DateTime column defaulted to GETDATE

I have atlered table by adding Datetime column. This column is not null and also default value from GETDATE(). ALTER TABLE myTable ADD myDateColun DATETIME NOT NULL DEFAULT (GETDATE()) I'm trying ...
1
vote
0answers
54 views

How to use HTTP Connection Manager in Script Component? (Not Script Task)

I'm trying to perform the same scenario as in the following link; Create a SSIS Script Component as a Data Source that uses a pre-existing HTTP Connection Manager to retreive a page with GET and emit ...
1
vote
2answers
89 views

How to split url in sql server like this

Here is the url www.abc.com/a/b/c/d/e/f/g/h/i I want result like this www.abc.com/a/b/c/d/e/f/g/h/i www.abc.com/a/b/c/d/e/f/g/h www.abc.com/a/b/c/d/e/f/g www.abc.com/a/b/c/d/e/f ...
1
vote
2answers
44 views

SQL Server Cumulative Updates - not visible in Windows Update

I just installed all possible Windows updates on WS2008R2/SQL2012 instance. When I run SELECT @@VERSION I get Microsoft SQL Server 2012 - 11.0.5058.0 (X64) May 14 2014 18:34:29 Copyright ...
0
votes
0answers
40 views

SSIS Package fails to “Transform File and create output file”

I have an SSIS (2012) package which was written by one of the developers. I've been tasked to with fixing the error. Each time the package is run I receive the following three messages indicating the ...
1
vote
1answer
51 views

Backup a remote database, from my machine, to another server (SQL Server 2008)

I'm trying to backup a database, of a remote server, from my machine, to another server. SERVER1 >>> BACKUPSERVER \ / \ / \ / ...
3
votes
2answers
78 views

What perfmon counters should I use to get the fastest restore possible on an idle system?

I have a development VM running Windows 2012-R2 and Sql Server 2014. I have one disk from a SAN holding the OS and SQL. My backup file is stored locally on the disk. I want to restore database as ...
0
votes
3answers
47 views

Should I enable db_writer in public facing website

I've come across an issue when using Entity Framework and trying to delete an object. The SQL-Server DB that it's trying to delete from, and the Login it is using, has a role membership of public ...
0
votes
2answers
46 views

How to split a row in a result into mutliple rows

I have the following query: SELECT vs.MonthName AS Month, vs.Region, vs.Category, CAST (MIN (a.TotalAmount) AS money) AS ActualAmount, MIN (a.TotalCases) AS ...
0
votes
2answers
72 views

Connecting SQL Server 2008 R2 to SQL Server 2000

Initially, my desktop has been installed with SQL Server 2000 Standard Edition SQL Client. Recently, I installed SQL Server 2008 R2 client and server instance. I'm using SQL Server 2008 Management ...
1
vote
1answer
114 views

SQL Server stored procedure causing 100% CPU usage

I'm using SQL Server 2008 R2 We have a single stored procedure that causes 100% CPU usage when ran. The said SP is ran once a month and performs heavy calculation for approximately 5 minutes. Since ...
0
votes
1answer
52 views

SQL Server 2014 and SQL Server 2014 Management Studio

I successfully installed SQL Server 2014, but when I look for SQL Server Management Studio it was not on the CD. I have just downloaded SQL Server 2014 Management Studio separately and would like to ...
1
vote
1answer
27 views

Filtering data in a publication

I'm looking to replicate a table that has a particular column for deciding if a row should be replicated. If the column is set to 'Y', then replicate. From my searching, Static Row filters are my ...
5
votes
2answers
136 views

Shrink or no Shrink dilemma

I have databases that I am tasked to move two databases DBName1 and DBName2 to SSD and I only have limited space on the SSD to fit these databases.I do not want to shrink log or data files for the ...
2
votes
3answers
350 views

Automatically restore SQL Server database from file from another server

We have a daily task to overwrite a number of development databases using backups of the associated production databases. The backups are produced by maintenance plans on the production server then ...
0
votes
1answer
58 views

Is there a reason my CTE with a basic subquery in the second stage of the CTE is failing?

Ok... anyone aid with this sorry...i've been playing with some of my works reports and i thought id found a way to mix two results into one when i came across a small issue... if i run my CTE code ...
2
votes
1answer
79 views

Indexing nvarchar(128) in SQL Server

Have no idea how indexing works in SQL Server. Working with a SQL Server 2012 Intel Xeon 2.2 GHz dual core 8 GB RAM. Will indexing a nvarchar(128) in addition to int primary key cause any ...
1
vote
0answers
15 views

Does an “update-update” conflict get created from the same node in P2P replication?

I have been told that an update-update conflict is being created in a production environment, which is set up using p2p replication, because of concurrent update by stored procedures. The msdn ...
2
votes
1answer
48 views

T-SQL query to find backup folder for specific maintenance plan

I want to check check if backup plans are set up correctly and need to query different servers, mostly SQL Server 2008, but also 2012. Is there any way to query the maintenance plans for databases, ...
1
vote
1answer
67 views

Modifying a non managed table partition

I ran across a partition that was initially setup (sql 2012) beginning of 2014 to break by month but wasn't updated for 2015. The main issue is that the last partition was setup as Jan 2015 so Feb ...