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

Best way to migrate a huge MSSQL DB with low downtime over network

Problem definition Our database server needs to be transferred to an other datacenter. It runs on Microsoft SQL Server Enterprise (64-bit) 2012 and contains two database of about 2TB and 1TB. Having ...
0
votes
1answer
22 views

Sql Server 2005 and Windows 8.1 - Getting error 1053 when trying to start sqlexpress service

we've been running sql server 2005 and windows 8.1. Today for the first time we can't get sqlexpress running in Services. It was running fine yesterday. Getting error 1053 - service did not respond ...
2
votes
1answer
24 views

Backup compression in SQL server 2008R2 and above

Recently we got a new server to take care of and found that there are two data drive: S: 1 TB where resides 10 databases(mdfs and ldf's, though they should be on different drives but that's how we ...
0
votes
0answers
13 views

How to setup a trigger for updated records

Prod database "Mother" Copy of database "Father" Here's my scenario I need help with: I have a database that has a table called User_Group table on our Production db "mother". The dev team wants me ...
2
votes
0answers
54 views

This Extended Events session works on Dev but not on Pro. Why?

I do have the following Extended Event session on my Dev and Pro boxes: CREATE EVENT SESSION [sp_showplan] ON SERVER ADD EVENT sqlserver.query_post_execution_showplan(SET collect_database_name=(1) ...
-3
votes
0answers
32 views

SQL Pivot by data [on hold]

I have this procedure : alter proc rel_manipula(@inicio datetime,@fim datetime) as select A.codigoins, b.nomeid ,sum(a.qtd), a.dtmov from com_InsusTrans A inner join com_insus B on b.codigoins = ...
1
vote
0answers
14 views

Severity 20 Error upon disconnecting Dedicated Administrator Connection

Starting working with Dedicated Administrator Connections on SQL Server 2008 R2 servers. All is working fine (once port 1434 was opened), but am getting severity 20 errors when I disconnect the admin ...
1
vote
1answer
31 views

SQL Server 2012 stored proc runs very slow sometimes

I have a stored proc with a single large query which takes an ID as a parameter and returns some counts. It has quite a few inner joins and left outer joins but they are all on indexes. The sp runs ...
0
votes
1answer
25 views

Sqllogship.exe: replace with powershell?

To get more control, and to enable another transport. Is there a direct replacement in powershell?
-2
votes
1answer
27 views

Sql server sqllogship.exe…full docs?

Are the internals and all the logic of sqllogship documented? Eg so i can manage it directly, without the wizard? Or replace it with my own tool? I find this syntax (which is real, from a live SQL ...
2
votes
1answer
35 views

MSSQL - Index Seek with very high Scan Count

I have a query that joins 2 tables: Documents table, that has DocID as Unique Clustered Index DocumentsRows table, that has DocID, RowID as Unique Clustered Index When I join those 2 tables, I ...
3
votes
2answers
405 views

Storing Japanese characters in a table

I am using SQL Server 2008 R2 and I want to store Japanese characters in one of the columns of my table. Say I want to store Japanese names, how can I achieve that? Is there an easy way?
2
votes
0answers
17 views

Normalization - removing transitive dependency [duplicate]

I am creating a rules engine which will be executed in code, but I have a problem defining a properly normalized database structure for it: There are templates from which rules can be derived Each ...
1
vote
1answer
11 views

Syncing Uncontained Objects with AlwaysOn Availability Groups

In setting up our HA environment (AlwaysOn AG), I came across the add-in ssms_2012_ag_addin_setup.exe that I got from SQLSkills. ...
0
votes
1answer
34 views

What are the implications of upgrading statistics SQL Server [on hold]

I Have a SQL Server 2005 DB, with 500Gb of Data. The Statics do not upgrade from 2010 and this past saturday were updated. Yesterday the querys on DB were very slow and caused bad response times. ...
3
votes
0answers
42 views

Timestamp-based index

I have a big database (200GB+) that contains some log info. And I want to speed up SELECT queries and stored procedures. I have a table with a GeneratedOnUtc datetime column, and have a non-clustered ...
1
vote
1answer
26 views

SQL Server: Understanding log ship utility: sqllogship.exe

This is my first time using the stock SQL log shipping setup. The copy operation is failing. I think I see the issue. I need to change the unc: '\\Win-2ooc0jplr5k\sql\logbackup\', Backup ...
0
votes
0answers
3 views

Report snapshot with links to other reports

I have a report that I have just set up to create a weekly snapshot. This report has links on it to other reports in reporting services. When SSRS creates the snapshot, how does it treat these ...
1
vote
0answers
28 views

Renaming databases vs backing up and restoring

I am creating a copy of Database A, restoring as database b, executing a job on database b. Upon successful execution, I would like to delete the database A and rename the database B to what the ...
-4
votes
1answer
20 views

Find Longest Running Query [duplicate]

How I can find Longest Running Query and SPID on SQLSERVER 2008?
5
votes
2answers
234 views

What does Page Life Expectancy say about the instance?

I have installed monitoring software on a few SQL Server instances in the environment. I am trying to find bottlenecks and fix some performance issues. I want to find out if some servers need more ...
0
votes
1answer
31 views

Grouping UNION ALL

No matter how I try to group the record set generated by this query it just wont do it. Query works ok the problem is trying to Group by A SELECT CountryCode + + ProductNumber + + StockType AS A, ...
0
votes
1answer
30 views

SQL Server Import/Export: cannot copy geo columns

I'm trying to copy data from a SQL Server 2014 Express database to a SQL Server 2008R2 Express database. Compatibility level for the 2008R2 Express database is set to 100. As soon as I hit Next in ...
0
votes
0answers
26 views

Multiple subqueries performance issue

I have a query that collects customer data. I select a lot of correlated data from different tables. I want to have only ONE result row for each customer. The query looks like that: SELECT c.Id ...
0
votes
0answers
17 views

Need help on transferring data from a PostgreSQL database to a future (to be decided) database!

(English isn't my native language) I'm doing an internship for school and my task is to theoretically describe the best way to transfer the data from their current database (PostgreSQL) that they have ...
0
votes
0answers
27 views

Alternative to paying upfront for SQL server without using hosting provider's SPLA with Microsoft? [on hold]

Is it possible to pay monthly for SQL server through a third party in the same way you can via your hosting providers SPLA? For background, we're using AWS but they charge up to 2x more than ...
-3
votes
1answer
30 views

How to check table [on hold]

How to check which tables a user have access to on a server?
2
votes
1answer
71 views

Same query sometimes uses a Table Spool

I'm checking out a query which exhibits strangely inconsistent performance. Using SolarWinds DPA, I can see that the query sometimes uses a Table Spool, sometimes it doesn't. When it actually used a ...
3
votes
2answers
59 views

How to change default database to all logins?

I'm bit new to SQL Server and I'm trying to script out Microsoft SQL Server (2005-2014) post installation activities and I got bit stuck on altering logins. Corporate policy states that none login ...
2
votes
3answers
268 views

Is inserting multiple queries takes same time as that of single query?

I have a requirement where I have to insert a lots of rows.For inserting we use like this insert into emp(name,age) values('abc',12); This will insert only one row.For inserting multiple rows we ...
0
votes
1answer
39 views

Update a set of SQL statements

dbo.MatchFirstName(@FirstName) and dbo.MatchLastName(@LastName) are table Value Functions(TVFs). Problem: In my Update statement i.e Update #Temp after Insert, I want only those rows to be ...
1
vote
1answer
60 views

Query on 250 million records

I have a table with below structure CREATE TABLE [dbo].[ColumnValues]( [Id] [int] IDENTITY(1,1) NOT NULL, [ColumnId] [int] NOT NULL, [Value] [nvarchar](max) NULL, [OutputArea] ...
0
votes
2answers
40 views

SQL Server tuning: Disk queue to OS drive: How to optimize?

I expect to see the disk queue move on the data, tempdb, log and backup volumes. I do not expect to see the OS drive (C:) which has zero SQL files present, show disk queue impact. Assume it is to ...
0
votes
1answer
41 views

Exclusive access to edit rows [on hold]

I'm developing a program that allows users to view and edit data. My question: Is there tools (sql server tools, may be users/roles) to implement the following: There are two users: A and B. User A ...
1
vote
1answer
19 views

Can I use SPARSE somehow on a non-nullable bit column with mostly false values?

I have a table that stores the results of queries that are run at least once a day. There's a bit column that represents whether the row is from the most recent run of a particular query with a ...
0
votes
1answer
49 views

Uexpected values inserted in table

I have a table called FunctionWeights which contains data as follows: My query is as follows: select @constVal = FunctionWeight from dbo.FunctionWeights where FunctionWeights.FunctionName = ...
-1
votes
1answer
30 views

Debugging Remote Connection Failure of SQL Server 2012 [on hold]

I am running SQL server 2012 web edition on Windows Server 2008 R2. I have followed all these steps http://blog.citrix24.com/configure-sql-express-to-accept-remote-connections/. But still unable to ...
2
votes
1answer
23 views

How to pass multi-valued characters in SSRS Report?

I have a SSRS report that has 3 data sets feeding off one data source. The main dataset is a stored procedure that is aggregating some data based on a set of parameters powered by the other two ...
0
votes
2answers
33 views

Initial Discovery process

I am looking to better my knowledge without actually being in the field, I was wondering what initial steps you take when you are assuming the responsibility of a server with SQL-Server installed on ...
5
votes
1answer
146 views

Why can a non-clustered index not be dropped using online=on option

When attempting to drop a non-clustered index using the online option such as DROP INDEX [IX_MYINDEX] ON [dbo].[myTable] WITH ( ONLINE = ON ), I receive the following error message. Msg 3745, Level ...
0
votes
2answers
39 views

Are some these indexes redundant?

Let's say I have a table of 4 columns: A, B, C, D. A primary key is on A, B, C. Index1: is A, D, B, C in that order Index2: A, B, C, D in that order and the primary key index: A, B, C There are ...
1
vote
1answer
33 views

How do I drop all constraints from all tables?

I want to drop all default constraints, check constraints, unique constraints, primary keys and foreign keys from all tables in a SQL Server database. I know how to get all the constraint names from ...
1
vote
1answer
32 views

Confused about sys.dm_io_virtual_file_stats num_of_reads/writes column

I'm trying to use the sys.dm_io_virtual_file_stats DMF to generate so IO wait information across a number of my servers. I came across this post by Paul Randall: ...
0
votes
1answer
32 views

Server 2012 Linked Server From An Instance

I have 3 SQL Server 2012 Instances, 2 on SiteA on the same server SiteAServer. I have 1 on SiteB on server SiteBServer. SiteADefaultInstance, SiteASecondInstance SiteBDefaultInstance ...
2
votes
1answer
35 views

Can I throttle individual databases instances on one SQL Server 2005 box

I am running a very old server that has a database that is being permanently retired within 14 months. My company will not invest anymore in hardware or software for this system as we are moving to a ...
-2
votes
0answers
32 views

Multiply operation/field causing the record set to 'ungroup'?

I'm trying to sort a query for a report but every time I add a Multiply operation to it the record set result becomes a mess and if I try to GROUP BY I get the legendary ...either an aggregate ...
2
votes
2answers
62 views

Database cannot be opened. It is in the middle of a restore?

I've set up log shipping using standby mode (The "Disconnect users in the database when restoring backups" is unchecked). I tested running the following code on secondary server/database. declare @a ...
0
votes
0answers
28 views

Sql server 2014: backup log to 2 destinations

We want a single job to back up log to azure and file system every time. So we can log ship from file system and from azure at the same time. I seem to recall that the redgate sql backup tool has a ...
1
vote
2answers
25 views

How to configure an instance to listen on port 1433 to allow remote connection

Trying to connect using SQL Server Management Studio 2012 on a Windows 8.1 Client computer from outside the cluster's domain. Cluster is a two node Virtual Cluster made from Windows Server 2012 R2. ...
0
votes
1answer
37 views

Long running query…only on replicated database

I have an issue I can't seem to solve and wondering if anything jumps out at you. I have a query that I got from one of our developers, it runs in about 5 seconds on our production database and also ...