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

learn more… | top users | synonyms (2)

4
votes
3answers
5k views

Stored procedure executes too long

We use SQL Server 2008. When I am watching in SQL Server Profiler I found some queries that take for example 20 seconds. The same query (in a stored procedure) when executed in SQL Server Management ...
8
votes
1answer
4k views

Is it possible to create an alias or synonym for a database?

Is it possible to create a database alias or synonym? What I am hoping to be able to do is have NewDatabaseName aliased as OldDatabaseName to prevent having to rewrite a ton of code. Backstory: I ...
2
votes
1answer
136 views

Is execution of synonyms not logged in target database?

I've been working on an issue where a single select within a stored procedure failed due to permission-issues, and we traced it to a call to a Synonym: USE DatabaseA GO CREATE SYNONYM ...
1
vote
1answer
1k views

SQL-Server: sp_spaceused gives zero rows but big dataSize for cleaned table

After cleaning my table with DELETE FROM MyTable (and executing DBCC shrinkdatabase('MyDB') should that matter) I run the statement EXEC sp_spaceused MyTable. The results confuse me: tableName ...
0
votes
1answer
3k views

Run SQL Server Snapshot Agent automatically

I am trying to setup automatic transactional replication. Basically I have some script files that are executed after each other. They set up a replication from one server to another and this works ...
4
votes
2answers
1k views

SSAS queries time out when Windows File System Cache drops

We have a SQL 2008 Analysis Services instance on Windows 2003 that is experiencing near-daily performance issues (query timeouts) during peak activity. A second identical instance queried from the ...
4
votes
2answers
138 views

Are my Indexes Being Used?

I am using SQL server, and the person creating our database added lots of indexes on our biggest table. These indexes only include one field each. To me it seems that these indexes are mostly ...
2
votes
2answers
5k views

Reducing Key Lookups

I am using SQL server, and I have been looking closely at the concept of key lookups, ...
0
votes
2answers
193 views

Cant connect to Server using SSMS on my desktop

SQL SERVER 2008 R2 When attempting to connect to the default instance of sqlserver on our local server from SSMS on my desktop I'm receiving the following error. A network-related or ...
0
votes
1answer
877 views

What privileges do I have to grant to allow a user to select from information_schema.table_privileges?

I'm using MS SQL Server 2008, and I am trying to get a complete listing of all privileges assigned to all grantees by running this query: select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES However, ...
1
vote
0answers
513 views

DBCC CheckDB Consistency error on an empty table [duplicate]

I restored a DB from SQL Server 2000. I ran DBCC CHECKDB on SQL Server 2000, and it did not report any errors. What could be the reason behind a DBCC CHECKDB reporting a consistency error on a empty ...
1
vote
2answers
4k views

Can't connect to/from SQL Server 2008 from my Windows 2008 server

I have a server with: Windows 2008 Server SQL Server 2008 enterprise From my server using SQL Server Management Studio, I can't logon to any SQL Server and vice verse, I can't connect to my SQL ...
1
vote
2answers
2k views

SQL Server 2008 - Log file out of control & cant shrink it [duplicate]

Possible Duplicate: Why Does the Transaction Log Keep Growing or Run Out of Space? I am having trouble with my database, the log files is currently 250GB in size, I need to shrink this down ...
2
votes
2answers
2k views

SQL Server 2008 simple recovery mode issue

During my daily maintenance backup task, I am attempting to set specific databases to recovery model simple along with shrinking the database. ALTER DATABASE db_name SET RECOVERY SIMPLE GO DBCC ...
4
votes
4answers
911 views

What's the equivalent of --safe-updates of mysql in MS SQL Server?

In MySQL, you can use the feature called --safe-updates (--i-am-a-dummy) to limit the number of rows updated per query. http://dev.mysql.com/doc/refman/5.0/en/mysql-tips.html#safe-updates Is there ...
16
votes
4answers
12k views

Should dbo schema be avoided?

When it comes to the dbo schema: Is it a best practice to avoid using the dbo schema when creating database objects? Why should the dbo schema be avoided or should it? Which database user should own ...
5
votes
3answers
207 views

How to monitor how much data is transfered in a linked server?

I have a linked server to a remote computer and doing some insert, update and delete operations between local and remote databases. I want to know how much data is transfered when operation is doing. ...
0
votes
2answers
856 views

In SQL Server 2008, is possible to one database subscribe 2 publications for the same database? (merge replication)

I'm trying to set up an high availability architecture using merge replication. I have 3 databases, and I'm trying to keep them all up to date with merge replication. So far I've manage to create one ...
1
vote
1answer
322 views

Is my case statement broken by the use of outer apply?

I'm struggling with a case statement not working. Simple enough I need to supply a value of 0 where the question marks are. I have several other case statements which handle separate columns, but this ...
4
votes
2answers
2k views

Can I have different publishers and one subscriber in replication?

I have the same databases in three cities which each database have three tables: 1- tbl_worker 2-tbl_workshop 3-tbl_users and cities are:city1,city2,city3 city2 and city3 insert informations in ...
1
vote
1answer
805 views

Can't run query using “localhost\sqlexpress”

I am trying dynamically build an SQL Statement that includes linked server. That works. When I use "localhost" to reference the current local machine SQL Server, that doesn't work. For example: ...
2
votes
2answers
2k views

How To Restore A Replicated Database

I am replicating our live database using transaction replication. This is basically to have a backup copy of our database in the case of server failure. The replicated database is read only, so I ...
3
votes
1answer
267 views

Does blocking always mean open transaction?

This may seem a bit dull question but does blocking always mean that there is open transaction and that may cause transaction log grow to infinity because open transaction prevents log truncation ...
1
vote
1answer
343 views

How to take Snapshot of Restoring Database

I have set up log shipping with my database to make a backup. The backup copy of the database is in a status called '(Restoring...)'. I understand this is to be expected? Is there a good way I can ...
6
votes
3answers
24k views

Read XML file in SQL Server 2008

How can I read an XML file and store the data in XML to our table in SQL Server 2008?
3
votes
1answer
580 views

SQL Globalization - DateTimeOffset

What is the recommended best practice when it comes to storing date/time for an application that needs to support multiple timezones? Which is best ? Use the SQL DateTime data type and insert ...
5
votes
1answer
8k views

How to find the date a login password was last changed in SQL Server 2008?

I'm porting stored procedures from Sybase 15 to SQL Server 2008. In Sybase this statement calcs an expiration date by adding a number of days to syslogins.pwdate (Date the password was last changed) ...
3
votes
1answer
321 views

How Commit works in a transactional push replication with updatable subscribers

I want to know if in a transactional push replication with updatable subscribers, a commit is only done when all subscribers have succeeded to make it, or if it only guarantees the correct commit in ...
3
votes
1answer
10k views

Why TRY CATCH does not suppress exception in trigger

I have a trigger on a table (source) that data should be copied to the other one (target) in other database. I am trying to implement custom synchronization process for data: I want that target ...
6
votes
1answer
555 views

How to back up a small database in SQL Server 2008 R2 Express Edition

I will shortly be migrating a database from SQL Server 2000 (part of SBS 2003) to SQL Server 2008 R2 Express Edition The database is small, and there are only a few hundred short transactions per day ...
2
votes
1answer
151 views

What is the Server name for SQL Server2008?

I have sucessfully installed the Microsoft® SQL Server® 2008 Management Studio Express from the following link: http://www.microsoft.com/download/en/details.aspx?id=7593 file name: ...
2
votes
5answers
2k views

Setting up a Redundant Sql Server 2008 Configuration While Retaining High Performance and Minimal Downtime

We have a situation where we are moving to a new hosting facility and are attempting to configure our new database environment. However, none of us are formal DBA's so a lot of what we are doing is ...
5
votes
3answers
1k 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 ...
1
vote
2answers
167 views

CTAS with clustered index on SQL Server

Is it possible to create a table with a clustered key from a query in a single step or do I have to do this: select 1 as id into foo; create unique clustered index pk_foo on foo(id)
4
votes
3answers
117 views

Is it much more expensive to use procedures that get lists and deriving a count in the application vs. a separate stored procedure for the count?

I would like to know if returning a count is much more expensive than returning a dataset in regard to processing performance? I assume there is a bandwidth increase in delivery to the application ...
2
votes
2answers
325 views

How do redundant indexes impact query performance?

The indexes are affecting the ADD/UPDATE operations however I was wondering whether the redundant indexes will affect the SELECT query performance or not? How the redundant indexes are handled by ...
5
votes
3answers
3k views

Is there a way to see the access log of a table?

I am using MS SQL Server 2008. I have a table in a database, in which records are being inserted and deleted. E.g. Initially the table is empty. A Java program (probably) inserts few records in it. ...
1
vote
2answers
2k views

How can I check the status of transactional replication?

How can I check if there are commands waiting for being executed in the subscribers and find if there is any error occurring in my publication. I want to be able to do this programmatically so the ...
0
votes
1answer
434 views

access 2003 to sql server 2008

I search a way to export an access 2003 database to sql server express 2008. the export is on la (other computer than the server). the computer have office 2003. the computer doesn't have admin ...
0
votes
1answer
286 views

SQL logs filling up with “Setting database option Compatibility_Level” messages

On several of my servers, I have "Setting database option Compatibility_Level" messages filling up the SQL log and application event log to the tune of twice every 5 seconds. This makes finding ...
0
votes
1answer
775 views

check if linked server table column exists

I have several access databases that I'm copying over to the sql server, connecting to as a linked server, and then pulling data from each night. I need to be able to identify if the current access ...
2
votes
1answer
2k views

Meaning of SSMS database icon preceded by scroll with red x

SSMS 2008 R2, connecting to a 2008 instance shows the above glyph in SSMS Object Explorer. None of our other instances show that icon. I've moused over it in the vain hopes that I'd get a useful ...
0
votes
2answers
189 views

Can You Access A Replication Database

I am using SQL server 2008 R2. I have a live database, and a replicated copy of that live database on a different server. It is using Transactional Publication replication. When I take our software ...
10
votes
2answers
2k views

How large is “too large” for SQL 2008 Web Edition?

For our soon-to-be-hosted application I need to choose between SQL Server 2008 Web edition and SQL Server 2008 Enterprise edition. There isn't any "must-have" functionality: the application currently ...
5
votes
1answer
106 views

Possible pitfalls of condensing 2 SQL Server instances into 1

I currently have 2 SQL Server 2000 database instances (each running on a different physical server), each containing around 12 databases (not all are active). We are planning an upgrade to SQL Server ...
2
votes
1answer
271 views

Why are views not copied over when using SQL Server Log Shipping?

I have 2 Sql Servers (2008) with Log Shipping setup between them. The receiving server is configured to keep the database in Read-Only mode. When creating a view on the primary server, this view is ...
2
votes
2answers
2k views

SQL Server 2008 R2 SQL Server has encountered x occurrence(s) of I/O requests taking longer than 15 seconds to complete on file '

When I alter or create a stored procedure directly on production or QA database, after a few seconds I start experience timeouts and application becomes unavailable. Log files shows this error: ...
2
votes
2answers
240 views

SQL aliasing to redirect traffic between databases on the same server

In order to upgrade a database with no client disconnects, I clone an existing database and put it in a readonly mode. Now, I want all user traffic to be redirected from the original database to the ...
1
vote
0answers
1k views

Problems with cross forest authentication in SQL Reporting

We're currently running an SQL 2008 R2 Cluster with Reporting Services running, all for use with System Center Operations Manager 2007 R2 (RU3). Our users are on a different domains to the SCOM and ...
1
vote
2answers
3k views

Print database_size from sp_spaceused

Using SQL Server 2008, I have found that the database size can be obtained using exec sp_spaceused This procedure returns two tables: database_name | database_size | unallocated space reserved | ...