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

learn more… | top users | synonyms (1)

2
votes
1answer
54 views

Moving Clustered Index to new filegroup results in excessive filegrowth

I've Moved the clustered index on large tables to new filegroups to defrag, compress, and to recover space more easily from the original "primary" filegroup. Problem: A 315GB compressed Clustered ...
3
votes
1answer
498 views

Backing up file groups with restore to earlier backup

I have a task: I have created a database with a filegroup lamb that has a few tables. I need to extract a csv into a table in a filegroup named lamb and back up that filegroup. Then extract another ...
1
vote
2answers
355 views

Adding Data to Multiple Tables Using Single Query [closed]

I want to add data to multiple tables using a single INSERT INTO query, can I do this? Please guide me and provide me syntax if this is possible.
0
votes
0answers
32 views

SSIS - the 1st item in the data flow package view always imports way slower than the others

In the SSIS data flow task, I've been importing CSV files to my SQL Server via Flat File Source -> OLE DB Destination. When I'm setting things up in the package design preview, if I have just one ...
1
vote
1answer
41 views

Get data per Customer and per Date

How will I get the all the date even though there is no order between two dates? Sample Table OrderID | Date | CusID 33942 | 6-21-2014 | 6005 34059 | 6-20-2014 | 4003 53333 | ...
3
votes
2answers
3k views

Connect to SQL Server 2012 from an Windows XP client

We have an SQL Server 2012 Standard database, to connect to it we use SQL Server 2008 Management Studio (since 2012 SSMS is not supported on Windows XP). The problem is that SQL Server 2008 gives all ...
8
votes
4answers
10k views

How to detect any changes to a database (DDL and DML)

There are a lot of databases on my client's sql server. In common, these databases is under development, so developers can design, refactor, do data modifications and so on. There are some databases ...
1
vote
0answers
42 views

How do I analyse DBCC Showcontig of a table? [closed]

Can somebody help me how to analyse the DBCC SHOWCONTIG output for a table. Before: Table: 'table1' (795); index ID: 0, database ID: 7 TABLE level scan performed. - Pages ...
0
votes
2answers
13 views

SQL Server Management Studio is not available

When I installed SQLManagementStudio_x64_ENU.exe I am not able to connect to my server. In the image (1) session, I am not getting server name. Also in (2) session also I am not getting it. Is there ...
3
votes
3answers
2k views

Sql Server 2008 R2: Simple recovery model with transaction log backups

I'm busy reviewing my SQL Maintenance plans and I'm a bit confused with the recovery model option on the databases, specifically related to point in time recovery. Here is my scenario: I have two ...
0
votes
1answer
59 views

UPDATE not working properly with linked server

Please see a question I asked here earlier: http://stackoverflow.com/questions/24324823/update-not-working-properly-with-linked-server Dommer suggested using OPENQUERY and this does appear to resolve ...
0
votes
0answers
19 views

Check if any user uses a database? [duplicate]

I'm going to drop a database. I want to monitor if any user is still using the database for a couple of months. Besides profiler, is there a better way to monitoring activities on a database?
1
vote
2answers
48 views

Making a Database Online [closed]

I am so confused with this issue, I have vb.net application and it has a sql database . Now, I want this application to access the sql server from anywhere , because there are many clients sharing ...
1
vote
0answers
42 views

Stored procedure taking much longer than query [closed]

I have a simple code segment that runs in about 1 second when run alone, but more than 5 minutes when deployed as a stored procedure. I'm using sql server 2008. Unfortunately, I can't post the code ...
6
votes
2answers
4k views

SQL query slow-down from 1 second to 11 minutes - why?

Question: I'm porting the below query (listing tables by foreign key dependencies) to PostGreSql. WITH Fkeys AS ( SELECT DISTINCT OnTable = OnTable.name ,AgainstTable = ...
1
vote
2answers
46 views

How to get the first or last row in ordered result set, depending by column value?

I have the follwoing result set from the table PUNCHREPORT EMPLID Name PUNCHDATE PUNCHTIME DEVICETYPE .................................................................. 70 ...
0
votes
1answer
68 views

how service sid operate under the covers?

This question is out of curiosity and it left me in confusion whether service account as any role to play in sql server startup and shutdown? Can anybody explain how sql server 2008 Service Sids work ...
1
vote
1answer
23 views

Security access to a table

I have a database and table dbo.Test_Table, with list of Users under Security -> Users. those users have access to all the tables in my database. I would like to know how do I assign certain users to ...
0
votes
0answers
16 views

SQL Server 2008 database is not coming online after restore.. Pleae need help asap

I have restored a 1TB database and now it shows the restore completed 100% but the database is not accessible. sp_who2 has a SPID 50 performing this restore but current command its showing is ...
0
votes
0answers
22 views

Reducing log files? [duplicate]

I have a database that has a log file of nearly 80 GB. Database size 180 GB. The recovery is set to Full. What is the correct way to shrink the log file without using the shrink option in SSMS as ...
4
votes
1answer
112 views

Table Data Space Used Confusion

I have a heap table with around 700k rows. The rowsize is 34 bytes: (1x BIGINT, 2x SMALLINT, 2x BIT, 4X INT, 1x SMALLDATETIME). Why does Data Space Used say this table is taking up nearly 4000000KB ...
2
votes
2answers
45 views

What does Reinitialize All Subscriptions actually do to the databases

I tried to find the answer and came across these MSDN pages but they don't actually explain what happens really: http://msdn.microsoft.com/en-us/library/ms152771.aspx ...
2
votes
2answers
7k views

IntelliSense not working but it is enabled

This problem is really proving to be a tricky one (and quite annoying). In SQL Server Management Studio 2008, up until a few days ago my IntelliSense was working great. Then all of a sudden it ...
5
votes
2answers
872 views

Sql Server Management Studio for 2008 Express?

I just installed Win7 on a fresh laptop and want to put a lightweight MS Sql Sever on it. VS2010 already installed SS2008 Express. So now I just need a management studio for it. What would you ...
6
votes
2answers
2k views

Is it possible to get execution call stack in a trigger?

I have 10 stored procedures and each of them does INSERTs into one tableX. Is it possible in a trigger body of tableX to get what object causes modification of tableX (stored proc1 or sp2 or....) ? ...
5
votes
1answer
473 views

SQL Server: How can I read server-side traces with limited permission?

I am trying to set up a trace on a remote server. I am able to generate the trace, set filters, and even stop and delete the trace through sql server without an issue. However, the file created with ...
3
votes
2answers
613 views

Querying Extended Events in SQL Server 2008

I have created the following event session using a script I got from Kimberly Tripp's SQL Server 2008 Internals book. It has been modified to send to a file instead of the ring buffer. CREATE EVENT ...
2
votes
3answers
1k views

How to recover the suspect mode database in SQL Server 2008?

To recover the database from suspect mode executes the following query. EXEC sp_resetstatus ‘yourDBname’; ALTER DATABASE yourDBname SET EMERGENCY DBCC checkdb(’yourDBname’) ALTER DATABASE yourDBname ...
13
votes
4answers
13k views

Logical operators OR AND in condition and order of conditions in WHERE

Let's examine these two statements: IF (CONDITION 1) OR (CONDITION 2) ... IF (CONDITION 3) AND (CONDITION 4) ... If CONDITION 1 is TRUE, will CONDITION 2 be checked? If CONDITION 3 is FALSE, will ...
-1
votes
3answers
6k views

Where to download SQL Server 2008 R2 Enterprise Manager? [closed]

If SQL Server 2008 R2 Enterprise Manager(Not SQL Server Management Studio) free? where to downland it? Or it only for SQL Server 2000 and replaced by SQL Server Management Studio for later version?
2
votes
0answers
39 views

Constrain referenced rows to two different tables to belong to the same row in another table

Apologies for the potentially confusing question title. I struggled to make it generic! I am designing a wildlife recording database. An observer goes to a site and records the occurences of species ...
1
vote
3answers
7k views

No Maintenance Plans Folder in SQL Studio 2008 R2

A client has SQL Server 2008 R2 installed on a Windows 2003 R2 32-bit server. Under Management in SQL Studio 2008 R2, there is no maintenance plans folder. It is not under Management --> Legacy ...
-1
votes
1answer
35 views

combining two CTE in a single query

Here i have two CTE and i need to select values from these two CTE as a single query. I can able to select values from a single CTE at a time but i dont know like how to merge these two CTE and select ...
1
vote
0answers
35 views

Why is one of these queries orders of magnitude slower than the other?

Sorry for the vague headline question. Essentially, and I know this is generally terrible practice, but I have query with nested subqueries as follows: SELECT * FROM ibt1 WHERE basetype = 60 ...
0
votes
1answer
55 views

getting error incorrect syntax near @certificate

I have created a certificate and now I want to remove certificate signature and drop the certificate. When I supply the certificate name directly it is working but when I'm making use of local ...
5
votes
2answers
3k views

SQL Server 2008 R2 SP1 - Tempdb “Available free space” showing negative value

Please help as this issue is driving me nuts... Tempdb has four data files & one log file. They are all located on the same dedicated drive. When I right click on tempdb in SQL Server Management ...
0
votes
1answer
81 views

How to get the nTH row in ordered result set?

I have the follwoing result set from the table PUNCHREPORT EMPLID Name PUNCHDATE PUNCHTIME DEVICETYPE .................................................................. 70 ...
0
votes
1answer
73 views

How to restore Network backup to Network Path in SQL Server 2005?

I am trying to restore network backup file to network path.. is there any way to do it? I am using SQL Server 2005 and code.... RESTORE DATABASE DB_NAme FROM DISK = ...
0
votes
0answers
68 views

SQL Server : delete user to make it “dbo”

I want to set one of the Active Directory users I have in my database as the owner of the database. But I know this user is used on many scripts and Excel pivot tables. Now if I delete the user from ...
4
votes
1answer
346 views

How does order of index affect performance in SQL Server?

I am wondering how does order of index affect performance (ASC, DESC) ? If it affects, why ? And which order should I choose ?
6
votes
3answers
3k views

Attempt to fetch logical page (5:65424) in database 2 failed

I am getting following SqlException on calling a stored procedure - Attempt to fetch logical page (5:65424) in database 2 failed. It belongs to allocation unit 7349876362857938944 not to ...
0
votes
2answers
108 views

Error while taking backup in SQL Server

Before few month box of SQL has been crashed. We have almost database back with some tools and running application smoothly on it. But when i try to take backup of database at that time it gives error ...
1
vote
0answers
224 views

Possible schema corruption. Run DBCC CHECKCATALOG

Good Evening to all. I was working with sql server 2008. Thing i did: Actually i was noticed that the free space available in C drive reaches below 1 GB .So i thought to Club the D drive with C ...
7
votes
4answers
289 views

How can I know which store procedure or trigger is using a table on SQL Server 2008 R2?

This is the case that in the DB I'm checking, there is an archive table which keeps the user history, and there is a trigger or store procedure that after some time delete rows from this table, in ...
1
vote
2answers
43 views

SQL Server Backup and Query Execution

Is SQL Server Backup affects the query execution performance? Is there an effect while running the SQL Server backup in remote query execution? Thanks.
3
votes
1answer
1k views

“Prelogin failure” when attempting to run stored procedure across linked server

I'm getting the below error when attempting to run a stored proc across a linked server that is going from Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) to Microsoft SQL Server 2008 (SP2) - ...
2
votes
1answer
152 views

Database deployment script for SQL Server 2008 has different behaviors

Using Visual Studio 2008, I have compared schemas between remote SQL Server database with scripts hosted in a TFS server. The goal was to generate a migration script that would update the remote ...
1
vote
1answer
5k views

How do I remove a SQL Server 2008 instance from command prompt w/o removing the server?

I want to remove a SQL Server 2008 instance (just the instance, not the server). I know how to do it in SQL Server 2005, its "C:\Program Files\Microsoft SQL Server\90\SetupBootstrap\setup.exe" /QUIET ...
1
vote
4answers
3k views

Attaching MDF without LDF

I only have an .mdf file of my database which is not attaching. I am using the following command: EXEC sp_attach_single_file_db @dbname = 'Test_Data', @physname = N'D:\Test_Data\Test_Data.mdf'; ...
-4
votes
1answer
27 views

Data type in SQL Server 2008 [closed]

If I want to store both values in single variable means in 'days' variable, it should accept 1 day as well 1.5 days. In this case which data type i should use in sql server 2008? Thanks in ...