sql-server-2005

Is it possible to perform multiple updates with a single UPDATE SQL statement?

Let's say I have a table tbl with columns id and title. I need to change all values of title column: from 'a-1' to 'a1', from 'a.1' to 'a1', from 'b-1' to 'b1', from 'b.1' to 'b1'. Right now, I'm performing two UPDATE statements: UPDATE tbl SET title='a1' WHERE title IN ('a-1', 'a.1') UPDATE tbl SET title='b1' WHERE title IN ('b-1',...

SQL Delete (Suspended in activity monitor)

I have a table containing hundreds of entries and I am trying to delete a small range. It is taking a long time, in fact it is not being executed. I monitored the query from the activity monitor and its status is "Suspended" Is there anyone knows what may cause this problem? ...

Are there performance benefits when upgrading SQL2000 to SQL2005?

I've had a look at this question but there are no responses regarding performance. Are there any performance benefits from doing a simple upgrade from SQL2000 to SQL2005? I am thinking a line of business OLTP datbase. I am not using OLAP or FTI. ...

Restore SQL Server 2008 DB *to* SQL Server 2005

Got myself in a bit of a pickle here ... working on a CMS project, under the assumption that sql server 2008 was greenlighted as the db of choice. Well it wasn't, we now have to backport all of our content out SQL Server 2008 and into SQL Server 2005. A simple backup/restore procedure yields: "RESTORE HEADERONLY is terminating abnormal...

Selecting most recent date between two columns

If I have a table that (among other columns) has two DATETIME columns, how would I select the most recent date from those two columns. Example: ID Date1 Date2 1 1/1/2008 2/1/2008 2 2/1/2008 1/1/2008 3 1/10/2008 1/10/2008 If I wanted my results to look like ID MostRecentDate 1 2/1/2008 2 ...

Hiring a SqlServer OLTP Specialist, What experience or requirements should I look for?

I'm running into Db performance issues with an OTLP project I'm working on. Another developer and I have reached the end of our accumulated performance knowledge and seek out an individual to join the team to help us speed up our application. For some background we've done schema changes to denormalize pieces of the data, optimized eve...

Fetch mail attachment into SQL Server 2005 using IMAP

Hi, I need to import data into my SQL Server 2005 from an e-mail datasource on an Exchange mail server. It means that when a mail is sent to a particular mail address I must retrieve the mail subject and the attached file and then I must import these data into my SQL Server 2005, using IMAP. Can I do this with SSIS, or do I have to wri...

Help with SQL query

Can anybody help me with the following SQL command please? I am not very experienced in SQL. I have 2 tables: Table Weighings with columns: WeighingId FileId MyDateTime Table Files with columns: FileId Name Table Weighings contains information when a specified file has been weighed. I need to make a list of last weighings of in...

Query examples in a many-to-many relationship

Wow, it's hard to find a simple explanation to this topic. A simple many-to-many relationship. Three tables, tableA, tableB and a junction tableA_B. I know how to set up the relationship, with keys and all, but I get a little confused when time comes to perform INSERT, UPDATE and DELETE queries.... Basically, what I am looking for is...

Problem with SQL Join

I have two tables, tblEntities and tblScheduling. tblEntities: EntityID ShortName Active 1 Dirtville 1 2 Goldtown 1 3 Blackston 0 4 Cornfelt 1 5 Vick 1 tblScheduling: ScheduleID EntityID SchedulingYearID 1 1 20 2 ...

Insert Picture into SQL Server 2005 Image Field using only SQL

Using Ms SQL Server 2005 and Management Studio how do I insert a picture into an Image type field of a table? Most importantly how do I verify if it is there? ...

How many digits can be stored for a number in SQL Server 2005?

I have a number from an Oracle database of 47306832975095894070.85314746810624532. When I bring it into SQL Server, it certainly doesn't show that many digits. It shows as 4.73068329750959E+19, and the field is defined as FLOAT. I think that probably includes all the significant digits, but I'm being asked if the number can be store...

XML and Sql Server 2005

Hi, i have a problem that I want to resolve in a best possible way. The thing is that I made a schema that looks like this: print(" <xs:complexType name="rentACarT"> <xs:sequence> <xs:element name="poslovnice" type="poslovniceT" /> <xs:element name="korisnici" type="korisniciT" /> </xs:sequence> </xs:complexType> <xs:...

What does the sys.dm_exec_query_optimizer_info "timeout" record indicate?

During an investigation of some client machines losing their connection with SQL Server 2005, I ran into the following line of code on the web: Select * FROM sys.dm_exec_query_optimizer_info WHERE counter = 'timeout' When I run this query on our server - we are getting the following results: counter - occurrence - value timeo...

ColdFusion Exception help: coldfusion.runtime.NoOperScope cannot be cast to coldfusion.runtime.ApplicationScope

I am encountering an exception cause by the CFINVOKEARGUMENT line of the following snippet: <CFOUTPUT query="cfmx.Messages"><CFSILENT> <CFINVOKE component="com_VUI_RemoveIllegalChars" method="formatString" returnvariable="cfmx.formattedMessage"> <CFINVOKEARGUMENT name="inString" value="#TTSText#"> </CFINVOKE> </CFSILENT> The exact ...

What are the downsides of sqlserver 2008 (vs 2005)

I'm starting a new project and I'm considering using sqlserver 2008. I've had a lot of trouble getting teamsystem to work with it, and I'm wondering if sql server 2008 is widely used in productions environment yet. What whould you choose? How do you compare sqlserver 2005 and 2008? EDIT : I agree about the obvious and general tradeoff...

Thread using 50-100% CPU usage : MSVCR80.dll!endthreadex

I have sql 2005 sp1, and have been noticing a lot of MSVCR80.dll!endthreadex threads using Process Explorer taking all of the CPU on the server and they never go away until you either kill it, or restart sql server? Does any one know any work around as in like how to end it or stop it coz this happens everyday. ...

Maximum number of columns in a LINQ to SQL object ?

I have 62 columns in a table under SQL 2005 and LINQ to SQL doesn't handle the updates though the reading would work just fine, I tried re-adding the table to the model, created a new data model but nothing worked, I'm guessing I've hit the maximum number of columns limit on an object, can anyone explain that ? ...

SQL 2005: should I roll my own log shipping?

I'm looking into using log shipping for disaster recovery and I'm getting mixed messages about whether to use the built-in stuff or roll my own. Which do you recommend, please, and if you favour rolling your own what's wrong with the built-in stuff? If I'm going to reinvent the wheel I don't want to make the same mistakes! (We have the W...

I can SEE the space in an email address, but SQL SERVER can't?

Hi -- I am trying to clean up some email addresses in sql server. I can see examples of the problematic emails, and they look like this: abc123 @xyz.com However, when I try to run a query to find folks like these, say with: NOT CHARINDEX(' ',LTRIM(RTRIM([Email_Address]))) = 0 or Email_Address like '% %' my query returns no res...