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
2 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
20 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
15 views

Find Longest Running Query [duplicate]

How I can find Longest Running Query and SPID on SQLSERVER 2008?
5
votes
2answers
192 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
24 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
27 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
19 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
16 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
25 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
27 views

How to check table [on hold]

How to check which tables a user have access to on a server?
2
votes
1answer
62 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
51 views

How to change default database to all logins?

I'm bit new to SQL 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 should ...
2
votes
3answers
259 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
31 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
54 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
38 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
39 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
16 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
48 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
29 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
21 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
32 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
138 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
38 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
31 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
31 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
31 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
34 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
31 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
54 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
35 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 ...
0
votes
1answer
30 views

Improving lots of Left Joins ( SQL Server 2008 - procedure )

This query is running with 8 minutes to complete. I'm trying to help the programmer with this task. I've created indexes and stats, update_stats and rebuild indexes but none of this is helping us. ...
1
vote
1answer
59 views

Get all rows in table A even if no rows in table B in CROSS JOIN

I Have This query SELECT * FROM ( ( SELECT SUM(Auditoria.Importe - ISNULL(Auditoria.Pago, 0)) AS Deuda FROM Auditoria INNER JOIN Articulos_Auditoria ON ...
2
votes
1answer
156 views

SQL Server Isnull Returning 1900-01-01 when field is null

I am using SQL Server 2012. The following piece of code is returning 1900-01-01 when the DOB field is null. I wanted (and expected) it to return an empty string ('') but it's not. How should I ...
1
vote
1answer
44 views

DataBase Back Up - with a Not Null Column [on hold]

Can I include a default value to be entered in the Not Null columns when I do database back ups ? If so How can I do that?
2
votes
1answer
57 views

Updating large table worked before, now taking hours

BACKGROUND: I am using a non-production SQL Server to manipulate a large data set and run a few basic calculations. The original data file I have, which is about 30M rows, is missing records (not ...
0
votes
1answer
46 views

SSRS make a conditional format on the column

In a SSRS matrix report I'm trying to make a conditional format on the 'Total' column By checking one of the columns for a specific value, For example: In case in one of the Groups (Toys, Clothing, ...
0
votes
0answers
14 views

Validating Excel Counts against Database Inserts

I have to design a SSIS package which uses Excel Source files and inserts the data into SQL Server Database. The problem is that I've created the packages top transfer data, but now I need to ...
0
votes
2answers
59 views

Can't restore database?

Im trying to restore, let's say, db1. But some of my colleagues are using db2. We're in the same sql server. Why can't I restore my db1.bak even if Im the only one who's using it...? I tried "Take ...
0
votes
0answers
8 views

Replication from Database A to Database B without taking new snapshot

I have Database A which is my publication database. Database B was a subscriber but something went wrong and we need to re-do the transactoinal replication. Database A is over 200GB and takes a ...
0
votes
0answers
19 views

How to convert multiple rows of records into column based table? [on hold]

I'm working on a dynamic tables, which stores data and fields as rows in one table. I have a table like this: ID 100 Name One Hundred ID 99 Name Eng. Ahmed I want to ...
2
votes
0answers
20 views

Update matching keywords from first table to second table in SQL

I have two tables where 1st table is Englishgermankwds_tbl and 2nd is Kwd_UploadRecored the data of the tables is as follows Table Englishgermankwds_tbl English_Keywords ...
0
votes
0answers
34 views

Bring back the replaced database?

Story: I tried to restore my backup database using a different name (The backup database name is "db1" and db1 is still existing in sql server. In restore, I renamed the "To Database" field into ...
0
votes
1answer
16 views

Maintaining multiple build versions of asp .net / SQL Server applications

We have new versions of .net applications deployed every week for testing given in form of new build files. Can any one suggest how I can maintain many versions of the builds without having to keep ...
0
votes
0answers
10 views

Cross Server Transaction takes longer when executed from stored procedure

I have a stored procedure on ServerB which executes an update statement joining with another table on ServerA. Something like.... USE [DatabaseA]; GO SET XACT_ABORT ON; --<-- Since cross ...
3
votes
2answers
62 views

SQL Server stored procedure validity checking [on hold]

How can I check the validity of a stored procedure programmatically? Meaning that if no errors are found it will execute. How can I detect things like invalid tables names in "from" or "join" clauses? ...
0
votes
0answers
19 views

can't connect to DB using MS SQL Server 2008 Upgrade Advisor

I'm trying to use MS SQL Server 2008 Upgrade Advisor Analysis Wizard, to connect to a networked MS SQL 2000 database. According to the query select @@ServerName, the instance name contains a hyphen. ...
3
votes
2answers
53 views

How to properly increment an int identity in SQL Server if the Identity Increment isn't set?

When I use SQL Server with an int based identity column, I always use the auto increment. But I'm needing to insert into an existing table that doesn't have the property set, and I'm wondering what ...