sql-server

Where can i find the: 1) cache hits and 2) cache lookup stats in SQL Server

First of, the question is not: how to see SQL Server cache hit rate! For that one i already know of a view that contains that precises statistic. My question is in fact: where are the raw statistics from where the hit ratio is calculated? Sql server, in msdn pages, states that the cache hit ratio is the total cache hits divided by the ...

CLASSIC ASP - SQL Server does not exist or access denied.

Hi, I'm trying to make a connection to a SQL Server Express DB on localhost, but I get the following error message: Microsoft OLE DB Provider for SQL Server (0x80004005) [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. The code I'm using is Dim connection Set connection = CreateObject("ADODB.connec...

TSQL / SP INSERT statement with text & values

HI, I have an insert statement in a Stored Procedure that requires the value data to be a combination of text and variables/inputs. However my SQL Manager is giving an error on this 'camp' value when trying to compile it. Here is the statement as it currently exists; BEGIN TRAN INSERT INTO TBL_DONATIONS ([donations_MemberID], [d...

Evaluate performance of SQL Server installation

We ported a database server from SQLServer 2005 to SQLServer 2008 (SP1). The new server has more Processors (4 Quadcore versus 1 Quadcore ) and more memory (4GB versus 64GB). Processors are 2.1Ghz(new) versus 2.0Ghz(old). The new OS is Windows Server 2008 and the old is Windows Server 2003. The databases were transfered via backup/rest...

SqlCeDataAdapter.Fill method causes application to exit silently

I have a call to SqlCeDataAdapater. Fill with a DataSet that kills my app with no exception. It only seems to happen when I attempt to load in a large number of records (approx 30,000 rows). I get nothing in the debugger the app just dies with no exceptions. I've checked the mem usage and there is more than enough memory available to...

SQL Server 2008 R2 hemisphere limitation

Does any one know if the limitaition on SQL Server 2008 that a geography cannot be larger than a hemisphere (described here) has been fixed/relaxed in 2008 R2? ...

Getting rid of non ansi outer joins "=*" "*=" -- how do I setup a windows search

Good morning, We are considering the possibility of upgrading from MSFT SQL 2000 to 2005. I am trying to run a windows file search on our code base, but it looks like searching for '*=' doesn't work right off the bat. Perhaps the * is some kind of wildcard? Any help is appreciated, -Alan. ...

SQL Server 'Resume Next' Equivalent

I'm working on a project in VB.net which takes large text files containing T-SQL and executes them against a local SQL database, but I've hit a problem in regards to error handling. I'm using the following technologies : VB.net Framework 3.5 SQL Express 2005 The SQL I'm trying to execute is mostly straight-forwards but my app is co...

Parse a date from unformatted text in SQL

I'm trying to figure out an elegant way to get a date from a text column that has data like this "YYYYMMDD"...so we might see "20060508" as a value in the column, which I would like to be able to return from a query as a date (May 8, 2006). I'm sure I can hack something together given enough time, but the approaches I'm thinking of seem...

SQL Server Stored Procedure Call in PHP - Can't get xml data it returns back into php

Trying to call an SQL SERVER stored procedure from php. Think I've got it working but I can't get the data it returns back into php. I'm copying my php code and also the sample SQL SERVER code below. Believe my problem is how do get the data back from reportData? mssql_execute() just returns boolean true. Looks to me like the procedure...

Sql Server check case sensitivity?

How can I check to see if an SQL Server is case sensitive? I have previously been running the query: SELECT CASE WHEN 'A' = 'a' THEN 'NOT CASE SENSITIVE' ELSE 'CASE SENSITIVE' END But I am looking for other ways as this has actually given me issues in the past. Edit - A little more info: An existing product has many pre-written Store...

" If condition" as one of the constraints to a Column Field ?

I have a Sales tax column in one of my SQL Table where Data is stored. I was wondering is it possible to place an constraint on the table itself for the Sales Tax Column saying " if > June 2008 tax is 2 % " else "tax is 4 %"? Should that come from stored procs related to that Table? ...

Comparison Query to Compare Two SQL Server Tables

I would like to know how to compare two different database table records. What I mean is I will compare two database tables which may have different column names but same data. But one of them may have more records than the other one so I want to see what the difference is between those two tables. To do that how to write the sql query ?...

carriage return and line-feeds

'DateM (Monday): ' + ISNULL(@Mon,'')+CHAR(13)+CHAR(10) 'DateT (Tuesday): ' + ISNULL(@Tues,'')+CHAR(13)+CHAR(10) RESULTS: Is not wrapping. DateM (Monday): Sep 8 2009 12:00AM DateT(Tuesday): Sep 9 2009 12:00AM I want it to wrap. DateM (Monday): Sep 8 2009 12:00AM DateT(Tuesday): Sep 9 2009 12:00AM ...

BRACKETS in SQL if conditions

I have a Rate column in one of my SQL Table where Data is stored. The data in the rate column , is coming thro an Stored proc. In that existing stored proc, I found the condition BEGIN IF @taxPrd < '07/01/2000' OR @taxPrd >= '11/01/2001' AND @taxPrd < '04/01/2003' BEGIN I changed it to ...

how to find a value between ranges in sql server

My condition is My query is returning this 2 10 150000 where 2=startingslab and 10 = endingslab 11 20 250000 21 31 150000 now i want to get the price details for startingslab =3. i.e 15000.I know i need to process it row by row as between is not working. Is there any ...

INNER JOINs with where on the joined table

Hi, Let's say we have SELECT * FROM A INNER JOIN B ON [....] Assuming A has 2 rows and B contains 1M rows including 2 rows linked to A: B will be scanned only once with "actual # of rows" of 2 right? If I add a WHERE on table B: SELECT * FROM A INNER JOIN B ON [....] WHERE B.Xyz > 10 The WHERE will actually be executed before the...

Optional Parameters In Stored Procs - CASE vs. OR

Is there any difference Performance wise between these filter methods? Method 1: WHERE (@Col1 IS NULL OR t.column = @Col1) Method 2: WHERE 1 = case when @col1 is null then 1 else case when col1 = @col1 then 1 else 0 end end ...

Reporting Services 2005 Timout When Exporting via Web Service

We're running into the same problem as reported here: PDF Export Huge Report We're exporting a report from SSRS using the .asmx Web Services. Exporting via the Report Manager works fine, calling from code times out. We get: Exception Message: The underlying connection was closed: An unexpected error occurred on a receive. We've t...

What are some good ways to debug timeouts? (C#)

I'm building a site that runs fine for a few hours, but then *.asmx and *.ashx calls start timing out. The exception is: "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool This may have occurred because all pooled connections were in use and max pool size was reached." I'm using SubSonic as the ...