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)

25
votes
6answers
700 views
+500

Retrieving n rows per group

I often need to select a number of rows from each group in a result set. For example, I might want to list the 'n' highest or lowest recent order values per customer. In more complex cases, the ...
2
votes
2answers
32 views

Keeping iterator in consistent state

I was reading this post to understand how things are done in Sql Server: http://rusanu.com/2013/08/01/understanding-how-sql-server-executes-a-query/ If I understand it correctly, data is being sent ...
6
votes
3answers
3k views

Temporarily Disable Sql Replication

Due to a business need, I may need to disable transactional replication in my environment (Sql 2k -> Sql 2008). Functionally, I understand this to mean that I will need to drop subscriptions and ...
0
votes
1answer
255 views

SQL Server starts normally from Windows Services screen, but shows error through SQL Server Configuration Manager. Why?

I have a SQL Server 2005 instance that has worked fine for years. There have been no changes that I am aware of. Recently, I found that if I stop and then start the instance in SQL Server ...
-5
votes
1answer
44 views

how to Write a SQL Statement to display EmployeeID from Table1 and EmployeeName from Table2 a [on hold]

how to Write a SQL Statement to display Claim Number, EmployeeID from Table1 and EmployeeName from Table2 above. Write a SQL Statement to display all the Information from Table1 and Table2 for ...
7
votes
0answers
60 views
+100

Enabling TDE without breaking existing mirror

I've been trying to enable TDE in a mirrored SQL Server 2008 R2 configuration. Enabling TDE is not so difficult, though when I enable TDE on the principal, the mirror database goes in to a suspended ...
3
votes
0answers
26 views

Aggregation Operations on View Ignores Index

The Scenario Once upon a time there was a Staging database at a small company that was participating in an ETL process, acting as a receiving catalog for the various formats of files from a number of ...
10
votes
5answers
937 views

Reasons for avoiding large ID values

We are working on a web application, not yet accessible to users. My boss noticed that newly created records get an ID of over 10 000, even though we only have under 100 records in the table. She ...
1
vote
1answer
33 views

How to Identify Who or What is Restarting SQL services via Service Control?

I investigated an instance that experienced an unexpected restart and came across the usual service control event but no user login associated with it. Is it still possible that an authorized user ...
0
votes
1answer
80 views

Namespacing database names on my server in order to test multiple different SSIS packages

An SSIS package that I'm building has two OLE DB connections, to databases named "core" and "staging". I created test versions of these two databases on my local SQL Server installation. I named them ...
3
votes
4answers
219 views

Does it make sense to use full recovery if the data and log files are on the same HD?

We have a database that was set up to use full recovery and my guess is that the reasoning was only to prevent data loss if a failure happened between full backups. We make daily full backups of the ...
3
votes
3answers
126 views

Login lifespan for password on SQL Server

What is the "lifespan" for a login with the option Enforce Password Expiration Enabled? Where can I find configuration/option to change the time?
0
votes
0answers
14 views

Which is the best way for selecting dimension attributes while creating a dimension?

I'm a newbie to SSAS OLAP so please apologize me if it was a silly question but surely I need suggestions. I would like to make clear some concepts which was confusing for me. Let us consider five ...
-1
votes
2answers
42 views

Need help finding inactive users in my database

I am trying to figure out how to get this figured out. Problem: Users of inactive customers are receiving scheduled maintenance notifications Indicators: Organizations have a custom binary field ...
5
votes
2answers
126 views

T-SQL brain teaser: find non-overlapping sets

I would like to ask for help coming up with a query, which can identify groups on non-overlapping records. Here is a sample scenario (admittedly contrived). Let's say I have employees who are ...
1
vote
1answer
93 views

Print the execution time on messages Pane?

How I can print the execution time of each query on messages Pane? For example the Select * from tbl1 runs for 10 mins then Select * from tbl2 runs for 15mins and so on.. Select * from tbl1 Go Select ...
1
vote
2answers
68 views

Can a temporary table be shared across sessions?

I have revised a procedure that builds a dynamic SQL statement to create and populate a temporary table. The syntax was something like this: ...'create #temp_' + CAST(GETGUID() AS VARCHAR(36)) ... ...
0
votes
2answers
34 views

How can i know the relationship in the database in sql server 2008? [on hold]

I want to know how can I determine relationships between data which is not determined by the primary key in the design. For example, I have three tables in the database like this :- table 1: fields ...
0
votes
1answer
34 views

Run CDC Cleanup job at specified time

I have enabled cdc and using it , it works fine now the problem is that we have many tables in a database and also we have many databases so how to configure cdc cleanup job to run again and again ...
1
vote
1answer
47 views

Investigating specific SELECT queries

For a particular row in a table how can I determine the number of reads done to it such as SELECT * FROM MyTable WHERE ID = <something> and when and where the read query executed? I'm ...
-3
votes
0answers
48 views

Server CPU usage Issue [on hold]

I have a Database on MS SQL SERVER, The MDF file size os near about 30 G We have web application where this database is used. & while monitoring Live server, I Seen when number of User increase on ...
2
votes
2answers
10k views

The value could not be converted because of a potential loss of data [on hold]

Let me start out by clarifying that this is not a duplicate question, nor a potential duplicate for that matter. I have tried implementing every answer to every single variant that already exists of ...
2
votes
2answers
59 views

Execute Remote Powershell script from SQL Agent

A test SQL Server job hangs when it executes a Powershell script. It does work using my login and a Powershell window, but not using the Agent account and a job. The SQL Agent user has ...
-3
votes
1answer
38 views

Finding users with database owner role in sql server 2005 or so [duplicate]

I need a script which will list out all the users with DataBase Owner persmission for a specific database. Thanks
0
votes
0answers
27 views

CodePlex: SQL Server Partition Management Tool [on hold]

I have implemented partitioning on a table and now I want to use the CodePlex Partitioning Tool to create my staging/archive table, with the intentions of wrapping it all in a "Sliding Window" job. ...
1
vote
1answer
52 views

Understanding “Date Last Modified” for “System Stored Procedures”

Whilst reviewing code on a SQL 2008R2 Instance I inspected the Date Last Modified of the System Stored Procedures of the databases. The ones in the DBO schema had a datetime that predates the ...
15
votes
2answers
20k views

How to find the SQL statements that caused tempdb growth?

The tempdb of a server (SQL Server 2008) increases to 500GB+ several times every month. Is it possible to find out which SQL statements caused this problem? The problem is usually not caused by create ...
1
vote
1answer
68 views

Removing some English token words (such as “are” or “or” etc.) from the system stoplist of full text search?

One of our table has full text catalog on it. It contains some data in a language other than English which makes some words such as "are", "or" useful. There is no stop list defined but these words ...
3
votes
1answer
79 views

Effects of turning the transaction safety OFF

I am considering to turn off the transaction safety to maximize the performance. Before that i am interested in finding the current status of transaction safety. Is there any command that we can get ...
3
votes
3answers
270 views

use an Index correctly to optimize queries

I have an SQL database with millions of records and when I'm querying the data like select * from ActCosts where ScenarioID= 456 The tables has 1,323,718 rows and it gives me like 50,000+ rows ...
2
votes
2answers
348 views

How to get SQLCMD to output errors and warnings only?

How can you get SQLCMD, when executing a SQL script file, to just output any errors or warnings it encounters? I essentially dont want information based messages to be output.
1
vote
0answers
24 views

Transactional Replication - Replication Order of Related Tables

** This was previously asked on Stackoverflow - I removed it from there and recreated here ** I have an issue with SQL Server Transactional Replication. My topology is as follows (and this cannot be ...
3
votes
2answers
2k views

sql server full text search - fuzzy searching?

Is there a way to configure fuzzy searches in sql server full text search. Meaning if I search for a term called POWDER, I must get matches (i.e. strings) which contain any variations of it within an ...
-5
votes
0answers
45 views

Incorrect syntax near the keyword 'AS' [on hold]

string strQry = @"declare @state varchar(max) declare @query varchar(max) set @state=(Select State from CandidateInfo where Id=1501000040) set ...
2
votes
2answers
124 views

Run a PowerShell script on a different server - from inside a SQL Server job

I have a procedure to backup SSAS Databases. That is working as a charm. Now my server is filling up with SSAS backups and I would like to delete the backup files that are older than 2 days. to ...
0
votes
2answers
62 views

Connection problems with ManagePartition executable

I'm currently running SQL Server 2014 and we have some tables that have been partitioned and I'm trying to use the ManagePartition application here (http://sqlpartitionmgmt.codeplex.com/) I've typed ...
0
votes
0answers
179 views

SQL Server: mirroring several tables in different databases

I want to keep several tables in two different databases mirrored. Both databases are within the same server, and both are SQL Server dbs. This mirroring only affects the data they contain, not the ...
4
votes
5answers
3k views

Is it advantageous to scale out using multiple SQL Server instances on the same server?

For a use-case of 9 databases spread across 3 time zones, is it advantagous to spread the databases onto multiple SQL Server instances on the same server? What will I gain and what will I lose? ...
3
votes
1answer
429 views

How do I get more details on a full text catalog error?

I have an error that is repeatedly generated on a SQL Server 2005 instance running the databases for MS Team Foundation Server. 'Severity 16' occurred on INSTANCENAME Looking in the SQL Server ...
0
votes
1answer
260 views

Agent Xps getting disabled automatically

In one of SQL 2012 server, agent Xps is getting disabled automatically. There is no set pattern for the same and the issue started all of a sudden. Through profiler it was found that application named ...
2
votes
1answer
91 views

SQL Alert: 020 - SSPI handshake failure. Tracking the cause?

I have done my best to find an article that answers this question but I have not had much luck. I manage the database across three domains. One domain has the ability to access the other two, but ...
-1
votes
0answers
25 views

SQL Mirroring Down between Principal / Mirror

Configured MS-SQL Mirroring between two servers Principal and Mirror. Some times the connection goes down and start synchrozie automatically. Need to know which end either Principal or Mirror which ...
2
votes
0answers
44 views

Moving data from MS Access to MS SQL Server

I'm trying to migrate data into SQL Server from an existing legacy set of MS Access databases. Currently everything is working except a few core tables that are wide and contain a number of ...
0
votes
1answer
112 views

Best approach to have a Live copy of a table in the same database

I have a table where 15,000 to 20,000 rows are being inserted every hour. Table Schema is something like ColumnName DataType ID BIGINT IDENTITY(1,1) Column1 INT Column2 INT ...
0
votes
0answers
32 views

Data warehousing: data transfer process too slow with larger batches

I have two primary instances of SQL Server, one for OLTP and one for reporting. The data warehouse for reporting is basically a Type 2 SCD: every table has DWDateStart and DWDateEnd columns and the ...
0
votes
1answer
24 views

How to restart the distributor agent of transactional replication?

After troubleshooting query time out error I would like to restart my distributor agent. So I go to my distributor server, in my distributor DB (called distribution_SA) I run the following query: ...
2
votes
2answers
1k views

SQL Server 2005 Tools makes SQL Server 2008 Express install fail

When I tried installing SQL Server 2008 Express, the install failed due to this line. How can I circumvent this, or fix the issue?
3
votes
3answers
146 views

Replication with FileStream

I need to setup database replication (for high availability) on a database that uses FileStream. This is on SQL Server 2012 Standard Edition, so Always On or Peer-to-Peer replication is not an option. ...
2
votes
4answers
2k views

Cannot remove unused filegroups

I wanted to remove some unused filegroups/files in a SQL Server Database but am stuck because SQL Server thinks the filegroups/files are still in use. Some background: We had some partioned tables ...
-1
votes
1answer
33 views

How to manage two tables in SQL Server [on hold]

i have two tables offer1 and offer2 The two tables are Offer1 Offer2ID|OfferName|OfferExpiryDate Offer2 Offer2ID|OfferName|OfferExpiryDate now i have third table which keeps record ...