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

learn more… | top users | synonyms (1)

6
votes
1answer
3k views

Why do we need to rebuild and reorganize Indexes in SQL Server

After searching the internet i couldn't find the reason for Why do we need to rebuild and reorganize indexes in SQL Server ? what does internally happens when we rebuild and reorganize ? An ...
2
votes
1answer
51 views

Restoring Differential Backups

Is it possible to restore a differential backup separately? The production server runs the following every sunday DECLARE @Pathname VARCHAR(512) = 'N:\Backup\Dir\DBName_' + (select ...
4
votes
2answers
4k views

How to apply a theme to SQL Server Management Studio 2008?

Has anyone had any success with, for example, applying a 'dark' them to the Text Editor component of of SSMS 2008? There was an old trick for 2005 which is no longer operational and has not been ...
1
vote
3answers
355 views

How to calculate exact month (in days) difference b/w two dates

I am trying to get all the rows where the visit date was exact before five months from to date but somehow DateDiff function is including 26th Sept 2013 record which is not right as five month has ...
0
votes
1answer
28 views

An SQL Server 2008 R2 based program fails when updating stored procedures?

I'm trying to update MIP software and one of the "companies" fails while it is updating a stored procedure. Is there any place in SQL Server 2008 R2 / Windows where I could see an error message ...
0
votes
1answer
88 views

T-SQL Optimizing a Join on TOP Value from another table

I've got a data warehouse that goes through a full refresh each night that can take about an hour to process 16 million rows/25gigs of data and we're looking for ways to reduce this time without going ...
-2
votes
1answer
28 views

can exec work with while loop of cursor? [duplicate]

Declare @var varchar(200) set @var='select max(val) from floattable' declare c1 cursor for select id from floattable declare @val int Fetch next from c1 into @val open c1 while @@Fetch_Status=0 ...
1
vote
1answer
596 views

SQL Server 2008 server cannot connect to itself with alias name or “localhost”

We have a SQL Server 2008 ENT 64bit SP3 server running Server 2008 R2 Standard SP1 64-bit. This is also a windows/sql clustered environment. There is the cluster alias for the server, and then we ...
0
votes
0answers
21 views

SQL Server 2008 server cannot connect to itself with alias name or “localhost” [duplicate]

We have a SQL Server 2008 ENT 64bit SP3 server running Server 2008 R2 Standard SP1 64-bit. This is also a windows/sql clustered environment. There is the cluster alias for the server, and then we have ...
1
vote
1answer
109 views

Does MAXDOP affect the number of tempdb data files I should create?

From what I have read, best practices for configuring tempdb includes creating multiple data files. The rule of thumb as I understand it is if you should create the same number of data files as you ...
1
vote
0answers
29 views

SQL Server Full-Text Index with Stoplist

I've searched this site and the internet in general and can't find any information which answers my question, so I thought I'd post it here. I have Full Text search operating on a database in SQL ...
1
vote
1answer
1k views

The Cluster service failed to bring clustered service or application 'SQL Server (MSSQLSERVER)' completely online or offline

SQL Server service restarted/stopped, which cause the production database down n find this errors in System log. ERROR5:The Cluster service failed to bring clustered service or application 'SQL ...
1
vote
1answer
3k views

Full and differential restore with two backup files - SQL Server 2008

We are trying to establish a maintenance plan with 2 separate backups. One full backup over the weekend and differential backups through the week. [the differential backup has a "_diff" appended to ...
1
vote
1answer
372 views

Best Format to Bulk INSERT/UPDATE Data to SQL SERVER using C# [closed]

Can anyone tell me what is best way to bulk insert/update data to SQL SERVER 2012 using C#? I have an excel file which I am passing as TVP(table value parameter) to a SP. But this is little bit ...
0
votes
1answer
43 views

Sql Server Full Backup Duration Increased Dramatically

since last week My Full Backup Increased dramatically .before last week the time is about 3 hour and now the time is about 6 hour.in addition some query take long time to run. (not all the query).I ...
0
votes
2answers
242 views

Generic SQL Job Scheduler for multiple RDBMS's?

I have been searching for an answer to this, but can't seem to find anything. So my problem is this - we have an environment with MS SQL Server 2008, MySQL, and RedShift, and have some complex ...
7
votes
1answer
119 views

Necessary to include clustered index columns in non-clustered indexes?

Considering that a non-clustered index is based on the clustered index, would it be necessary for the non-clustered index to list any of the columns contained in the clustered index? In other words ...
2
votes
1answer
65 views

Database Design guidance required

I have scenario where there is Table T with columns PK,A, B, C,D TABLE t ( PK, A, B, C, D ) i have to insert data from different sources ie columns A,B,C,D are calculated separately.. and they same ...
11
votes
4answers
19k views

How to add sysadmin to user in SQL Server 2008 when no sysadmin accounts exist

I have a SQL server 2008 instance running. Unfortunately during testing I deselected the sysadmin rights for my login and now can't readd it (because I don't have sysadmin rights). There are no other ...
0
votes
2answers
286 views

Cannot see Green Button with white arrow in object explorer; DTC config problems?

I have SQL Servers across locations setup for replication. One of the SQL Server instances that I installed, running locally I can see the green button with the white arrow in the object explorer when ...
2
votes
1answer
166 views

TempInsertStateItemShort procedure on ASPState is taking more than 1 second to execute

I'm working on a .NET website who runs in load balance within more than one server and because of that I need to have my session on SQL Server. In the last 2 weeks I've notice that the procedure ...
3
votes
2answers
2k views

Error Querying MySQL server linked to SQL Server 2008

I've created a linked server in MS SQL Server 2008 to a remote MySQL server. When I try to query any tables, I get an error: .tablename. contains no columns that can be selected or the current user ...
3
votes
1answer
71 views

How can a blocking_session_id be negative?

I have a case where a query I'm running is taking a long time. When I checked sys.dm_exec_requests the blocking_session_id is a negative value, -2 to be specific. The wait is a LCK_M_X and the ...
5
votes
4answers
16k views

Writing select result to a csv file

We need to write the SELECT query results to a csv file. How can it be done using T-SQL in SQL Server 2008 r2? I know that it can be done in SSIS, but for some reasons, we don't have this option. I ...
3
votes
0answers
90 views

SQL Server 2012 Resource Governor and memory used by CLR

In SQL 2012 memory used by CLR is now part of what is controlled by "MAX Server Memory" a) Does Resource Governor in SQL 2012 Enterprise (MAX_MEMORY_PERCENT for resource pool) governs CLR memory? ...
0
votes
1answer
70 views

Installation SQL Server 2012 - “Ready to Install” page missing

I need to create config file, so I could install sql server from cmd. I need basic server installation so I've downloaded SQLEXPR32_x86_ENU I need to go through whole installation process til page ...
2
votes
3answers
2k views

Date format in SSRS

I'm wondering if there is a setting in SSRS to indicate the date format. We need to show the dates in dd/mm/yyyy format on the reports and from what I can see in database the value has been stored ...
1
vote
1answer
41 views

1 time shrink of abused databse or restore from backup [duplicate]

I have a database that I have inherited which has been left for a long time to grow and grow. 95% of this growth is caused by 1 log table used by our application. The database is 120GB and in full ...
1
vote
1answer
73 views

SSIS v/s Replication v/s logshipping

I have 2 SQL server instances, on different servers. One is Production instance and gets lots of reads and writes daily. Another one is for external applications to use a copy of few of the tables ...
1
vote
2answers
6k 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 ...
5
votes
1answer
2k views

Mirroring - Server network address cannot be reached

I have SQL Server 2008 R2 Installed. It contains three instances. Default (MSSQLServer) FirstInstance SecondInstance All these are Log On as Network Service.. Default Instance is Principa ...
5
votes
3answers
12k views

How do I get a list of all the partitioned tables in my database?

How do I get a list of all the partitioned tables in my database? Which system tables/DMVs should I be looking at?
0
votes
1answer
34 views

Does a filtered index improve searching on the opposite condition?

Does having a filtered index on a column improve queries with a WHERE clause that is the opposite of the filter condition? Since the filtered index specifies what not to return, does it reduce the ...
0
votes
1answer
44 views

Having Issues Exporting to online SQL Server database [closed]

I successfully initiated the export wizard of Microsoft SQL Server 2008 Studio and it was exporting fine from the database on my PC to online server database. But suddenly my internet network went ...
0
votes
1answer
67 views

Scheduled copy of large table from SQL Server 2000 to 2008

I have a table on SQL Server 2000 with 10 million records and 20 columns. The table is rebuilt once a day and is essentially a reporting table, not a transactional table. Of the 10 million records, ...
1
vote
1answer
60 views

How do I find out if Sql server Agent's login has rights to a DB?

How do I find out if the SQL server Agent's login has rights to the target DB, that is the DB on which I will be executing a query ? Also, how do I find the service that's controlling Agent on the ...
3
votes
2answers
223 views

Replacing master.dbo.sysperfinfo with sys.dm_os_performance_counters

I'm working with some old code that pulls performance counters, and part of what I'm doing is making sure we're doing some processes efficiently and effectively. Right now I have this code that I'm ...
2
votes
1answer
456 views

Using a linked server with OPENQUERY in a database project

I have a SQL Server 2008 running a database I want to throw in TFS. Therefore I used a Visual Studio 2013 database project where I imported the DB. After fixing a bunch of errors I'm stuck with only ...
1
vote
2answers
40 views

what's result for sql server log backup twice? [closed]

If I have a sql server database mydb. Then I run a transaction log backup at 12:00pm. Then run the transaction log backup(either full or differential) again at 12:30pm. what's result for the second ...
3
votes
1answer
101 views

Downgrade database from SQL Server 2012 to 2008 [duplicate]

Hi guys got a problem with a database. I've been asked to perform some indexing and delete queries on a live database, so first of I wanted to get the database to our dev server so I can test out ...
17
votes
3answers
4k views

Parameter Sniffing vs VARIABLES vs Recompile vs OPTIMIZE FOR UNKNOWN

So we had a long running proc causing problems this morning (30 sec + run time). We decided to check to see if parameter sniffing was to blame. So, we rewrote the proc and set the incoming ...
1
vote
1answer
84 views

Can geography datatype Lat/Long properties be returned using a view in SQL Server 2008?

Hopefully the question is fairly self-explanatory. I've been ferreting through the, what appears to be quite minimal/poor microsoft documentation regarding both views and geography datatypes in the ...
2
votes
1answer
52 views

What is happening with locks in my database?

I'm having some problems on my database. At any given time, I'm trying to execute an update with five records on my table, but this table is locked and I get a time out executing the query. I ...
0
votes
1answer
90 views

How to create a trigger that update the date and time field and modify of the row

I want to create trigger that will update the record. The situation is like: I have one column named CheckInDateTime and one more named Status. If the administrator is not able to update the Status ...
2
votes
1answer
47 views

Suppressing the SSMS prompt to save changes

Is it possible to configure SQL Server Management Studio (SSMS) so that the dialog box shown above does not appear when I close an unsaved query window?
0
votes
1answer
96 views

Help with Transferring Linked Server to another server?

Please advice me as I'm trying to move the linked server (Providers with the tables in Catalogs) from SQL server 2005 to another upgraded sqlserver 2008, I scripted out everything from there, but not ...
0
votes
0answers
66 views

Detecting changes in a table without enabling CDC [closed]

We are doing a transaction based on a weekly basis, where the first transaction is recorded on 1-Jan-14 in the table a. Subsequently, the second transaction that was done on 8-Jan-14 also got ...
4
votes
1answer
252 views

Move values from one table to another one via stored procedure in sql server 2008

I have two tables Login (userid, username, password) audit_login (userid, Transaction_Date, Status (success or failed) Now I want create a stored procedure in which, if anyone wants to login then ...
1
vote
4answers
7k views

How to create and send mail in SQL Server 2008?

I want to send E-mail from SQL Server 2008. What are the basic steps for that? Can you explain me if someone used this facility. Any help will appreciated. this link will helpful as commented by ...
2
votes
2answers
90 views

Similar Products with bitwise

I have the following tables. So one product can have one category, one category can have n genres.(Products-> Genre Column data 6 ( 2 + 4), 132 (128 + 4) like that). So my question is; i want to ...