0
votes
2answers
3 views

New SQL Server 2008 instance, load old instance DB's

BACK STORY: I'm a developer with a local instance of SQL Server 2008 on my workstation. I just recently upgraded my motherboard and found out (much to my dismay) the old motherboard's RAID drivers ...
3
votes
0answers
43 views

Restoring differential backup creates DEFUNCT log file?

Here is my problem. I'm trying to move a database to a new server via a full restore, then cutover with a quick differential backup/restore. I can do a full restore without a problem, but when ...
1
vote
2answers
42 views

Casting fails on subquery result

I'm in a bit of a pickle, I have to perform a query on a database with rather poor data quality. I am trying to evaluate a field which contains a date, but which was defined as a nvarchar. I thought I ...
1
vote
3answers
40 views

Programatically copying data from table from offline database to online database [on hold]

I have a local database and an online database. When i make an entry into my local database, it should also automatically make an entry in the online database. Can anybody tell me how I can do that?
1
vote
1answer
36 views

Full text index search returns an unexpected result

When I search TaxIdentityNumber using contains an unexpected result is returned; the result contains numbers that are not matched to query. For example, I search using '"5689523657*"' and get ...
0
votes
1answer
35 views

Execute stored procedure in another server from sql agent job

I am trying execute stored procedure in remote server in sql agent job using sqlserver 2008 r2 select * from openquery([1.1.1.1],'exec [DB_Name].[dbo].[sp_ProcName]') Or EXEC ...
1
vote
1answer
37 views

Index against a subset of rows?

Is it possible to create an index against a subset of rows fulfilling a certain condition? If it is possible how does one ensure the index is used?
0
votes
1answer
91 views

Why query optimizer doesn't use negative filter index

I have a table that has following structure, as you can see, there are one clustered index and two non-clustered indexes, one non-clustered index is IX_ParentId_Include, and another one is ...
0
votes
2answers
39 views

How to verify data dumps between two MS SQL and MySQL

I'm trying to verify data exported from MSSQL and imported into MySQL is 100% accurate using MD5 hash. On Linux, I'm using md5sum and WinMD5 on Windows. The encoding is the same: UTF8. I tried both ...
1
vote
3answers
110 views

Multiple Transaction Log files and performance impact

So I've gotten into an argument with several people regarding the number of transaction log files a give databases should have. I've seen several post saying you should only have 1 transaction log ...
0
votes
2answers
84 views

I can't connect to my servers SQL database via an IP Address

I have setup a server that runs Windows Server 2008, and has SQL Server 2008 Express installed. I can connect to the machine's SQL Server Express database via the MACHINENAME/SQLEXPRESS. However ...
0
votes
0answers
57 views

SQL Server query result: missing zero before decimal point for -1 < float < 1

I have SQL Server 2008 Express with linked Oracle db. When querying Oracle from SQL Server, I receive for example ,96 instead of 0,96 for float type columns. Any idea how to configure this on ...
-2
votes
0answers
31 views

log shipping backup job getting failed frequently

Even i am facing similar issue some of the log backups are getting failed for the same reason stated above the first possibility that came to my mind was the same it could have been a network issue or ...
1
vote
1answer
64 views

Create USER and LOGIN permissions

What permission should I give to a user or role so that it can Create Login or Create User in database.
1
vote
1answer
73 views

Take database backup of a SQL server 2012 from local SQL Server 2008 R2

I have a SQL Server 2012 installation that has some issues with SQL Server Agent because of which I cannot schedule a job or a maintenance plan to take backup. What I am trying to do is to create a ...
0
votes
2answers
94 views

SQL server 2008 Express x64 in windows 8.1 fail [duplicate]

I've been download sql server express x64 version in this I just install new windows 8.1 x64 vl version and install trial KIS for anti-virus. After i install sql server but it's not working and ...
1
vote
1answer
38 views

Alternatives to joins using Linked Server and OPENQUERY

In my environment, we have a server that stores sales data and another server that stores our HR data. For some reports, we need to combine sales data with employee data. Our sales server contains ...
1
vote
0answers
47 views

Side effects of using updlock lock hint?

I was just exploring UPDLOCK hint in SQL-Server 2008 and I found it is very useful in avoiding certain deadlock scenarios. There are always some side effects when using these types of lock hints but I ...
3
votes
1answer
42 views

Can't update trigger because of activity

Trying to add a line to a trigger that is attached to a table that is constantly in use ALTER TRIGGER [dbo].[name_of_trigger] ON [dbo].[name_of_table] AFTER UPDATE BEGIN IF ORIGINAL_LOGIN() in ...
0
votes
0answers
42 views

Sql Azure: The session limit for the database is 8000 and has been reached

I am getting following exception in SQL Azure, my SQL Server database is a web version, and I am getting this error in SQL Server Management Studio (when connecting). Also this is happening when ...
0
votes
1answer
35 views

How to know my workload type

Is there any tsql-query/DMV through which I can tell my workload type on database, whether mostly Reads or mostly writes happening? Thanks in Advance.
4
votes
2answers
141 views

Update Statement takes forever to complete [closed]

I have table around 1250000 records, and 80 columns Table Structure CREATE TABLE [dbo].[Table] ( [Column1] [int] IDENTITY(1, 1) NOT FOR REPLICATION NOT NULL, [Column2] [int] NULL, [Column3] [int] ...
6
votes
0answers
175 views

Is this a race condition or bug in sql server using serializable TIL with updlock? [closed]

I've been staring at this problem for almost a week now. I'm getting a deadlock in some query, and I've reduced the problem to these reproducible steps: Create a database with: create table offering ...
0
votes
1answer
16 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 ...
2
votes
1answer
39 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 ...
1
vote
3answers
121 views

How to view an encrypted view or stored procedure

I am working on a third party database. When I try to view the definition of a view by right clicking, CREATE TO and then to NEW QUERY EDIT WINDOW, I am getting an error: This property may not ...
8
votes
3answers
207 views

When a previously-fast SQL query starts running slow, where do I look to find the source of the issue?

Background I have a query running against SQL Server 2008 R2 that joins and/or left-joins about 12 different "tables". The database is fairly large with many tables over 50 million rows and about 300 ...
3
votes
2answers
343 views

Ola Hallengren with database mirroring

I am about to setup Ola Hallengrens database maintenance plan. We have our database mirrored and I was just wanting to know if I need to run the script on both my Sql Server instances or only the ...
0
votes
1answer
26 views

Rebuild Index in system database

I use SQL Server and have multiple indexes in system database whit index fragmentation 30% or more. I don't know that SQL server manage system database index automatically or I want to manage them. ...
4
votes
1answer
53 views

How can a connection for one DB block a connection to another DB in SQL Server?

We have an interesting scenario. For weeks, we have been experiencing 'outages' on SQL Server 2008 -- where our websites have slowed to a crawl and mass timeouts for all customers who have DB's ...
4
votes
3answers
126 views

SQL Server- Table partitions on SSD

I have a table in my database that has about 250m rows. I'm new with databases but I have read up about partitioning the table to increase performance. One of the important points that I seem to ...
0
votes
1answer
55 views

How to convert sql server table data into MS Access(.mdb) file

I have SQL Database table with 6664055 rows, I want to convert this SQL Server table data to MS Access format(.MDB), How Can I do this?
2
votes
1answer
78 views

Avoiding Deadlocks

We currently have a trigger-based system in place that does the following: When records in certain tables are modified, a trigger fires that makes a field NULL in a varying number of records in ...
5
votes
1answer
74 views

Free space of mdf and ldf does not match with database free space

In SSMS I saw file size related properties and found below details for one database. Here values does not match with other properties. Here size of the mdf, ldf and total size matches with other ...
5
votes
2answers
161 views

Capture very expensive queries

I have an Sql servers of 2008/2012. Some users run very expensive queries, such as updating 1G rows in one transaction or cross join several very big tables, and it causes the server no response from ...
-3
votes
0answers
37 views

SQL Server 2008 installation errors [closed]

I am stuck here. I tried reformatting my laptop, re-installing SQL Server 2008 but I keep getting these errors. I don't know what to do. I really need this program for my project. Damn. I got these ...
1
vote
0answers
47 views

SQL command in stored procedure continue on error

To perform Checkdb on all database of server i am using a stored procedure which loops over a view which contains list of databases in server and the stored procedure performs checkdb on all databases ...
0
votes
0answers
9 views

Do link servers cache remote database connections?

I have set up a link server from a database server (SQL2008) to my local SQLEXPRESS db, using the actual database as its Failover Partner. I then stopped the SQLEXPRESS service and I could still ...
0
votes
0answers
37 views

I need advise on if I should rebuild my index [duplicate]

I have a SQL Server 2008 Standard server on full mirror (safety). I reorganize all indexes weekly. I am looking into rebuilding a few indexes to improve performance. I ran DBCC SHOWCONTIG on my ...
0
votes
2answers
41 views

Do I need to have enterprise server in order to have multiple data sources in SSRS

I am currently running a single server setup of SSRS on MSSQL Server 2008 R2 Standard Edition and would like to know if I can have multiple data sources in this type of setup. The reason I ask this ...
1
vote
1answer
20 views

How to fix SQL Server instances with different builds on same server?

I have a Windows 2008 box and there are 5 instances of SQL Server 2008 Standard installed. After that, SQL Server service pack patched. Weird thing is: the builds for those instance are different. ...
0
votes
2answers
96 views

Join two subquery in hql

How can I write this sql query in as hql: select count(distinct s.id) as prepaid, count(distinct ss.id) as postpaid from (select * from subscriber where subscriber.ispostpaid=0) s join (select * ...
3
votes
2answers
202 views

Are there advantages to using temporary tables over derived tables in SQL Server?

I read the derived tables have better performance than temporary tables, but anyway many SQL Server developers prefer the second ones. Why? I must do queries with large data (millions records) and I ...
2
votes
0answers
52 views

Maintaining Referential Integrity with a Filestream enabled database

We have a production database which is filestream enabled and has grown, within a year, to about 20Gb as it stores documents. On many occasions we need to bring the live data back to UAT or Dev ...
1
vote
2answers
69 views

SQL Server Linked Servers and Remote Statistics

I'm trying to get a better understanding of how SQL Server uses statistics on remote SQL Servers (e.g. a Linked Server). I understand that the user needs db_owner/db_ddladmin rights to be able to use ...
1
vote
3answers
363 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
2answers
275 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 ...
2
votes
0answers
102 views

SSRS slow opening a Datasource

While optimizing a report, I discovered that the time reported by TimeDataRetrieval in ExecutionLog2 was a couple of seconds longer than the query times shown in SQL Server Profiler for that report ...
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 ...