sql-server

WSAD to SQL Server Connectivity Problem

Hi All, I am facing issues connecting to SQL Server 2008 from WSAD 5.1.2 ( WAS version 1.5.1.1 ). I am using Microsoft SQL Server 2005 JDBC Driver Version 1.2 on JRE 1.4.2 for the same as Driver Version 2.0 for SQL Server 2008 is not compatible on JRE 1.4.2. The database connection is being established but while retrieving the data I ...

Pivot in sql server

Yes I've tried the code. My requirement is that user inputs Year and Month & prices are shown date-wise in columns for that year and month, with first column as CompetitorID. I want my result like: Competitors | day1 | day2 | day3 | day4 ..........................|day31 ============================================= competitor 1|Price ...

Connecting to SQL Server 2000 through TCP/IP on localhost failed.

I have tried to connect to SQL Server 2000 through TCP/IP. I followed these steps and enabled SQL Server 2000 on port 1433. Then I used the command to test whether the port is opened up: telnet localhost 1433 But I found the following error: Connecting To localhost...Could not open connection to the host, on port 1433: Connect fa...

MyNullableCol <> 'MyValue' Doesn't Includes Rows where MyNullableCol IS NULL

Dear Gurus Today I found a strange problem that is I have a Table With a Nullable Column and I tried to use following Query SELECT * Id, MyNCol, FROM dbo.[MyTable] WHERE MyNCol <> 'MyValue' And Expecting it to return all rows not having 'MyValue' value in Field MyNCol. But its not returning all those Rows Containing N...

SQL Server analyzer tool

in my previous workplace we used oracle enterprise manager for viewing statistics and bottlenecks of queries that are running against oracle10g. In my new workplace we use Microsoft SQL Server (2005). Is there any tool like enterprise manager of oracle in SQL Server - I need to see all the jdbc SQL queries i make and how long they are ta...

select a single distinct column in a table while others remain as it is

hi i have the following table P_id Fname Lname 1 vaibhav shukla 2 davalesh barak 2 sumo barath 3 kushal mehra now i want a query which returns any of the following table P_id Fname Lname 1 vaibhav shukla 2 davalesh barak 3 kushal mehra OR P_id F...

How do I compare against the current week using SQL Server?

How do I compare an SQL Server date column against the current week? For instance: WHERE [Order].SubmittedDate = *THIS WEEK* ...

Error in SQL Server while updating data

Create Table #tempTbl ( [AssID] [int], [dt] [datetime] ) insert into #tempTbl select distinct(AssignmentID), (case when isdate(substring(NoteText,len('Vehicle picked-up was completed on')+1,len(NoteText)))=1 then substring(NoteText,len('Vehicle picked-up was completed on')+1,len(NoteText)) else '01/01/1900' end) as dop from d...

Problem facing to run ruport from other machine

I am using SQL Server 2008 Reporting Services and set mode remotely. All is going fine and reports running on my machine. I am not using report viewer control, but switch to browser. Problem is that when I access the report from any other system in browser by providing required url. I m getting the following premission error: Serve...

SQL Server 2005 bulk insert binary types

Hello, I have a table in the following format: smallint, binary(10), smallint, smallint, varbinary(max) I also have a csv file generated from the data in the table by one of our processes where binary data is exported as hexadecimal data. I tried generating INSERT INTO statements which worked but was very slow.. I tired BULK INSERT...

SQL Server 2008 - Finding Specific Commands/Calls/Text

I need to find an insert statement into a specific table. Unfortunately, the application isn't mine to begin with, there are over 100 stored procedures in the database, I've stepped through the code writing down every stored procedure name from begining to end of this process and I still cannot find it. I know that the process has to o...

SQL Server 2008, Win 7 x64: "The remote server returned an error: NotFound."

Hello, My Silverlight app works on my other two computers (WinXP) with SQL Server installed locally. On my Win 7 computer, fresh install of SQL Server 2008 (on the Win7 computer), I get the NotFound error. My web.config contains: The db was attached with SS Management Studio. Any ideas on what is going wrong? ...

How can I insert over 8000 bytes into SQL using C#?

How can I insert over 8000 bytes into SQL using C#? I have a large amount of text I want to store in a varchar, 8000 bytes seems to be the limit, can I increase this? Thanks ...

Sql Server : Lower function on Indexed Column.

I found one big issue. I have added the Lower function to indexed column of one of the table to fetch the data. The table contains more then 1 lac records. While fetching the records, the cpu usage goes to 100%. I could not understand, how this much drastic change can happen just because of Lower() function. Please Help! ...

Entity Framework SQL Query Execution

Using the Entity Framework, when one executes a query on lets say 2000 records requiring a groupby and some other calculations, does the query get executed on the server and only the results sent over to the client or is it all sent over to the client and then executed? This using SQL Server. I'm looking into this, as I'm going to be s...

book suggestions to learn about olap

I want to learn about olap and 'cubes', I have a very limited understanding and looking for recommendations on good beginner books on these sort of topics. I use sql server primarily so if the book is geared towards sql server it would be ideal. ...

can't query SQL linked server -> MS Access remotely, only works on server

I'm working on a C# application that queries a SQL Server 2008 Express instance on a remote server (LAN). When I am at my workstation/dev machine, I can open SQL Server Management Studio and connect to the SQL instance through Windows Authentication, and for all intents and purposes the experience is identical to working in SSMS "on" th...

What is a good way to represent simple tabular data accessible by a SQL Server fuzzy search?

Hi all, I'm trying to define a table in a SQL Server database that will hold rules. The rule data will be keyed on a number of columns. Where rules apply to a number of scenarios I want the the key columns to contain wildcards to avoid having to maintain lots of data. I then want to find the best match row with some kind of fuzzy search...

WCF service for handling SQL queries - advice please

Following on from this question, would it be a wise idea to place a WCF service at the server side, between client and database to handle queries? The idea being that you take load of the network and reduce round trips to and from a database. I would use the Entity Framework to query the database in the service, and just send results t...

SQL Server IN vs. EXISTS Performance

I'm curious which of the following below would be more efficient? I've always been a bit cautious about using IN because I believe SQL Server turns the result set into a big IF statement. For a large result set this could result in poor performance. For small results sets, I'm not sure either is preferable. For large result sets, wouldn'...