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

learn more… | top users | synonyms (1)

2
votes
2answers
296 views

Table with 4 million records - different size and performance in development and production

At my company we use SQL Express 2008 R2, which supports databases up to 10GB. We have 2 databases with almost the same number of rows in all tables. But, one of them is 4.5 GB in size (which is in ...
2
votes
2answers
291 views

Migration to databases Domain Users do not have access

I migrated databases to new servers, however the applications that were previously used with the databases are failing to load. I have changed the connections and etc. The jobs also seem to be ...
1
vote
2answers
74 views

How to get statement which causes error 3609?

How to find out which statement causes error Msg 3609, Level 16, State 1, Line 4 The transaction ended in the trigger. The batch has been aborted.? The code seems very straight-forward: -- 1. Check ...
1
vote
2answers
71 views

Auditing the View Server State permissions on Server

We noticed that one of our servers has permissions granted to "all" users for "view server state". I am wondering if there is a way to audit the DMV's used by the user(s) on a regular basis as this ...
1
vote
2answers
61 views

Defragmentation of Indexes - Higher value after defragmentaion

I am trying to defragment indexes on SQL Server 2008 using ALTER INDEX--REBUILD. After defragmentation some indexes have fragmentation percentage value greater than its before defragmentation value. ...
1
vote
2answers
404 views

Log shipping - switchover and failback

We are doing a planned failover and switch back from the primary to DR with mirroring. We do not have a separate monitor instance. Please help me with the following 1. Is it possible to switch back ...
1
vote
2answers
168 views

Improving a search query

I have a query for search function. Basically search function allowed user to define what they "have" and "want". Then this query will filter out all the possible result which created by other user. ...
1
vote
2answers
541 views

Need advice on abnormal login auditing

Recently i am facing some slow issue for my web application. And i have check my visitor report and it shows normal traffic rate as usual. And then i check my db login auditing and find below login ...
0
votes
2answers
42 views

Is there anything wrong with creating a very large log file?

I've been given the task of finding out why our server is slow. First of all I did not set this server up. Is there anything wrong with setting the initial log file size to 70GB? That's what ours is ...
0
votes
2answers
40 views

Error with making backup in sql Server

We have a win server where installed sql server 2008. When I try to backup database, I have an error. Is anybody know what is the error? TITLE: Microsoft SQL Server Management Studio ...
0
votes
2answers
73 views

How to choose suitable naming convention for Dimensional Table Column in a Data Mart?

I have done a lot of reading on naming columns for use in a data mart / data warehouse, as well as for general programming usage. For example, if I had a business branch in a normal application I ...
0
votes
2answers
176 views

can we transfer sql database backup from one server to another server directly?

I want to transfer sql database from one server to another server directly, instead taking back up of that database and copy that back up in another server and then restore it. Please tell me, Is ...
0
votes
2answers
132 views

How to provision the SQL Server Agent service after SQL Server Edition upgrade

I have upgraded SQL Server 2008 R2 Express to SQL Server Standard Edition. After I have upgraded it, the SQL Server Agent was stopped. I have tried to start but it fails. Only when I have changed ...
3
votes
1answer
339 views

SQL Script to Drop old AD logins, Inactive SQL Logins and all related Users

Related Question: SQL Server script to delete accounts no longer in Active Directory Whilst the above question points out the rather handy sp_validatelogins procedure, i'd like to extend this ...
3
votes
1answer
82 views

Simple method to setup SQL Server for development access

I've created a virtual development box and installed SQL Server 2008 with mixed authentication. Then I connect to SQL Server via SQL Server Management Studio using my Windows account but when I try to ...
3
votes
1answer
167 views

Updateable Subscriptions: Rows do not match between Publisher and Subscriber

I have transactional replication with updatable subscribers set up in SQL Server 2008. It has 3 subscribers and 1 publisher. I had to setup replication again due to some errors related to the database ...
3
votes
1answer
469 views

SQL Server Troubleshooting Replication and Long-Running fn_dblog query

I am trying to get (pull) Transactional Replication working again for a subscriber. Currently, in Replication Monitor I am seeing messages in the Publisher to Distributor tab and the Distributor to ...
1
vote
1answer
18 views

SQL Server log for revoke statements

I am trying to figure if SQL Server has a feature to log when a user fires statements as revoke, delete from, etc. It would be great to see which user has fired the command, date and time, and which ...
1
vote
1answer
36 views

how to included concatenated values in Dynamic Pivot Column Value

I am extending a dynamic pivot query. The original query works fine. In the second query Instead of display the date as a value for the pivot column I would like to display a concatenated column ...
1
vote
1answer
54 views

how to group data against more than one conditions

I have a table named Employees with below two columns. ================== Employees 1- EmpId (auto incremental id) 2- EmpName (varchar) There is another table named 'LateDays' with below five ...
1
vote
1answer
108 views

SQLDriverConnect fails when attempting to connect to Failover_Partner

SQLDriverConnect fails when attempting to connect to Failover_Partner. Connection string being used: Driver={SQL Native Client};Failover_Partner=tcp:dby;Server=tcp:dbx; ...
1
vote
1answer
79 views

Print the execution time on messages Pane?

How I can print the execution time of each query on messages Pane? For example the Select * from tbl1 runs for 10 mins then Select * from tbl2 runs for 15mins and so on.. Select * from tbl1 Go Select ...
1
vote
1answer
168 views

After Restore Log_reuse_wait_desc of Replication

I'm wondering if anybody has ran into this issue before and has any suggestions on what's causing it/how to fix it. We are restoring a database into lower Dev environments and after the restore the ...
1
vote
1answer
24 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 ...
1
vote
1answer
311 views

SQL Server 2012 Publisher SQL Server 2008 Subscriber version issue

So I have a setup where one virtual machine is a SQL Server 2012 publisher and I need to setup merge replication on a SQL Server 2008 subscriber on a different vm. When setting up the subscription ...
1
vote
1answer
94 views

Can a database restore fail after it has begun?

I've noticed that a lot of times if a database restore is going to fail, it will fail before it even starts restoring in SQL Server 2008 Management Studio (displaying an error about space or something ...
1
vote
1answer
215 views

SQL Server replication conflicts after migration from 2000 to 2008

I got a suggestion over at Stackoverflow to post here....greatful for any and all help. Please bear with me I think this might take a while to explain. For many years now my company has hosted a ...
0
votes
1answer
24 views

self referencing tables with SQL and entity framework

I have many tables in a database and the tables are nearly identical. There are limitations currently on what objects reference other objects. For example I have company,contact and project. Contact ...
0
votes
1answer
17 views

Migration script fires 'The data definition language (DDL) command cannot be executed at the Subscriber'

Yesterday I had run a migration script, produced by Visual Studio 2008 schema compare option, on a SQL Server 2008 database. It had run correctly. But today, when I executed the same script, it threw ...
0
votes
1answer
46 views

Removing some English token words (such as “are” or “or” etc.) from the system stoplist of full text search?

One of our table has full text catalog on it. It contains some data in a language other than English which makes some words such as "are", "or" useful. There is no stop list defined but these words ...
0
votes
1answer
69 views

Why is Excel File Opened Exclusively By Another?

I'm creating an SSIS package to loop through a series of Excel files (.xls). I create my while loop container and then create my data flow, which includes an Excel source. When I edit my Excel ...
0
votes
1answer
32 views

Machine account causing a Token-based server access validation failed with an infrastructure error

As the error suggests the SQL log is filling with the error: Login failed for user 'xxx\xxx$'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous ...
0
votes
1answer
51 views

Why the operation is not rolled back?

I have the following code in a trigger (AFTER INSERT, UPDATE): BEGIN IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION; RAISERROR('Does not allow modifications in the past', 16, 1); RETURN; END; ...
0
votes
1answer
53 views

Working out Duplicated Data in a Customer Data Base

I have a database in SQL2008 of customers, There is an ID number for the customer. What im trying to do is to create a NEWID field. We have duplicated customers that have different ID fields, I am ...
0
votes
1answer
50 views

reuse of temp table getting more time to execute

i'm creating temp table as, SELECT T.CD, T.OBJECT_CD, T.PRICE INTO #TEMP FROM TABLE_NAME T EDIT : ADDED CLUSTERED INDEX TO TEMP TABLE CREATE CLUSTERED INDEX IX_Temp_OBJECT_CD ...
0
votes
1answer
127 views

How to generate replication snapshot without locking tables

When I reinitialize subscription and generate new snapshot it locks all tables and makes the database unusable for a very long time (never waited it out). Is there anyway to do this without locking?
0
votes
1answer
181 views

syspolicy_purge_history job failed at step 3

In one of my sql 2008 sp1 standalone instance, syspolicy_purge_history job is fails at step 3 Erase Phantom System Health Records.... Below is the command - (Get-Item ...
0
votes
1answer
188 views

Copy+Pasting currency value from SSMS 2012 to excel does not complete or calculate new value

So I'm trying to copy and paste some query results into Excel, and for some reason it seems to be not properly completing the first value. Let me explain what I mean by this. In Excel the cells I am ...
0
votes
1answer
210 views

dbcc shrinkfile not reducing size of log file in sql server 2008

I am shrinking log file of SQL Server 2008 R2 database, but it is not working. I was using this code: ALTER DATABASE [database] SET RECOVERY SIMPLE DBCC SHRINKFILE(DATABASE_LOG, 20) ALTER DATABASE ...
0
votes
1answer
385 views

SQL Server Error - HRESULT E_FAIL has been returned from a call to a COM component

I have a huge 200MB .SQL file. When I try to open this in SQL server management studio 2008, I get the error -Error HRESULT E_FAIL has been returned from a call to a COM component. What could the ...
0
votes
1answer
416 views

Easy replication for SQL Server: Can it be set up like mongodb or Oracle?

This might look like a noob question... but it isn't. (I have 18 years of SQL Server experience, and three years of MongoDB experience.) The basic scenario is: -- Data Center has big, primary SQL ...
0
votes
1answer
402 views

Deadlock : Behaviour of NOLOCK

We are running into deadlocks when we run concurrent instances of following query : BEGIN TRAN IF NOT EXISTS (SELECT TOP 1 * FROM Table1 WITH (NOLOCK) WHERE Col1 = Val1 AND Col2 = Val2) BEGIN ...
-1
votes
1answer
62 views

How to aggregate related rows

I want to group these related rows into trips (where each trip consists of a sequence from point 1->2->3->2->1). route Date time ------------------------------- point1 15/10/2014 ...
-1
votes
1answer
191 views

Validate each parent intermediary is also a parent to itself

I want to validate where each parent intermediary is also a parent to itself. So this query should return invalid parents in SELECT if table has any. I need to do is first of all get all parents ...
-1
votes
1answer
163 views

How to get Sum and put condition in SQL Server database?

I have two tables, Timesheet and Overtime Timesheet : Card_No Name 1 2 3 4 5 TotalA 123 GGG A H P F P 1 123 GGG A H A F P 2 123 GGG A P P F P 1 123 GGG A ...
-1
votes
1answer
29 views

Previous day of last day

I have a table of Promotion where a employee has given four promotions. I want to find out the previous promotion (3th) of last promotions date .
0
votes
0answers
173 views

Connect only once for all queries in SSMS?

I have an MSSQL database on a remote server. SSMS 2012 asks me to connect every time I double click a query in "Solution Explorer" in my project despite all of them having the same connection. Also, ...
0
votes
0answers
394 views

Identifying XML Node Position in SQL Server 2008

I am having a problem identifying the node position that contains a particular element in a piece of XML. In the example below I would like to extract the position for each node within the statements ...
0
votes
0answers
217 views

changing fill factor on msrepl_command db in distribution

I can't think of any reason why you couldn't change the fill factor on the table without any issues, but I've never change the fill factor on a system table before and would like to know if anyone has ...
-3
votes
0answers
16 views

Clearing log files

How to clear/Shrink the Log file of a database when the database is in stand by mode. How to make a database from recovery mode(normal mode/with recovery) to standby mode.