Tagged Questions

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

SQL Server 2008 R2 database mirroring - is it possible to have a slave server for multiple master servers?

Scenario is that I have two servers running SQL Server 2008 R2 (64-bit), let's call them DB1 and DB2. I have set up database mirroring for all the databases on these servers so that DB1 is the ...
0
votes
1answer
3k views

Import data from Oracle to SQL Server [duplicate]

I have an Oracle database in a remote server. I want to import data from it to SQL Server on a local machine using a stored procedure or job shedule but I don't know how can I do it.
3
votes
0answers
470 views

SSIS Recordset Destination error

I have an SSIS package targeted at SQL Server 2012. I have it deployed into the Stored Packages in Integration Services and then have a SQL Server Agent job which executes it. The first part of the ...
3
votes
3answers
3k views

SQL Server update query on linked server causing remote scan

I have a SQL Server 2012 setup as a linked server on a SQL Server 2008 server. The following queries executes in less than 1 second: SELECT kg.IdGarment FROM Products p INNER JOIN ...
2
votes
2answers
136 views

SQL Server 2005 encrypted database works on new PC without restore keys!

Something tells me that it was not normal. Let me take it from the begining. In an SQL Server Express 2005 I needed to encrypt one column. I did the following. CREATE MASTER KEY ENCRYPTION BY ...
2
votes
2answers
2k views

How to restore a filegroup from its backup in SQL Server

I need guidance on how to restore a file group in Database from the File group backup taken from another same DB server. Is it possible to restore the filegroup by running restore DB for File Group. ...
0
votes
1answer
166 views

SQL Server 2005 Transactional Replication

I am in the process of replicating my companies databases from SQL Server 2005 to SQL Server 2012 using Transactional Replication. When complete we will be running preliminary tests on the database, ...
0
votes
2answers
125 views

Changing passphrase for EncryptByPassPhrase

I am using EncryptByPassPhrase to encrypting some columns. If I want to change the passphrase in the future, how can I change it?
1
vote
1answer
398 views

Cannot initialize the data source object of OLE DB provider “Microsoft.ACE.OLEDB.12.0” for linked server

I'm trying to establish a linked server from SQL Server 2008 R2 to an Access database. The Access database is not password protected. As I have seen in other posts (specifically this one), this is ...
2
votes
0answers
55 views

Create Scheme that allows for fluidity between entities [closed]

We are a small rapidly evolving company and recently investigated switching databases from SQL Server to a graph database. We like the graph approach because of the fluidity and openness that it ...
1
vote
1answer
185 views

Database Tasks in C#

We have 2 database environments a "Production" Database and a "Reporting" Database located on different physical windows server 2003 boxes. The reporting Db is derived off the Production database and ...
5
votes
2answers
3k views

What are the differences between leaf and non-leaf pages?

I've been running some index usage reports, and I'm trying to get a definition of Leaf and Non-leaf. There seem to be both Leaf and Non-leaf Inserts, Updates, Deletes, Page Merges, and Page ...
1
vote
0answers
434 views

Collect CPU, reads and writes when replaying SQL Profiler Trace

I'm trying to replay a trace on a test environment with SQL Profiler in order to benchmark a database prior to making some performance tweaks. I intend to replay the same trace at various stages to ...
3
votes
0answers
154 views

Conflict handling, SQL Server 2008 R2 Peer to Peer

I have a Peer to Peer replication topology set up between two SQL Server 2008 R2 servers. I was doing some testing on fault tolerance and conflict handling. I have conflict detection enabled, and ...
3
votes
2answers
136 views

SQL server performance and tuning

I am working on a system, there is a cisco load balancer that can handle 40K requests. There are two app servers. There are 12 or so web services. and there is a SQL server with 2TB of data. ...
3
votes
4answers
227 views

PRIMARY KEY CONSTRAINT fundamentals

Can you explain why "primary key constraint" exists if, as you know, it is possible to create relationships between tables using unique indexes only ? The RDBMS that is used is SQL Server. In fact, ...
1
vote
2answers
277 views

Database Design question, calculate or save financial positions

As the question states i'm currently internally strugling witha database design question. I work as a software developer (and i tend to do everything database related aswell since we're rather small) ...
2
votes
1answer
12k views

IF NOT NULL then UPDATE else keep the value of the field

I think I am somehow close to get it work, but for some reason I still get errors. I have the following UPDATE query: UPDATE DeviceAttribute SET Details = CASE Name WHEN 'Accessories' THEN ...
1
vote
3answers
3k views

How do I determine if a database is the principal in a mirroring setup?

I have two database servers Server1 and Server2, configured with mirroring. A single database, MirrorDB, is mirrored. There is another database on Server1 named OtherDB which is only present on ...
3
votes
2answers
1k views

Migrate SQL Server database to multiple files (shrinkfile emptyfile vs log shipping)

I have a SQL Server 2008 database in production that we are moving onto a new server. The current database has a single ~400GB .MDF file. The new server will be running SQL Server 2012, and we are ...
0
votes
1answer
796 views

Is Reorganizing Indexes required after ShrinkDatabase or can I just reogranize index with fragmentation more than 10%?

I am a new DBA to a SQL 2005 production Report server. My predecessor created a Maintenance Plan with 4 tasks: CHECKDB; SHRINKDATABASE (N'DB1',10,TRUNCATEONLY); it seems to be running a REORGANIZE on ...
2
votes
2answers
78 views

View Disc Usage

Is this statement correct? Behind the scenes SQL Server actually stores the data in the view as a physical table which must be updated if any of the data behind the view changes I did some ...
3
votes
3answers
2k views

SQL Server service shutdown due to 'bad?' SSL cert

This morning it transpired that SQL Server 2012 service running on Win2012 had shut itself down. When I logged in as the server admin and tried to access SSMS, after entering my credentials I got the ...
2
votes
1answer
497 views

Indexed view not being used - SQL Server [duplicate]

I've a query with multiple joins which takes long time to return data for one date. I've created an indexed view on the same. I set all the required options appropriately, while creating view and ...
-1
votes
1answer
1k views

Conditionally INSERTING columns into Table

using SQL Azure and like to insert a data to a table using dynamic Query. No of columns in select statment is dynamic. It will be based on some conditions. Ex: Salary, Code. How can I create a ...
3
votes
1answer
90 views

Adding column from SSMS wizard in SQL Server

Today, I am reading through Pinal Dave's blog about adding column in SQL SERVER....One thing make me surprised that while adding column from SSMS wizard, it goes from following process: Create a New ...
2
votes
0answers
193 views

How to speed up SQL Server RIGHT JOIN on 100MM+ Records - use TVF?

I use a table insert to UNION a CTE of converting transactions to visits (converting or not) and then summarize the visit data (no details, just pages visited & txns completed) to get funnel ...
1
vote
1answer
123 views

Join Calender Table

I have a Datatable and a Calendartable. I do a join on this tables to get sequential dates if there is no data for this day. My problem now is that there a several id's and i need a count for each ...
2
votes
3answers
420 views

Why is SQL running the same query longer from another connection? [closed]

Here is the issue overview: Why does my stored procedure run faster when executed localy vs remotely? Dont jump to any conclusion just yet, let me explain what I mean... Here is the setup: A Windows ...
4
votes
1answer
73 views

Under what circumstances can a division expression reduce the number of rows in a query's result?

I'm experiencing a problem with a query that I've written. Given a table with the schema: create table somevals(division varchar(100), subdivision varchar(100), ...
1
vote
0answers
222 views

Troubleshooting Database Mail issues and Service Account permissions in SQL Server

I am having difficulties troubleshooting a Database Mail issue. When I try to stop and start the service using sysmail_start_sp and sysmail_stop_sp, I see a critical error in the Administrative Logs ...
15
votes
5answers
4k views

Handling concurrent access to a key table without deadlocks in SQL Server

I have a table that is used by a legacy application as a substitute for IDENTITY fields in various other tables. Each row in the table stores the last used ID LastID for the field named in IDName. ...
0
votes
1answer
3k views

Can't connect to SQL Server Windows 7 [closed]

TITLE: Connect to Server Cannot connect to localhost. ADDITIONAL INFORMATION: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was ...
0
votes
2answers
8k views

Cannot initialize the data source object of OLE DB provider “Microsoft.ACE.OLEDB.12.0” for linked server

This is going to be a long story I'm afraid ;-( I have to read some text-files into a SQL database. This database is on a SQL 2008 R2 x64 database server. I want to use a linked server so after some ...
2
votes
1answer
1k views

SQL Server cluster questions please

We have SQL Server 2008 R2 cluster active/active/active (a, b, c) and three instances run on this environment. We did a test on one of the instances, and failover test. Manual failover from node c ...
1
vote
0answers
303 views

INSERT BULK in SQL Profiler without values

I started SQL Profiler to catch actions that are doing on server, and among them I found one row where is stated: SQL BatchStarting: insert bulk table_name <column_list> but there is no ...
1
vote
1answer
841 views

Alternative tools to export Oracle database to SQL Server? [closed]

I've got an Oracle database that I need to export (schema and data) to SQL Server. I am trying the Microsoft SQL Server Migration Assistant for Oracle, but it is horribly slow, grossly inefficient ...
6
votes
1answer
275 views

how do I insert a default row?

If I create a table with an identity column as primary key, and all the other columns have default values, for example create table rr (id int identity(1,1) primary key, dt datetime default ...
4
votes
1answer
948 views

SQL Server 2008 query planner failing after index drop & recreate

Recently we ran a script to our production DB that would dynamically drop and recreate hundreds of indexes as filtered indexes. While this script had run perfectly in all other previous tests, now ...
8
votes
1answer
315 views

Strategies for organising SQL Server with large amount of RAM

We now have a new server for our DB and amongst other things we have 128GB of RAM available (previously I had 16GB) . I know SQL Server is very good at managing it's resources, but I was wondering if ...
15
votes
6answers
7k views

What is a good, repeatable way to calculate MAXDOP on SQL Server?

When setting up a new SQL Server 2012, I use the following code to determine a good starting point for the MAXDOP setting: /* This will recommend a MAXDOP setting appropriate for your machine's ...
2
votes
0answers
107 views

Can the same database be log-shipping secondary and primary at the same time?

Here is my scenario: Database DB1 on Server1 is log shipping primary in data center. Database DB1 on Server2 is log shipping secondary; Server2 is in remote location. Logs are shipped from data ...
5
votes
2answers
2k views

SQL Server 2008 can't repair consistency

I have a problem with a SQL Server 2008 database. Launching DBCC CHECKDB I get this error: SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: ...
0
votes
1answer
1k views

SQL update set column = @ parameter

doeas anyone knows how to update a table where column = @parameter WHERE SELECT Basically I have a table with the following values. Table name is UserAttribute ID|Name |Properties| ...
5
votes
2answers
746 views

Two corrupted indexes found by DBCC CheckTable

I'm wondering if this problem is solvable by dropping/recreating the two indexes. Both are rarely used, nonclustered, non PK, non FK indexes. Here is the dbcc output: Table error: table ...
4
votes
2answers
1k views

Track grant permission on tables

I'd like to see if there are any changes on the permissions granted for a specific table. For example, I don't want to have the login 'John' have the SELECT permission on the table Invoices. If ...
4
votes
1answer
1k views

Primary key with “NOT FOR REPLICATION” option

I have recently taken over a project, and I have discovered that in most tables the primary key has the property "NOT FOR REPLICATION". I'm no DBA, but surely in most databases, a record without a ...
1
vote
1answer
115 views

Public Database for Mobile Application

What are the proper steps to hosting a public database. Currently I a building a mobile application with Adobe Flash Builder. I have used Microsoft SQL Server, My SQL as well as WAMP Server. All of ...
1
vote
2answers
405 views

SQL Server Profiler 2005 on remote SQL Server 2008 Express?

Is it able to trace remote SQL Server 2008 using SQL Profiler 2005? If yes, anyone knows what else should I do, if during loging in appeares this message "Unable to locate trace definition file for ...
1
vote
1answer
2k views

how to add attachment(text file) to database mail?

I have scenario Daily i run a sql job to apply a new updates to one table - this job will create one text file daily - text file contains all new updates I can send a mail to client that job is ...