SQL Server 2008 R2 (major build version 10.50.xxxx). Please also tag with sql-server.

learn more… | top users | synonyms (2)

3
votes
4answers
6k views

Can I force a user to use WITH NOLOCK?

Can I force a user's queries to always run with the hint NOLOCK? e.g. they type select * from customer But what is executed on the server is select * from customer with (nolock) This question is ...
3
votes
1answer
3k views

ORDER BY items must appear in the select list […]

Using Microsoft SQL Server 2008, I get the following error. Msg 104, Level 16, State 1, Line 43 ORDER BY items must appear in the select list if the statement contains a UNION, INTERSECT or ...
1
vote
1answer
25 views

New instance with same @@VERSION as existing instances

I have a SQL Server 2008 R2 server with several instances installed. Is there a way to add a new instance and have it be to the same build as the existing (and updated / patched) instances?
2
votes
1answer
4k views

Migrate / Copy Huge data from Oracle to SQL Server

I have huge tables in oracle database, appx 1 crore+ (10 million+) rows and want to migrate / copy those table and data in sql server. Currently I am using Import functionality of SQL Server for this ...
3
votes
2answers
33k views

Cannot connect to my local instance

When I connect to my local server, I get this message A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not ...
5
votes
1answer
7k views

Importing a large column (8000 chars) from Excel using SSIS

I'm trying to set up a regular import of an excel spreadsheet that we get from a vendor. I'm using SQL 2008 R2 SSIS to import it into a table. The problem connection manager is an OLE DB connection ...
11
votes
2answers
11k views

Need to understand parallel query execution error

Today we experienced a degradation in performance on our production sql server. Durring the time this occurred we logged several "The query processor could not start the necessary thread resources ...
2
votes
2answers
269 views

Checking SQL Server's memory utilization

Is there a way to check how much of the memory reserved by SQL Server is actually being used by SQL Server? Is there a way to look at this information in the past? I.e. how much memory was being used ...
3
votes
1answer
447 views

Is the Service Broker good for publishing data between servers?

I'm trying to find a better solution when publishing data to a remote table. So we have Server A and Server B. Server A holds a master table which should be replicated to Server B. Currently, we ...
4
votes
5answers
7k 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 ...
5
votes
1answer
11k views

SQL Server Maximum and Minimum memory configuration

What are the correct settings for min-memory and max-memory in this use case? The server has 8GB ram, dual Intel Xeon processors, running Windows Server 2008 R2 / Sql Server 2008 Standard Edition. ...
1
vote
1answer
687 views

Using like over charindex to search for pattern

We where using charindex to search for a string as shown below SELECT * FROM tablename WHERE ( Charindex('47a%$.abc',CAST(columnname AS VARCHAR(MAX)))>0 ) I am planning to replace charindex with ...
1
vote
3answers
2k views

How can I drop a stored procedure whose name is in a variable?

Given a variable that contains a stored procedure name: DECLARE @stored_procedure_name sysname; SET @stored_procedure_name = 'some_stored_procedure_name'; How can I drop the stored procedure?
5
votes
3answers
4k views

In Microsoft SQL Server 2008, syntax generates the error “The Parallel Data Warehouse (PDW) features are not enabled.”

I have the following virtual column generated from an aggregate over a sorted partition, MIN(picture_id) OVER ( PARTITION BY [360_set] ORDER BY picture_id ASC ) However, when I execute that, I get ...
2
votes
2answers
5k views

How to make SQL Server Management Studio use latest version of SQL Server?

I'm upgrading my dev machine from Windows 7 to 8. While installing earlier versions of Visual Studio it installed SQL Server 2005. I then went to this site and downloaded and installed SQL Server ...
1
vote
0answers
83 views

Setting up replication alerts

I 'm trying to configure alerts for replication. Currently on my test setup I run everything under user 'sa'. When I try to set up alert for agent failure I get the following error Login failed for ...
1
vote
1answer
127 views

Number of times a table is read, written to and updated

Is there a way I can find out the number of times a table is read, updated, added to or has had rows deleted during a trace? I am creating the trace in SQL using sp_trace_setstatus, not using the Sql ...
1
vote
0answers
483 views

Data replication between SQL server 2008 R2 and other NOSQL DB (ML, MongoDB)

I'm a newbie in RDBMs and I have the question regarding replication between SQL Server (Oracle in future) and NOSQL MarkLogic server (ML). There are two servers: Machine with SQL server 2008 R2 ...
2
votes
1answer
94 views

Which Edition Of SQL Server Is On The Disc? [duplicate]

I have several SQL Server 2008 R2 setup discs, but they're not labelled with which edition (Standard, Developer, Enterprise etc.) they are for. Running them doesn't give much help as it just shows ...
3
votes
2answers
3k views

How can I execute a stored procedure whose name is in a variable?

Given a variable that contains a stored procedure name: DECLARE @stored_procedure_name varchar(512); SET @stored_procedure_name = 'some_stored_procedure_name'; How can I execute the stored ...
4
votes
3answers
181 views

Expanding a dataset based on a weight field

I have a table that contains records in an un-expanded form. Each record has an associated integer weight that essentially informs us how many times the record should be replicated in order to get the ...
18
votes
2answers
6k views

LIKE uses index, CHARINDEX does not?

This question is related to my old question. The below query was taking 10 to 15 seconds to execute: SELECT [customer].[Customer name],[customer].[Sl_No],[customer].[Id] FROM [company].dbo.[customer] ...
3
votes
1answer
3k views

Cannot Connect Using SSMS to Local SQL Server 2008 R2

About six months ago my vendor installed SQL Server 2008 R2 into a clustered pair of servers, DB01 and DB02. I've been logging on, periodically, to DB01 to audit some of the data contained in the ...
1
vote
1answer
2k views

Issue with SQL Server Aliases on a multi-instance installation

I've a 64-bit installation of SQL 2008 R2 SP2 on Server 2008 R2, with five instances of SQL. I can get the aliases set up to work fine on the server (i.e. if I remote onto the server, then it works ...
2
votes
1answer
3k views

Query taking non-consistent time to execute [closed]

I have a query which takes large time to execute sometimes.When i checked the speed it was taking 15 seconds.But actually it should run faster than that.When i again checked the query it again ...
3
votes
1answer
2k views

Replication Not Replicating

I'm trying to set up transactional replication between two SQL Server 2008 R2 databases and, no matter what I try, it just doesn't seem to work, and I'm not sure where to look for further information ...
0
votes
1answer
1k views

Databases not showing up in Object Explorer [closed]

None of the databases are showing up in the Object Explorer window even when the server has been connected successfully. It is showing only one database that I have created exactly 1 year back. How ...
3
votes
2answers
1k views

Database defragmentation and autogrowth settings

We do have some maintenance plan for our SQL Server 2008 r2 express. Every month we do de-fragmentation of the database if any table has page count more than 50 for any table and average fragmentation ...
0
votes
1answer
598 views

Blocked access to batch file

I am unable to execute batch files to copy backups from SQL Server 2008 R2 hosted on Windows 2008 R2 to a file share. Error: Access denied SQL Server Agent service has full control on the ...
11
votes
3answers
5k views

Move multiple databases from C: to D: at once

I have SQL Server 2008 R2 with 323 databases consuming some 14 GB on my C: drive, a fast SSD. Because I want to reclaim some space on my C: drive, I would like to move them to my D: drive. I have ...
4
votes
2answers
1k views

Pulling autogrowth events by file name from default trace

I use below query to get auto-growth event occurred to databases in a sql server. DECLARE @trcfilename VARCHAR(1000); SELECT @trcfilename = path FROM sys.traces WHERE is_default = 1 SELECT COUNT(*)as ...
4
votes
4answers
4k views

SQL Server audit query that fires a trigger

Using SQL Server, does exist a way to audit from inside a trigger the sql that fires it? I need to know the SQL query that fires a trigger over a database without a profiler. Thanks
2
votes
2answers
6k views

Permissions Needed To Attach AdventureWorks Database

I am trying to add the AdventureWorks database in MS SQL Server Management Studio (SSMS) 2008 R2. As a new person to this area, or noob, this seemingly simple task has caused me much hardship and ...
8
votes
2answers
676 views

function hangs with null case operation

I created a function that accepts a start and end date, with the end date being optional. I then wrote a CASE in the filter to use the start date if no end date is passed. CASE WHEN @dateEnd IS NULL ...
3
votes
1answer
969 views

SSIS hangs during For Each File enumeration

While debugging an SSIS package that loops over thousands of files, execution hangs with no errors and no failed tasks. Slightly simplified, the package does this: For Each File ...
1
vote
0answers
77 views

Rows do not match Subscriber and Publisher

I have an transactional replication setup with updateable subscription that is utilized by an Application. When I insert a project into the application, the msrepl_tran_version is different on the ...
6
votes
1answer
2k views

Replicated Database Log File Maintenance

I have a database on the publisher that is involved in replication (publication configured for merge and transaction). Trying to regain control of the log file for this particular database (VLF count, ...
7
votes
1answer
177 views

IN and NOT IN for XML column

I have a table with a xml column. Xml is similar to <Root> <Row> <user>abc</user> <Rowid>1</Rowid> </Row> <Row> ...
5
votes
1answer
142 views

Count Most Recent Browser Used By All Users

I have a table with columns Type, Login, and Timestamp. It has been collecting information about the type of browsers users log into the system with for years. Obviously many of the users have since ...
4
votes
2answers
5k views

Installing Full Text Search to SQL Server 2008 R2

I installed sql server 2008 R2 Express successfully, then realised I need to get Full Text Search. So I downloaded the "Advanced Services Installation Package", but when I run it there is no option in ...
0
votes
1answer
99 views

SQL Server Instance Version [closed]

I'm working with a SQL Server with several instances. Four of my instances are at 10.50.2811.0 and the remaining two are at 10.50.1765.0 I've tried running SQL Server 2008 R2 SP1 and CU 6 to get it ...
2
votes
2answers
2k views

SQL server windows authentication through network

I am using sql server 2008 r2.There are about 50 pc in my office connected in network by using LAN.In a sql server 2008 r2 express(installed in windows 8) i have created all users windows account with ...
11
votes
1answer
8k views

Setting variables in SQLCMD mode

Using SQL Server 2008 R2 Enterprise Edition Consider the following statement: :setvar source_server_name "SERVERNAME\INSTANCENAME" Is it possible in SQLCMD mode to get that value using TSQL ...
3
votes
1answer
2k views

SQL Server 2008 R2 cluster installation error [closed]

I was trying to install SQL Server Cluster (Launch wiard to install single node SQL Server 2008 R2 faliover cluster) .. The setup checks displayed no error and the installation started after all the ...
7
votes
1answer
772 views

SQL Server not using available memory

SQL Server 2008 R2 Standard Edition (64-bit) on Windows 2008R2 Enterprise Server has over 300 GB of memory but total memory use in control panel never goes over 86 GB Have SQL configured to use ...
1
vote
2answers
11k views

What is the most effective way to compress and store a SQL Server backup? [closed]

I've been doing some testing of different methods for compressing and storing SQL Server backups (using SQL Server 2008 R2 Enterprise edition), and I'm wondering what the most effective compression ...
6
votes
1answer
919 views

How can a fill factor of 0 or 100 be the same?

As of my understanding, Fill factor of 80 implies that 20 percentage of each leaf-level page will be empty to enable future growth. I can't correlate how fill factor of 0 and 100 can be the same! Am I ...
6
votes
0answers
419 views

SQL Server Sproc calls from IBM Cast Iron orchestration with XML payload fail

I'm hoping that someone on this forum may have experience with an IBM appliance, Cast Iron (Websphere), and how it interacts with SQL Server. I know very little about the Cast Iron appliance, and its ...
3
votes
1answer
754 views

Why does Log Shipping .TRN file copy just stop

I apologize in advance for a long post but I have had it up to here with this error of having to delete LS configuration and starting it over for any DB thats got this error. I have LS setup on 3 ...
2
votes
1answer
2k views

Invalid object name 'master.dbo.MSreplication_options' when restoring DB

I've tried Googling for an answer to this but have got nowhere. I have one SQL Server instance whose replication is set up to be a publisher and a distributor of FooDatabase. I have a second ...