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
2answers
36 views

SSIS compatibility

I'm trying to use SSIS for preparing data warehouse and for making business objects for report generator. The problem is that i have to support multiple sql server versions - sql server 2008r2 and ...
1
vote
1answer
30 views

Should I add a clustered Index on a foreign key that is not unique?

I have access to a table that has a primary key unique clustered index on an nvarchar(36). I need to create another table that hangs our own data off that unique clustered index in another table and ...
1
vote
0answers
24 views

Translation of SQL query to compatibility 80

I want to use the following query: SELECT SUBSTRING(qt.TEXT, ( qs.statement_start_offset / 2 ) + 1, ( ( CASE qs.statement_end_offset WHEN -1 THEN DATALENGTH(qt.TEXT) ...
1
vote
2answers
28 views

Suggestion for enforcing unique constraint in a table where soft delete is implemented [duplicate]

I am using SQL Server 2014 and in my database, I have a Position table which is structured like this: ID int PK Name nvarchar(50) Unique Index IsDeleted bit A ...
2
votes
2answers
289 views

Maintaining SQL Server 2008 R2 on Windows 10

I have to run SQL Server 2008 R2 on Windows 10 but it is not supported and so I am not getting any updates. Installing a later version of SQL Server is not an option. I can find all the service packs ...
1
vote
1answer
23 views

performance tuning queries - practice [closed]

I would like to find some materials and real life practice about performance tuning queries. Can anyone recommend some resources to read and study?
8
votes
2answers
157 views

Windowing offset based on time stamp

I'm writing a query that will be used to page results for a social feed. The concept is the mobile app will request N items, and provide a starting datetime which I have called @CutoffTime below. ...
5
votes
1answer
52 views

How can I minimize impact of expensive queries in Database A on Databases B, C, D

How can I configure SQL Server so that activity in 'Database A" has minimal impact on users in 'Database B' The Context Our (very large) production SQL Servers have a lot of databases on them ...
1
vote
3answers
37 views

Show data and disk use breakdown by table

I have a SQL Server 2008 R2 database being used by several deployed programs. Question: Is there an easy way to display how much space each table consumes, for all of the tables in the database, and ...
3
votes
0answers
44 views

SQL Server 2014 - Full text index never stops populating

I have a server that is running SQL Server 2014. I have full text indexes on some of my tables in my databases. The problem is that it's always saying populating and it never finishes. So my queries ...
3
votes
2answers
51 views

Computed Column Update when Table Value changes

I have environmental sensors collecting some raw data from environmental stations. In addition to the sensors, there is a physical gauge measuring water height (staff gauge). I'm trying to set up the ...
-3
votes
0answers
20 views

duplicates of part.num to be summed and add another column called user [closed]

There are 3 columns part num, Qty and MO. Each MO has part numbers.So there might be same part numbers in MO's. Each part num has qty. So, if I group by part num, I get Qty. 1.There are duplicates of ...
2
votes
1answer
43 views

Associate SQL Server Queries with Databases

Is there a way via T-SQL and DMVs to show which database a query was run against? The goal is to look at CPU and I/O by query by database so I can redistribute the databases as I reconfigure the ...
3
votes
0answers
47 views

Page Life Expectancy Wildly Fluctuating

For months now, the PLE on one of our servers has hovered around the 2 million seconds. If varied slightly from day to day but was pretty stable there. This last weekend, we added 12 GB of virtual ...
2
votes
1answer
36 views

Case When over 2 columns return results into 1 output column

I have an issue in SQL Server (using 2014 but not sure that's relevant). I have 2 variables Q20 and Q46 which depending on result I want to output a value to the same column for each result. For ...
3
votes
0answers
44 views

Different Disk Drive Same Backend Storage

I have a database running on a VM which is getting hammered during a large load, in particular I can see waits of WRITELOG happening. My initial thought is to split the files out on to their own ...
1
vote
2answers
227 views

Adding a 'last time occurred' flag column

I need to add a column into a table that contains 3 columns: GroupKey - Shows the number of an item. Status - the number of the status that the group was according the insert date. The status ...
-2
votes
0answers
18 views

SQL Server 2000 Error [duplicate]

I have installed Windows 10 x86 family and I want to install SQL Server 2000 on the machine its setup stop od MDAC and system restart. Please suggest I have a database which needs SQL Server 2000, ...
4
votes
1answer
617 views

SQL Server 2000 on Windows 10

I need to install SQL Server MSDE 2000 SP4 on Windows 10. I have other machines that run Windows 7 and 8.1 and SQL Server MSDE 2000 works fine (with merge replication configured too). Now I testing ...
1
vote
0answers
18 views

Looking for a DR-like solution to enable full data warehouse re-load while having secondary copy live

I am looking for suggestions/ideas to the following problem. We have a number of data warehouses for each of our clients (on SQL Server 2014). These data warehouses are maintained fairly fresh with ...
4
votes
1answer
31 views

Update queries slower after enabling SQL Server Full-Text Index

I have an asp.net website with many insert, update, and delete queries running against my database. A few days ago I create a Full-Text Index on two columns of one of tables. After that I realized ...
2
votes
0answers
42 views

SQL Server restore differential after restoring full backup

Here is the situation: I had a full backup, and a differential backup. I have restored the full backup into the database. But accidentally lost that backup file. Now I would like to apply the ...
2
votes
1answer
62 views

How can I compare the number of transactions in the first weeks or months of different stores

I need to make a comparison of the number of transactions per week and month of different stores since its opening date. The problem is that the stores has a different opening date. So, The idea is ...
-1
votes
2answers
47 views

Where clause in the query [closed]

I can group by Qty but not woitempart. I \tTried to use a where clause but in vain due to this exception: Exception: ERROR #50805215 Query failed to execute. GDS Exception. 335544569. Dynamic SQL ...
-1
votes
0answers
73 views

which is the cost of evaluation of the request? [closed]

I have a question I do not understand you could explain to me ? Consider a table R (K,A,B) where the attribute K is a key the (whole) values of which are uniformly distributed meanwhile [1...4000]. ...
3
votes
2answers
71 views

Query to calculate database growth

I have the following query that outputs some good information from MDW data collectors regarding database space usage. I am wondering with the following columns (db size, reserved space, unused space, ...
0
votes
1answer
35 views

DTS Type Mismatch at Join

I am new to ETL and VB in general and need some help resolving this issue. I have looked online and found some interesting answers but none seem to be working for me. varamt = Lookup ( ...
1
vote
1answer
23 views

SQL Trace for compatibility check?

My idea is to trace a few days all statements (scripted the replay template) on a SQL Server 2008 r2 and replay those against a deployed version of the db on a newer version (SQL Server 2014). Is a ...
3
votes
0answers
158 views

Install SQLServer 2000 on Windows 10 [duplicate]

I need to install SQL Server MSDE 2000 SP4 on Windows 10. I have other machines that run Windows 7 and 8.1 and SQL Server MSDE 2000 works fine (with merge replication configured too). Now I testing ...
0
votes
0answers
25 views

Ways for a Windows Administrator to get sysadmin [duplicate]

Based on a question why Builtin\Administrators don't get sysadmin by default, I want to ask which ways are known to get sysadmin rights as a normal windows Administrator without any given rights ...
3
votes
3answers
214 views

“Specify SQL Server administrators” - unusual default value

When installing SQL Server, you get to specify SQL Server administrators, i.e., the list of users initially in the sysadmin role. By default, this list contains the current user. (Image quoted from ...
2
votes
2answers
34 views

avg_page_space_used_in_percent and fill factor

Trying to find an answer to this one but struggling. sys.dm_db_index_physical_stats contains column avg_page_space_used_in_percent. How does this fit in with the fill factor of an index? For ...
4
votes
1answer
33 views

Should Service Broker use SQL or Windows Authentication?

I was curious what the best practice would be, for properly setting up Service Broker in SQL Server 2008. Should I use a SQL authenticated user, or should I use a Windows NT Authenticated user based ...
1
vote
0answers
58 views

Step by step establish a connection between SQL Server 2014 and Oracle 12c

I have two servers (both servers are on Windows OS): Server_A running Oracle 12c Server_B running SQL Server 2014 I want these servers to be able to see each other, so I can SELECT anything I want ...
2
votes
1answer
47 views

remove maintenance plan

I have the following error while trying to delete some old Miantenance plans on the MS-SQL server: Please help.
1
vote
1answer
21 views

Must declare the scalar variable “@VarName” [duplicate]

Could anyone shed some light on this error for me? To a beginner of course. This will probably be no more than a simple fix for someone else. I'm trying to read in the Product to be used in the where ...
2
votes
0answers
23 views

Mirroring won't fail back

Got an interesting mirroring issue. I am using SQL Server 2008 R2. Server A mirrors 8 databases to Server B ideally. Right now the 8 databases are principal on Server B (otherwise healthy). When I ...
4
votes
2answers
344 views

Which command Deletes and Frees Space

I'm reading through the 98-364 exam book and there's a question I can't quite answer: "What command would you use to remove all records from the Contact table that do not have a country of USA ...
-1
votes
1answer
32 views

How to reduce the size of ldf file? [duplicate]

We take full backups of the DB every day (in full recovery mode) and keep them for 10 days. Because of our requirements, we don't want to take incremental or differential backups of the DBs. Now we ...
4
votes
1answer
129 views

Count the nodes in a binary tree structure

I need to count the left and right nodes in a binary tree structure (output grouped by joiningDate), given a particular starting node parent id (pid). The tree is stored in the table shown below: ...
1
vote
0answers
28 views

Design of hard drive RAIDs

My task is to reconfigure a main server that houses the company's applications and data. The server is capable of handling everything. I wanted to find out if anyone has a suggestion on the best ...
2
votes
1answer
52 views

Converting old SQL Server outer join syntax

I'm a Power Builder (PB) developer. I've migrated PB from 10 .5 to 12.5, and now I need to migrate the stored procedures from SQL Server 2005 to 2012 as well. I get a invalid expression error when I ...
1
vote
0answers
20 views

Update remote MySQL database upon changes in local SQL Server database

I have a Web store running with MySQL on the remote host. And I have inventory management software using Microsoft SQL Server on my local system. I want to update product stock in the web store when ...
0
votes
1answer
60 views

Problem when connecting to SQL Server

I'm trying to connect to my SQL Server Express and I get this error. This happens both locally and on client. Connection Timeout Expired. The timeout period elapsed during the post-login phase. ...
0
votes
1answer
53 views

SQL Server 2012 Exclude a value

I'm teaching myself SQL, and I ran into a scenario that I cannot seem to solve. Please any help. I have a table called tblRecord with a column called BuyerID, in this case there are two BuyerIDS, and ...
13
votes
9answers
748 views

Alternative to WHERE clause [closed]

Is there a way to only SELECT rows with certain data in a column, without using WHERE? e.g. If I had this: SELECT * FROM Users WHERE town = 'Townsville' is there a way to implement the WHERE ...
1
vote
0answers
39 views

Change Root Directory on server properties page in SQL Server 2014 SSMS

We did in inplace upgrade from SQL 2012 to SQL 2014 (I know it wasn't the best choice, and it won't happen again, so no need to beat that horse). I have both the MSSQL11.MSSQLSERVER and ...
-1
votes
1answer
61 views

How can I generate a script to choose only top 10 items from each table in SQL database?

I know how to generate scripts that would contain insert queries of all records in all tables. But how can I limit this to top 10 records only from each table?I can select "Data Only" when generating ...
-2
votes
0answers
44 views

SQL Server 2014 - Query output

To be clear: I want to use the result of first query in the second query. Below are the two queries: Query 1 select files.originalfilename from files inner join digitalfiles on files.fileid ...
0
votes
1answer
26 views

Create a SQL Server Redirect (Alias / Linked Server)

I currently have a database on a named SQL server instance called \Mobius and database name of Mobius We need to move the database to the default (parent) instance but don't necessarily want to ...