This tag is for SQL Server 2008, major build version 10.00.xxxx.

learn more… | top users | synonyms (1)

7
votes
2answers
3k views

SQL Server 2008 - Cross database performance on same physical machine and server instance

Is there any performance hit when doing a select across another DB on the same physical machine? So I have 2 databases on the same physical machine running within the same SQL 2008 instance. For ...
7
votes
4answers
10k views

Replicating a remote MySQL database to MS SQL Server 2008

I want to replicate the contents of a MySQL database to a MS SQL Server 2008 database. Is this possible? Can anyone outline the steps required in order to achieve this? Thanks.
8
votes
1answer
570 views

Is there a reliable way to determine when you should run DBCC CLEANTABLE to reclaim space?

Lately, instead of just growing files when they near 80% file utilization, I've been more proactive at reclaiming space via the usual tricks like defragmenting heaps, adding & dropping clustered ...
2
votes
1answer
501 views

How to customize Deploy feature in VS2010 for SQL CLR projects?

The default deployment script for SQL CLR objects in VS2010 seems to require one to set the target database to SET TRUSTWORTHY ON and tries to enable vardecimal storage at the database level. On our ...
27
votes
9answers
46k views

Passing array parameters to a stored procedure

I've got a process that grabs a bunch of records (1000's) and operates on them, and when I'm done, I need to mark a large number of them as processed. I can indicate this with a big list of IDs. I'm ...
4
votes
2answers
157 views

Randomizing table contents and storing them back in the table

I have a table with at least a million records in it. These rows were created by a custom app that reads several SharePoint site collections and stores the item urls in the table. Now, since we read ...
5
votes
3answers
873 views

Best solution for High Availability and SSRS on SQL Server 2008 R2?

I have 2 Physical Servers with SQL Server 2008 R2. – SQL Server 1(Active) & SQL Server 2 (Passive) Web Application is developed using .Net 4.0 Framework. I want to know the best solution to have ...
9
votes
3answers
2k views

SQL Profiler tutorials for newbie

The MSDN documentation tough to understand. Are there any online tutorials available to learn SQL Profiler? If possible, videos or simple blog posts would be preferred.
18
votes
3answers
30k views

How do I list or search all the column names in my database?

I want to search for a string in the names of the columns present in a database. I’m working on a maintenance project and some of the databases I deal with have more than 150 tables, so I'm looking ...
9
votes
3answers
2k views

How to change the firing order of Triggers?

Realy I rarely use triggers. So I met a problem at first time. I have a lot of tables with triggers (2 or more for every table). I would like to know and change the order of firing triggers for every ...
2
votes
2answers
4k views

MS SQL Server 2008: How to improve performance after deleting transaction log file

Due to the size of transaction log file (it grew up to 200 GB) I had to delete it because the disk was running out of space. I know this is not a good practice but anyway after that the performance is ...
5
votes
1answer
484 views

Can filtered indexes help improve queries that are based on a time entered or should this be avoided?

I'm just learning about the new filtered indexes in MS SQL 2008 and I'm trying to understand where they would hurt and where they would help. I can see that adding a filtered index to an employees ...
10
votes
1answer
1k views

What is the impact of changing the index creation memory setting in SQL Server?

I am trying to create some indexes a SQL Server 2008 database but am getting the following error message. Msg 8606, Level 17, State 1, Line 1 This index operation requires 1024 KB of memory ...
6
votes
2answers
6k views

SQL Server 2008 log files have minimum sizes, what gives and how do I make them smaller?

Ok, to start with, I screwed up when I created the databases, using a create script roughly like so: (artificial linebreaks and names/paths for wrapping purposes) CREATE DATABASE [EXAMPLE] ON ...
24
votes
5answers
16k views

How do I shrink all files quickly for all databases?

In SQL Server (2008 in this case) how can I quickly shrink all the files, both log and data, for all databases on an instance? I could go through SSMS and right click each and choose Tasks -> Shrink, ...
16
votes
3answers
30k views

How to change SQL Server collation

How could I change the SQL Server 2008 R2 Express Default Collation for the whole server and a particular database? Is there a way to do it using visual interface of SQL Server Management Studio? In ...
4
votes
1answer
128 views

Where to put a database in case of IP failover?

I understand that to achieve some level of availability of an online application it is possble to organize an environment with a redundancy using an IP failover mechanism and switching between several ...
9
votes
2answers
2k views

Why can't I read Oracles CLOB columns via SQL-SERVER 2008 linked server?

I want to access data in an Oracle 11g database from SQL-Server 2008 I set up a linked server and when I execute select * from [Link_server_name]..Oracle_schema.Oracle_table and Oracle_table ...
16
votes
4answers
8k views

Task scheduler for SQL Server Express

I have an ASP.NET MVC app which works with database under SQL Server 2008 R2 Express edition. There is a need to perform a regular task on updating some records in the database. Unfortunately the ...
12
votes
1answer
353 views

Best practices for connecting DBs that are in different geographical regions

We are about to set up SQL Servers in different countries. We need to link them, but we don't have to have a direct link (as in linked server). In other words, they can be loosely coupled. Is it ...
4
votes
1answer
234 views

Are there tools for SQL-Server helping to add the semicolons?

Earlier versions of SQL-Server didn't recommend the use of semicolons to terminate sql-statements. Beginning with sql-server-2008 examples show, that now Microsoft recommends terminating with ...
31
votes
5answers
24k views

What are the main causes of deadlocks and can they be prevented?

Recently one of our ASP.NET applications displayed a database deadlock error and I was requested to check and fix the error. I managed to find the cause of the deadlock was a stored procedure that ...
8
votes
2answers
805 views

How much “Padding” do I put on my indexes?

How do you know how much "Padding" an index should have?
24
votes
4answers
950 views

Is there a “best-practices” type process for developers to follow for database changes?

What is a good way to migrate DB changes from Development to QA to Production environments? Currently we: Script the change in a sql file and attach that to a TFS work item. The work is ...
27
votes
5answers
4k views

Downgrading from SQL Server 2008 to 2005

Database files that are built using SQL 2008 are not compatable with 2005. Is there a work around?
3
votes
1answer
2k views

To 'DBCC SHRINKDATABASE' or Not To 'DBCC SHRINKDATABASE': That's the question

We're freeing lots of space in a SQL Server 2008 R2 database -a Loooot! enough to care about- (we're dropping lots of unnecessary data). but the database file conserves its file size. we want to ...
1
vote
4answers
2k views

How do I restore a SQL Server 2000 database to a SQL Server 2008 instance?

How do I restore a SQL Server 2000 database to a SQL Server 2008 instance?
0
votes
1answer
103 views

SQL Server Point in Time Restore Scenario

Hopefully you can help out on this as I may be up a creek! I am working with a database using the FULL recovery model. The database has had nightly database backups but their transaction log has ...
3
votes
1answer
2k views

Sql FILESTREAM garbage collection issue

Updated 3x I'm using FILESTREAM, but am having an issue with garbage collection. The FILESTREAM files are not being cleaned up when I set the column to null. In the event log, there is an enormous ...
4
votes
2answers
192 views

SQL Filegroup degrading performance

On our dev boxes, our database resides entirely in the PRIMARY filegroup, and everything works fine. On one of our production servers, recently upgraded from 2005 to 2008, we noticed it was ...
0
votes
2answers
3k views

SQL Server 2008 DBCC Problems

We have a database Ms DBCC CHECKDB (MS) Or ALTER DATABASE MS SET SINGLE_USER DBCC CHECKDB(MS,REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE MS SET MULTI_USER Error message Msg 0, Level 11, State 0, ...
1
vote
1answer
381 views

Exclude .LOG file while restoring a database

I have a database backup file (MyDatabase.bak). When restoring the database through SSMS it gives me "Not enough space on disk" message. I looked for an option to exclude .LOG file from restore but ...
5
votes
1answer
154 views

Table partitioning in SQL 2008 - Why?

I understand how it works, but the book I'm studying doesn't tell me why you'd want to partition. Could someone shed some light? I can't understand any concept unless I see how it's useful.
1
vote
1answer
46 views

tsql to know when a database was last shrunk

In SQL 2000, 2005 and 2008, how can I know when databases were last shrunk on a MS SQL server? I want to do this using TSQL. Regards Manjot
7
votes
5answers
948 views

Using IF in T-SQL weakens or breaks execution plan caching?

It has been suggested to me that the use of IF statements in t-SQL batches is detrimental to performance. I'm trying to find some confirmation or validate this assertion. I'm using SQL Server 2005 ...
2
votes
3answers
1k views

Undo Database Restore in SQL Server 2008

I accidentally restored a SQL Server 2008 database with a wrong backup. Is there any way to undo this and restore to previous version?
3
votes
2answers
158 views

Database Mirroring of SQL server

I have two databases that are mirrored to another server using database mirroring. The mirror server has to be down for some reason for few days. Now, the production server is having principal ...
4
votes
3answers
3k views

SQL Server 2008 Table Maintenance - Rebuild, Reorganize, Update Stats, Check Integrity etc

I'm migrating a ~15GB database from SQL Server 2005 to a new server running SQL Server 2008, and along with that I need to create all the new Maintenance Plans. I can take care of all the backup ...
13
votes
2answers
11k views

How to change the instance name of SQL Server Express 2008?

On my development machine I've installed SQL Server Express 2008, but it has the instance name .\SQLEXPRESS. I want it to be the default instance. I'm pretty sure that I selected the "Default ...
0
votes
1answer
627 views

Sql Server merge replication primary key violations

Using Sql Server 2008. Pretend I have a publisher and 2 subscribers A and B. The replicated table has a guid on it and also a primary key that is not the guid. Frequently, updates happen at both ...
5
votes
6answers
2k views

attach/detach v.s. backup/restore

I am using SQL Server 2008 Enterprise. I need to transfer the database (as a whole) to another server (to make a duplicate database to setup another test environment). I have two choices, (1) making ...
0
votes
1answer
666 views

SQL Server 2008 - Restore Database With RESTART

I am trying to restore a database from a backup file on a SQL Server 2008 instance using the following SQL command: BEGIN RESTORE DATABASE [MyDataBase] FROM DISK=@db_location WITH ...