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)

3
votes
2answers
533 views

Can I programmatically generate reports that are emailed as Excel docs from SSRS?

I've searched already and don't see (or can't decipher) a solution for my issue. I have SSRS emailing a report for 1 district (with 12 retail stores). However, each Region has over 8 Districts, and I ...
1
vote
0answers
53 views

Migration advice from SQL server 2000 bak

A small and old Windows 2003 server, just crashed; from the backup only the .bak files are available. A new server will be built, however, as the database is very small (20MB) and the Windows server ...
5
votes
3answers
4k views

Write differences between varchar and nvarchar

Currently in our SQL Server 2012 database, we're using varchar, and we'd like to change that nvarchar. I've generated a script to do that. My question is are there any differences in how SQL Server ...
2
votes
2answers
611 views

Check if row exists

I need to write a query that will insert a row only once, even if the query is run multiple times. Being new to SQL (well new-ish), I did an if not exists(...) but a friend said he preferred deleting ...
1
vote
1answer
615 views

Killing idle pooled connections

On SQL Server, I'm trying to prevent connection from staying open. From here I understand that Connection Lifetime allows a connection to stay alive for a certain period of time since it was opened. ...
0
votes
3answers
188 views

Select MaxDate where hh:mm:ss makes the difference

How to select the maximum date from a table where hh:mm:ss is selected? My query is the following, and returns the latest date, but if there are different times recorded, the date will be returned ...
6
votes
2answers
3k views

SQL Server alter table to change TEXT to NVARCHAR(MAX) greatly increasing database size

I need to update a SQL Server database thats about 18GB in size to change a significant number of TEXT columns to NVARCHAR(MAX). The problem I'm having is after executing all the alter table ...
3
votes
1answer
432 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 ...
1
vote
1answer
619 views

Optimizing an audit table for inserts and deletes

I'm trying to identify the best way to design a table for audit purposes. Basically I log several last events for many users in one table. There's a limit on the number of records for each user. The ...
3
votes
1answer
136 views

Creative workaround for granting edit rights to individual jobs for a group?

We have two developers that say they can not function without full rights to a few jobs on our database server. They both want rights to the same jobs. Given that it seems that MS doesn't seem to be ...
1
vote
1answer
6k views

How to fix “The OLE DB provider ”MSOLAP“ has not been registered”?

Here's the code I'm using to register a linked server to SSAS: USE [master]; GO EXEC master.dbo.sp_addlinkedserver @server = N'ServerAlias', @srvproduct = N'', @provider= N'MSOLAP', ...
4
votes
1answer
1k views

Join To a @Table Variable is running ineficiently

Alright so I have a report sproc that was running incredibly slow. Customers were complaining that the report would not run so I started investigating exactly where in the sproc the problem was and I ...
0
votes
2answers
2k views

Need a way to query a table, and JOIN it with the TOP 1 related record from an other table

As a follow up to this question, I'm wondering if there is a better and/or more efficient way to gather the data in question. As stated, this query does return me 95% of the data I need -- SELECT ...
0
votes
3answers
642 views

Fixing a query that returns failed job information

I' using a SQL Server 2008 Sp3 environment. I have a query that returns information about failed jobs from the last 10 minutes. If a job has two schedulers (for example - a job that runs every 10 ...
1
vote
1answer
214 views

Restoring a differential backup in SQL server 2005

I have created a full back up of my database by executing the line below in my application: Dim Query As String = "backup database Ari to disk='G:\Documents and Settings\i\Desktop\BKAR\" & ...
0
votes
1answer
265 views

Restoring a differential backup in SQL server 2005 [duplicate]

I have created a full back up of my database by executing the line below in my application: Dim Query As String = "backup database Ari to disk='G:\Documents and Settings\i\Desktop\BKAR\" & ...
0
votes
2answers
1k views

SQL Server 2008 R2 not starting after moving model database

SQL Server 2008 R2 not starting after moving model database. Any ideas? Error: 945, Severity: 14, State: 2. Any ideas? Sql 2008 R2 will not start with trace -f -T3608 or single user mode -m. Need ...
2
votes
2answers
1k views

Why do I need to use a sub query to filter down a grouped select?

If I do this -- SELECT dv.Name ,MAX(hb.[DateEntered]) as DE FROM [Devices] as dv INNER JOIN [Heartbeats] as hb ON hb.DeviceID = dv.ID WHERE DE < '2013-03-04' GROUP BY dv.Name ...
2
votes
1answer
5k views

Are “create user” and “grant connect” functionally equivalent?

I don't have a problem per se, but I've noticed that if I grant a database permission to a principal that doesn't exist in the database, the permission shows up in sys.database_permissions but that ...
1
vote
1answer
699 views

SQL Server Database Mail - Why can't I run an execute against xp_sysmail_activate?

SQL Server 2008 R2 Standard x64 I can't send e-mail from this SQL Server (out of MANY that are configured pretty much identically AFAIK). I have created the mail profile and account. However, any ...
4
votes
1answer
52 views

Can I query data_space names when not in context of the database for multiple databases?

I have a data set pulled from sys.master_files. The data set looks something like this: database_id filename physical_name data_space_id ----------- ---------------- ------------- ...
2
votes
2answers
183 views

Help with tricky update statement

I've tried writting this update statement every possible way I can think of but I either wind up producing invalid results or run into a syntax barrier. I have two table variables: DECLARE ...
-1
votes
1answer
626 views

FETCH API_CURSOR causing open transaction in tempDB

A select statement run from Oracle 11gR1 to SQL Server 2005 using Gateway leaves an open transaction in tempdb. The user is a datareader in Database XYZ. Not sure why the open tran is in tempDB when ...
2
votes
0answers
268 views

How to manage dynamic tables in Visual Studio 2010 Sql Server Database Projects

I am migrating a common set of databases in to a VS 2010 Sql Server Db project so we can keep it in source control, and deploy common changes etc. The databases are for the most part the same, except ...
2
votes
1answer
192 views

MDW performance_counter_instances table running out of identity values

My MDW database's performance_counter_instances table has run out of identity values. Has anyone ever encountered this? Is it safe to change the data type of the identity field ...
2
votes
1answer
171 views

Will a primary key be added as a clustered index?

I've inherited a database where no primary keys were defined on the tables. There are also no clustered indexes assigned to the tables. If I perform an alter table to assign a primary key will this ...
1
vote
1answer
419 views

SSMS Oracle import using OpenQuery over LinkedServer (Oracle Provider for OLEDB) - XML Parsing: unable to switch encoding

I am trying to migrate the data from an OracleDB to an SQL Server Express database. I'm doing this by openquerying a linked server (data provider based on Oracle Provider for OLEDB). Everything works ...
0
votes
2answers
237 views

Access 2003 (SQL Server 2000) migration to SQL Azure

As my old Windows 2003 RAID controller started throwing errors, I am seriously thinking about switching current Access 2003 (adp/ADO) clients to use a Windows SQL Azure solution, in place of current ...
1
vote
0answers
481 views

Efficiently retrieve big amount of data based on date range

Table EVENTS TimeStamp |O.Name |Location |Source | 2008-11-12 |Pretorian|Európe |England | 2009-12-24 |Lex Rosa |Európe |Italy | 2010-01-01 |Nasdaq |USA |Whasington | ...
1
vote
1answer
144 views

Consolidating indexes

I have one big table that is used to generate business intelligence cube. Currently it has around 40M rows and 55 columns. A lot of the cube dimensions are generated by running 'select distinct' on a ...
1
vote
3answers
761 views

PreparedStatement caching size on Oracle and SQL Server

I understand that PreparedStatements are complied and cached by database servers. I would like to know if all the preparedStatements are complied and cached on the server, in which case what is the ...
1
vote
2answers
2k views

Advice for ETL from Oracle to SQL Server?

I'm building a data mart in SQL Server which needs to extract each month from an Oracle database. Currently this is done by exporting to flat files, then running all the inserts/updates in SQL ...
-3
votes
2answers
814 views

Versioning data in Databases [closed]

Is there any ready mechanism in Oracle, SQL Server, PostgreSql or OR framework (C#), which can version information in a database? By versioning informartion I mean that e.g. I have table Person (id, ...
1
vote
2answers
103 views

Problem with a surrogate key?

I am working with an application for students management. For the student's table I used a surrogate key (auto increment id). The problem I face with the surrogate key is when the user wants to show ...
1
vote
2answers
1k views

Only one NULL for one part of primary key

I have two date columns : "start date" and "finish date". I want to make sure that there can be only one null value in the "finish date" column (which should be current state if it's NULL) for one ...
1
vote
1answer
170 views

When to use identity increment?

Many times I face these three choices to work with IDs: Using an auto-increment identity column? Suggesting a new codification to use (eg, for students: first 4 position is the year when the student ...
3
votes
1answer
313 views

check constraint that has dynamic list

I need to create a check constraint, the problem i face is that the list of values accepted by the constraint changes in the future (ex:now "red,green and blue" in the next month "red,green,blue and ...
1
vote
1answer
189 views

Can I run a Report Server and a Mirror server from a working Log Shipping secondary instance? [closed]

Our setup: City A - Primary server for logshipping City B - Secondary server for logshipping Now there is a lot of data being updated from A - B. And the server in City B is underutilized, and it ...
0
votes
4answers
427 views

which one is the fastest way of moving database form local to live server in sql server

I am using SQL Server 2008, I have big database almost 500 MB of data there. Now I wanted to upload or deploy this DB to Live server. Currently I am generating script and then uploading script to live ...
3
votes
2answers
1k views

SQL Server media belongs to which edition

Could anyone please help me on below question? Without installing SQL Server media 2008 and 2012, how can we know that the media belongs to which edition (like developer, standard or ...
2
votes
1answer
111 views

Find a string in a SQL Server database

I have an application which has logged an error like Object <obj id> generated an exception. The application store all its information in a SQL Server database which contains 100+ tables. ...
1
vote
3answers
543 views

SQL Server xml performance

I have a table with 21 columns. The majority are numerical and the rest are nvarchar. I need to add 4 columns that will contain XML data for each row. The XML data for each row can be anywhere from ...
0
votes
1answer
194 views

Load balancing after clustering is failed in SQL Server cluster

This is what I have been asked today on my interview for a SQL Server DBA position: It is an active - active cluster configuration. The primary node is in NY and the other node is in Rio. The NY ...
1
vote
1answer
3k views

The Cluster service failed to bring clustered service or application 'SQL Server (MSSQLSERVER)' completely online or offline

SQL Server service restarted/stopped, which cause the production database down n find this errors in System log. ERROR5:The Cluster service failed to bring clustered service or application 'SQL ...
3
votes
1answer
17k views

Find all the queries executed recently on a database

[I am a beginner level T-SQL Programmer] [..and hopefully I am on the right stack exchange site] I would like to get a list of all the queries I executed (in the least, those I executed today since ...
2
votes
1answer
26 views

Is it possible to use two different drivers for sql server on the same machine. Say 2000 and 2008

I am trying to use two versions of sql server on the same machine. I have sql server 2000 driver installed on the system. Can I also install sql server 2008 driver on the same machine and use both ...
4
votes
1answer
385 views

SQL Server 2005 Replication

I am in the process of creating Replication between 2 Remote Servers, server 1 is the Distributor and Publisher and server 2 is the Subscription. server 1 windows 2003 server 192.168.10.1 connected ...
0
votes
1answer
270 views

Backup failure in SQL Server 2005

I'm being unable to perform a backup in SQL Server 2005 installed on Windows 7 local machine. I was initially able to do so but as of now, every time I try I get the following message: Backup ...
5
votes
1answer
2k views

SSIS 2008 Package Configurations being ignored

With the change to package configurations in 2008 compared to 2005 when I specify /ConfigFile something.dtsConfig on the command line, variables defined in the package are keeping their design-time ...
6
votes
2answers
2k views

Is there a better option than Union All for multiple selects from the same row?

Example Schema: CREATE TABLE [dbo].[Base]( [ID] [int] IDENTITY(1,1) NOT NULL, [Option1ID] [int] NULL, [Option2ID] [int] NULL, [Option3ID] [int] NULL, [Option1Name] [varchar] NULL, [Option2Name] ...