sql-server

Repeatable Read - am I understanding this right?

Hello Trying to completely understand SQL Server Isolation Levels - notably REPEATABLE READ. I have a sproc that starts a transaction and puts a cursor around some data (boo hiss). This can be a fair chunk of data, so can take a while to do. It will then COMMIT or ROLLBACK. During this time, before the transaction has been closed, i...

Missing: Utility Explorer in Management Studio 2008 R2

I am trying to use Data-Tier applications and am going through the tutorial here. When I get to step two the tutorial says to open Utility Explorer in the view menu. But it is not there! I looked all over the program for another entry point but I just dont see it. I am currently running SQL Server 2008 R2 Version 10.50.1352.12 and I a...

connection string

hi can anyone show me a sample connection string in asp page with sql server 2005 on vista? Or any solution to this problem: Dim cnn As ADODB.Connection throws an error http 500. I suppose ado is not correctly installed? Any ideas? ...

SQL Server: importing from Excel, only want the new entries

The task is to have SQL Server read an Excel spreadsheet, and import only the new entries into a table. The entity is called Provider. Consider an Excel spreadsheet like this: Its target table is like this: The task is to: using 2008 Express toolset import into an existing table in SQL Sever 2000 existing data in the table! Iden...

Does Distributed Transaction Excalation occur if one of the Databases is READ ONLY?

We are doing an import process from a source database to a destination database. We need to run these imports frequently in an automated fashion. The source is on a separate server than the destination. Both are MS SQL 2008. We access the source using Linq2SQL and the destination using a custom Data Layer. We do not ever modify th...

Is it possible to add a identity to a GROUP BY using SQL?

Is it possible to add a identity column to a GROUP BY so that each duplicate has a identity number? My original data looks like this: 1 AAA [timestamp] 2 AAA [timestamp] 3 BBB [timestamp] 4 CCC [timestamp] 5 CCC [timestamp] 6 CCC [timestamp] 7 DDD [timestamp] 8 DDD [timestamp] 9 EEE [timestamp] .... ...

OLE Error in SQL

I have Windows Server 2003 Standard x64 Edition SP2 with Microsoft SQL Server 2005 - 9.00.4035.00 (X64) Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2) I downloaded CAPICOM Platform SDK Redistributable: http://www.microsoft.com/downloads/details.aspx?FamilyId=860EE43A-A843-462F-ABB5-FF88EA5896F6&displ...

Processing a flat file in chunks using multiple threads using producer/consumer pattern and SqlBulkCopy into SQL Server DB

I hope you will bear with me. I wanted to provide as much information as I can. The main problem is how to create a structure (like a stack) that will be used by multiple threads that will pop a value and use it to process one big flat file and possibly do cycling again and again until the whole file is processed. If a file has 100.000...

How to remove ROWGUID designation on a PK column/key

I am attempting to strip a database of its current UID pks (while retaining the column) as part of a conversion process which will use all int keys. SSMS 2008 (SQL Express 2008) - Database originally created in SQL 2000. SQL 2008 full also installed if it helps. A number of the tables have a UID pk which is ROWGUID=yes It seems the R...

How does SSMS get the transaction log usage?

When you right-click on database, Reports...Disk Usage, I get a report. Because I have limited permissions, I only get the top portion, which shows "Transaction Log Space Usage" - that number alone could be useful to me. However, later I get error messages about not having permissions to run DBCC showfilestats, and I also definitely don...

User activity vs. System activity on the Index Usage Statistics report

I recently decided to crawl over the indexes on one of our most heavily used databases to see which were suboptimal. I generated the built-in Index Usage Statistics report from SSMS, and it's showing me a great deal of information that I'm unsure how to understand. I found an article at Carpe Datum about the report, but it doesn't tell ...

How to check .txt file existence with TSQL?

I have a SP reading a .txt file from File System and using Bulk Insert. I just wanna make sure if file exists before executing bulk insert command. How do i do that? ...

Is my stored procedure executing out of order?

Brief history: I'm writing a stored procedure to support a legacy reporting system (using SQL Server Reporting Services 2000) on a legacy web application. In keeping with the original implementation style, each report has a dedicated stored procedure in the database that performs all the querying necessary to return a "final" dataset tha...

convert in stored procedure call?

Hi all, I have the following piece of SQL that does not work: declare @id INT; set @id=0; exec insert_mail @id OUTPUT, 'ZLgeOZlqRGC6l57TyD/xYQ==', 4928, '2010\01\14\14\03131_2.eml', 'Suz, Katie and Kourtney''s Housewarming Party', CONVERT(DATETIME, '2015-01-18 14:03:13', 120); select @id; and changing it this way fixes it: declar...

Does the 2008 Report Viewer control support running reports from a 2000 SQL Server Reporting Service

I'm trying to verify whether or not you can run reports against from the 2008 Report viewer control against a 2000 SQL Server report server. There's not a lot out there on microsoft's sites about what versions it supports. I know it supports 2005 reporting services. ...

AFTER INSERT trigger fails when more than one row to be updated

Hiya, Long time reader, first time caller, and all that... Here's the business problem: a user makes one or more requests for documents. At some later time, a document is uploaded to the system. If that document matches one or more of the requests, the document request is fulfilled. So, there could be one or many requests for Document ...

Select Dates Between Two Column Values

If I have a table with a StartDate column and an EndDate column can I produce a query that returns a set including every day in the range. I could use a table variable and do some procedural code but I'd like to know if there's a way to do it in a query. E.g. StartDate = 1/1/2010, EndDate = 1/5/2010, result would be: 1/1/2010 1/2/201...

SSRS Code Shared Variables and Simultaneous Report Execution

We have some reports that are failing when two of them are executed very close together. I've found out that if two instances of an SSRS report run at the same time, any Code variables declared at the class level (not inside a function) can collide. I suspect this may be the cause of our report failures and I'm working up a potential fi...

What is Microsoft SQL server and why do I need to install it?

All I want to install is visual web developer (but I've had this issue with other things like visual C# to), so when I choose to install just that from microsoft web platform, it wants to download that, under 3mb, and SQL server (dependency it says,) 100mb. I've seen lots of computers with SQL server installed, does it come with all wind...

SQL Compact 3.5 attach multiple DB/ cross-db query?

Is it possible to attach multiple DBs to SQL CE 3.5 (Compact edition) e.g. MasterData.sdf, Orders.sdf and apply queries against them e.g.: select Orders.iOrderID, Orders.cItemID, MasterData.cItemDesc from Orders.CustomerOrder as Orders left join MasterData.Items as Items on Orders.cItemID = Items.cItemID I need this because of sync opti...