sql-server-2005

Full text search stored procedure error

This is the error I am getting: Syntax error near 'online' in the full-text search condition '""online"*" and "and*" and ""text"*"'. This is my stored procedure: ALTER PROCEDURE dbo.StoredProcedure1 ( @text varchar(1000)=null ) AS SET NOCOUNT ON declare @whereclause varchar(1000) SET @whereclause = @text SELECT articles...

Inserting DateTime into Sql Server 2005

Hello I have a problem inserting a datetime format variable to Sql Server 2005 database. DateTime Format is dd.MM.yyyy conn.Open(); string conString = "SET DATEFORMAT DMY INSERT INTO AmortPlanT (InvestmentID,StartDate,Maturity,IRate,CoupPerYear,parValue) Values (@IIndex,'@StartDate','@Maturity',@IRate,@CouponPerYear,@p...

Select top one from left outer join

Guys, I have a query where basically select the latest browser that our user used. here is our (simplified) table structure HITS_TABLE ---------- USERID BROWSER HITSDATE USER_TABLE ---------- USERID USERNAME and here is how I query the latest browser that our user used SELECT U.*, H.BROWSER FROM USER_TABLE U CROSS APPLY (SELEC...

Faster way to find duplicate SQL query

I have a query to get duplicate data with some extra condition but I feel that it is not fast enough. Any solution to make this query faster? v_listing contains big information SELECT DISTINCT code, name, comm, address, area FROM v_listing t1 WHERE EXISTS (SELECT NULL FROM v_listing t2 WHERE t1.comm = t2...

TSQL - Case on Ntext (SQL 2005)

Hi, Stored Procedures in SQL 2005 - with field type NText Im Writing a stored procedure to tidy up some data before importing it into Microsoft CRM. So far all works fine. However i need to do a case statement on a nText Field. It needs to check this field against about 3 or 4 text values and set a new field (already in the destina...

One machine on network cannot connect to SQL 2005

I've got a small Windows network with 3 machines. One of them has SQL 2005 installed. As of last week, the other two machines have had no problems connecting to the SQL instance. Today, one machine - running Vista, if that matters - all of a sudden cannot connect. I get the generic message saying "A network-related or instance-specific ...

Attaching catalog with SQL Authentication credentials attaches it as Read-Only

Hello, As part of our product's installation process, a database is attached to the server. We use EXEC sp_attach_db in order to attach it to MSSQL. The problem occures when we try to attach it with "SQL Authentication" connection string - the database is attached to the server as read-only, thus preventing any write access from being ...

SQL Server 2005 How Do You Clear Out a Query Execution Plan

Hello fellow programmers. I have a SQL Server 2005 query that is taking a long time to process the first time through. After the first run the query works much faster. It goes from one minute to one second. I know that SQL Server is caching an execution plan (is that the right term? ). What I want to do is clear out this execution pla...

Hibernate and Sql Server best Practicies

Hi all, Our application uses Hibernate with Sql Server 2005. Being a DBA, I am not an expert of Hibernate yet. And our developers do not understand Sql Server very well, so I need a middle ground to make sense out of this. I am looking for some info on how Hibernate works with Sql Server 2005. Any best practices or any issues with th...

Missing Namespace Assistance

Hi, I can't find the following namespace on any of my dev boxes Microsoft.SqlServer.Dts.Runtime; I have Visual Studio Team System 2008 on some machines and Visual Studio 2005 on some. What do I need to install to get this? ...

Search column in SQL database ignoring special characters

Hi, Does anybody know if it's possible to do a %LIKE% search against a column in a SQL Server database but get it to ignore any special characters in the column? So, for example if I have a column called "songs" and they contain the following... Black Or White No Sleep 'till Brooklyn The Ship Song Papa Don't Preach If the user...

How much RAM is SQL Server actually using?

I am debugging one of my apps and noticed that the RAM on my SQL Server 2005 x64 box (running on a Windows 2003 R2 x64 ) is pegged and even going into the paging file. I understand that SQL Server 2005 x64 just grabs everything it can, so this might be normal (???). How can I check how much memory it is actually using? ...

SQL Server 2005 truncates strings at double quotes

When I update the pollQuestion and pollName column that contain double quotes using the stored proc below, it saves the double quotes properly. However, for columns option1,...,option9, the stored proc doesn't save the double quotes or any characters after the double quotes. It's as though SQL Server truncates the string prematurely at t...

Can't get my SSIS package to run

I created and deployed a package to SQL Server 2005. The package basically downloads a file (.csv) via FTP and extracts the contents to a table. The data is cleaned and then the data is moved to a production table. After deploying the package, I tried calling it from a simple .NET application Dim app As New Application Dim pk...

Ruby on Rails + Sql Server 2005

This has been addressed some time ago, but I've not had any luck following the steps outlined or advice suggested. Here's my situation: I've installed SQL Server '05 and have another (non-Ruby) application utilizing it successfully. I've got Rails up and running successfully (but only for MySQL.) I've installed the Rails sqlserver adap...

Multiplying a Column by -1 Based on Another Column

I'm writing an SSRS report that will change the value of one of the fields based on the value of another field in the same row. Would the best way to do it via SQL? i.e.-Multiply FieldX (float) by -1 if the value of FieldY ends with D,DA, or 'DB', etc. I was initially looking at using a case statement, however I was getting a little s...

What are the secret productivity tips to be awesome at ASP.Net, Visual Studio 2008, and Sql Server 2005

Recently I witnessed an acquaintance developing an ASP.Net site with SQL Server 2005 and Visual Studio 2008, and I was blown away by his level of productivity. I mainly develop servers and sometimes Windows Forms applications. I only do a ASP.Net project every once in a while. So, when one comes up, there's usually a little bit of ram...

I Need Assistance with executing an SSIS package

I've tried with this for over 48 hours and no luck. I then create a simple package, one FTP task to download text files. I deployed the package using the option "SQL Server Deployment". I see the package in SSIS but when I try to run from command line with the command dtexec /ser svrprod05 /sq Package I get the error Microsoft (R) SQ...

Suspended replication process, can I kill it?

Hello; On one of my servers that has a push transactional publication, I see the following session level information....as you can see below, this is a replication procedure (sp_replmonitorrefreshjob) and I'm hesitant to just kill the session because I'm not sure about whether this procedure is supposed to just hang around "waiting". Do...

HttpWebRequest runs slowly first time within SQLCLR

When making an HttpWebRequest within a CLR stored procedure (as per the code below), the first invocation after the Sql Server is (re-)started or after a given (but indeterminate) period of time waits for quite a length of time on the GetResponse() method call. Is there any way to resolve this that doesn't involve a "hack" such as havin...