Showing posts with label statements. Show all posts
Showing posts with label statements. Show all posts

Friday, March 30, 2012

Problem with Capital Field names in db and sql statements in small letters

Hi,

I integrated a third-party sw that is apparently used in hundreds of sites into my site. That sw has all field names in (Access) db in capital letters and uses small letters in sql statements in the code and that creates a problem on my site. The third-party sw developers say that this is caused by a false setting on the Web Server so they suggest I change my hosting. I know that if the field names and the sql statements in the code are both capital letters or both small letters everything works.
Does anybody have any idea about how to solve this problem? Is it true that it is a hosting problem? And if so could anybody please tell me how to correct web server setting?

Thanks a lot in advance,
CananWhat errors are you getting? It doesn't sound like a web setting to me. It sounds like typical third-party passing the buck crap.

It sounds like your web hosting company has a case-sensitive version of SQL Server. Either that or Access is case sensitive (not even sure if you can do that)??? :)

I think it's safe to say if it works by correcting the code it's not your webhost though.|||Thanks for your quick response. We found out that after v2.5 of MDAC this problem occurs if the server setting is Turkish. So this was our problem. And Microsoft Support pages suggest we use db field names and the sql statement in the same case to solve this problem if the server has Turkish settings ! We changed the Turkish settings on the server back to English but no luck the problem persisted. So what we did we changed the field names to small letters ! Not a nice way of solving a problem but works out... :)

Thanks again,
Canan

Tuesday, March 20, 2012

Problem wit sp_execute SQL

I have to make a large number of updates (about 29k) so I generated teh update statements into a table and am trying to sue sp_executesql to run them. Here is my code:

Declare @.SQLState NVARCHAR(500)

Declare Code Cursor
for
select SQLState from updates
open Code
FETCH NEXT FROM Code
into @.SQLState
While @.@.fetch_Status = 0
Begin
Exec sp_executesql @.SQLState

FETCH NEXT FROM Code
END

CLOSE Code
DEALLOCATE Code

IT appears to run succesfully, but the updates never happen - I get the following results for each update line:

UPDATE REEmployeeEvent SET UpdatedByEmployeeID= '00013' Where UpdatedByEmployeeID='00279'

(1 row(s) affected)

(0 row(s) affected)

Any ideas what I am doing wrong?

BTW - If I run the statements manually, they do work.

Thanks for any help!is there any particular reason why you want to use such a non-standard method to execute a script?

Why not execute dump them to a file, and execute the file as a single batch? At least that way you could visually inspect the scripts for correctness.

What you are trying to do here seems risky at best.