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

learn more… | top users | synonyms (1)

0
votes
1answer
12 views

Exclusive access to edit rows

I'm developing a program that allows users to view and edit data. My question: Is there tools (sql server tools, may be users/roles) to implement the following: There are two users: A and B. User A ...
2
votes
4answers
4k views

SQL Server mirrored database is stuck in recovery mode

I have a database that is stuck in recovery mode for few days already. There are multiple threads about this, but the solutions there don't work for me. Here is what I tried already: RESTORE ...
0
votes
1answer
32 views

How to transfer table in SQL Server 2008 from one computer to another [on hold]

I want to transfer my table in SQL Server 2008 from one computer to another... Is it possible? How to transfer from one computer to another? I am doing my final year project. In my project, if the ...
1
vote
3answers
3k views

how can I ignore duplicate inserts?

I basically have the same question posed here - Optimal way to ignore duplicate inserts? - except in my case it's SQL Server. I have a table that is a list of person IDs who are deceased. There are ...
-2
votes
0answers
27 views

SQL job to backup and restore database [on hold]

I need to create an MSSQL job that would run nightly and bakup a database and restore the database with a different name. Example NorthDB (Original Database), NorthDB_test (backup database restored). ...
7
votes
6answers
14k views

How to query last restore date in SQL Server?

Is there a TSQL query that shows the last restore datetime for a certain database?
0
votes
1answer
8 views

Un-attaching SPL 2008 BD not willing to Attach

I have a 5 year old SQL Server 2008 database. There are actually 3 databases NL_Dev NL_Test NL_Prod Each has a log file. We have been using the development database, but all three seam to be ...
0
votes
1answer
14 views

Maintaining multiple build versions of asp .net / SQL Server applications

We have new versions of .net applications deployed every week for testing given in form of new build files. Can any one suggest how I can maintain many versions of the builds without having to keep ...
0
votes
1answer
14 views

migrating legacy databases from SQL Server 2000 via SQL Server 2008 to SQL Server 2012: users and logins

I have some legacy SQL Server 2000 databases to migrate to SQL Server 2012. In my dry run, I have done this: I created empty databases of the same names in SQL Server 2008. Then I backed up the SQL ...
1
vote
1answer
6 views

Run a report by specifying which server to execute the query on

I have a couple of stored procedures that I have written that gathers some information about all of the databases on the server it's stored on. I would like to create a report such that I can select ...
0
votes
0answers
16 views

can't connect to DB using MS SQL Server 2008 Upgrade Advisor

I'm trying to use MS SQL Server 2008 Upgrade Advisor Analysis Wizard, to connect to a networked MS SQL 2000 database. According to the query select @@ServerName, the instance name contains a hyphen. ...
5
votes
2answers
337 views

When was a Database taken Offline

I am trying to find a way to figure out when was couple of my sql databases were taken offline. I checked the the logs but could not find any such info and moreover there is no default trace enabled. ...
0
votes
2answers
294 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 ...
5
votes
4answers
1k views

Datawarehouse bad practice?

In our Datawarehouse context, we have to update some record in fact tables inside our ETL. One thing we did is to create nonclustered indexes just before the heaviest queries, and drop them ...
0
votes
1answer
30 views

how to get child categorys based on categoryid

this is my table structure i need to find child categoryids. If CategoryID 1 then 1,2,3,4,10,12,13,14,15,16 when CategoryID 2 then 2,10,12,13,14,15,16
-1
votes
2answers
39 views

Update code works in manual stored procedure but not when run as SQL Server Agent Job

I have a stored procedure that deletes all records from an existing table, and then inserts new records. After the insert I have several update operations that change the value of one field. If I run ...
2
votes
2answers
77 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
1answer
46 views

Best way to document Dwh views [closed]

I works in a company that provide Dwh views as an API for external Customers (We use MS-SQL 2008 & 2012). every once in a while we release new views and updates the existing views. We have ...
3
votes
1answer
186 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 ...
-4
votes
0answers
46 views

SQL Servers that can be decommisioned [closed]

I am not sure if this would be correct tag for this question: We've been assigned a task to downgrade from enterprise to standard edition. We've figured out this task. But its also required to find ...
0
votes
1answer
30 views

Using dynamic database name for DML in trigger

I am using SQL Server 2008 in my application. Here I need to do database operations between multiple databases. The complexity is database names are user defined except one masster database. I can ...
1
vote
2answers
451 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 ...
2
votes
1answer
89 views

Export all tables in database using SQLCMD

I'm looking to export all tables from a SQL Server Standard Edition database with data into CSV files onto a remote linux server. I setup FreeTDS and am able to connect, do SQLCMD or bcp successfully. ...
1
vote
0answers
51 views

Defragmentation of SQL Server 2008 indexes

I hate asking this question, but I am having issues defragmenting indexes. I keep using the various defragmentation methods for defragmenting a SQL Server index such as DBCC INDEXDEFRAG and DBCC ...
0
votes
1answer
170 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 ...
3
votes
1answer
61 views

Error when using views on a linked server

I have this query: SELECT DescTipoentrevistador FROM Alfabase.dbo.tblTipoEntrevistador WHERE CodTipoEntrevistador IN ( SELECT CASE WHEN EXISTS ...
3
votes
1answer
103 views

best way to consolidate data

I have three select statements which have the bulk of their columns which are the same except a few. So here is an example select *orgid='0' ,'P' as OrgType* , Lang ,*cast(Null as varchar) as ...
3
votes
1answer
51 views

MERGE a UNION query results down to one row per KEY value

This is a lengthy query, it polls one LIVE database for certain sales information, then a UNION runs the same exact query on the ARCHIVE database for the same information. The results show each ...
0
votes
1answer
26 views

Allow public use of functions without giving them database control

I came up with a set of functions that I would like to be accessed from a variety of places. SQL seemed like the best place for this due to accessibility, but I receive this error when trying to use ...
1
vote
1answer
117 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 ...
1
vote
1answer
186 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 ...
2
votes
1answer
273 views

Performance of query with complex where clause on 10M rows

We have a query that destroys our production server when run. It is part of a reporting functionality and the bad part looks as follows: SELECT DISTINCT mt.ID AS ID FROM ...
8
votes
6answers
4k views

SQL Server in a state of confusion: does the database exist or doesn't it?

Got a really weird, annoying problem.. Somehow the instance of SQL Server 2008 R2 running on our server has gotten somewhat corrupted. First, we noticed that the database we created yesterday was ...
0
votes
0answers
21 views

Extremely high memory usage for datacube with 25k records

I have a system with 16GB memory (8 allowed for SSAS) and limiting it to looking at 25k rows of orders. I have 4 dimensions. Date, Customer Data, Sales Person, and Orders (has just ID and date) I have ...
1
vote
1answer
102 views

Tempdb files don't exist

I have a strange behaviour on one of my SQL Server's tempdb. It has six tempdb files, according to SSMS and queries, all pointing to S directory. Each of them have ~5gb of initial size. The weird ...
2
votes
1answer
89 views

What means Command column in sp_who2 and text column in sys.dm_exec_sql_text?

I have a script that shows commands being fired in SQL Server 2008 database as follows: --shows who is active and executed commands declare @SPID int=null, @Status varchar(max) = null, @LOGIN ...
6
votes
2answers
1k views

Parallel Statistics Update

In SQL Server 2008 or later, is UPDATE STATISTICS WITH FULLSCAN a single threaded operation or it can use parallelism? How about update statistics with default sampling - can it use parallelism? I ...
0
votes
1answer
309 views

Error while configuring mirroring, Microsoft SQL Server, error : 1418

I have a SQL Server 2008 Enterprise SP1 installed on my both principle and mirror server. SQL Server and SQL Server agent service is also started by same ID having sysadmin rights. But when I am ...
3
votes
1answer
389 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 ...
0
votes
0answers
228 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 changed the fill factor on a system table before and would like to know if anyone ...
0
votes
2answers
54 views

Stored Procedure never completes with Exec, but i can run the Query in SSMS

Im with a problem here. If i run "exec pr_BuscaLog -2', it will run forever ( days, without end )... BUT, If i select the Query and F5, it runs in seconds. I updated STATS but it didn't work. Some ...
0
votes
1answer
215 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 ...
5
votes
2answers
70 views

Finding the query causing the missing index DMVs

How can I find the query causing the missing index DMVs suggesting to create a particular index? Thank you.
1
vote
1answer
50 views

Correct way to uninstall SQL Server 2008 ( or above )

Since University I've been facing this problem... How do I uninstall SQL Server? What I've done is: Delete everything in "control panel" related to SQL Server. But, is there a right way to ...
2
votes
1answer
367 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
379 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 ...
2
votes
0answers
36 views

SQL Server transaction log reported full when it isn't [duplicate]

The transaction log for database 'WebDB' is full. No, it isn't. Its 90% free. The transaction log backups run normally. My hardware guy tells me the hardware is running perfectly, with plenty of ...
0
votes
1answer
37 views

How to get average according to last update time?

There is table - Item below, how can I get the average Value according to its 15 minute value from last record time? I am using SQL Server 2008. Table -- Item Table 15min_AVG
0
votes
0answers
17 views

Missing index recommendation for an already existing index [duplicate]

SQL Server missing index DMVs suggest to create an index which already exists. The existing one and the suggested one exactly overlap each other; they are single (same) column index with no included ...
3
votes
2answers
3k views

bcp in of datetime type data results in an “Invalid date / time format”

I am familiarizing myself with the bcp utility, and I have a large table containing datetime data awhich I bcp out in several ways: native, character, delimited. I then bcp in to a truncated table ...