Showing posts with label everybody. Show all posts
Showing posts with label everybody. Show all posts

Thursday, March 22, 2012

ERROR in Where Cluase

Hello EveryBody,

I have a little problem in Sql Statement .. When I am adding a Where condtion to my sql statement ..I got an error shown in the pic blew :

I am waiting for your solution

Best regards,

It means that you have an error in your WHERE clause.Big Smile

What is the complete SELECT statement?

Don

|||

Good eveningdonkielySmile,

This is my SQL Statement:

SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued
FROM Products
WHERE CategoryID= @.CategoryID

and this is the erro shown in pic :-

Thank you for your concern

|||

Ah. I'm glad you sent the image. There cannot be a space between the @. and the CategoryID on the right side of the = sign.

Don

|||

Sad

Unfortunately, I was trying with no space ..but the same error happen >>

Shown in pic blew:-

Thanks Don

|||

ban:

This is my SQL Statement:

SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued
FROM Products
WHERE CategoryID= @.CategoryID

When I copy and paste that into Query Analyzer and run it against the Northwind database I receive no error. Are you sure that is your exact SQL statement?

|||

Dear tmorton,

yes , I am .It is the exact SQL Statemet .

but I am thinking maybe there is missing file on my program or somthing wrong with my keyboard.

I do not konw ,but this is not the first time that error happen to me ,every time I use WHERE Cluase .

I hop to find the solution for it .

anyway thanks to trying help meSmile

|||

Just a silly question, and don't kill me if it sounds really stupid to ask this please!

You are using SQL Server with the default sql server provider, yes?

|||

shadosIndifferent

OoOoOOOOOh God I am just a beginner programmer in ASP.NET ... I am so confuse

I did not get it your Q , but I am using a Microsoft Visual Studio .Net 2005 (Full Edition)

This version include Microsoft SQL Server 2005

Note : I can run SQL Statement with this program but I can not use WHERE Clause when it is taking a parameter

I appreciateyour help

|||

Okie, that answer my question, you are. All good then, I really don't get what the issue is. I was asking, because different databases have issues with SQL statements like the one you're writting (with parameters in the where clause), so I thought... But thats not the problem, so back to the drawining board >.<

|||

shados,

so back to the drawining boardTongue Tied

What do you mean by that ?

|||I just meant that my idea was wrong :)|||

Hellow againBig Smile,

I find the solution for my problem>>>shown in pic blew :-

Not: I am using Microsoft Acess DataBase.

Speical Thanks to >>donkiely ,tmorton,shados

for more info:-

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=874535&SiteID=1&mode=1

Have a nice day!

|||

ban:

I find the solution for my problem

That's great!!

ban:

Not: I am using Microsoft Acess DataBase.

This is the SQL Server forum. Next time please post in the Access forum. You would have had an answer days agoWink

|||

Gah, thats why I asked if you were using SQL Server :) In databases like MS Access, PervasiveSQL, a lot of databases accessed through ODBC, etc, you have to use the ? placeholder instead of @.variablename...

Indeed, since this is a SQL Server forum, we all assumed you were using SQL Server, hahahaha. Ahh well, glad you found your problem.

sql

Friday, February 24, 2012

Error in backup process.

Hi everybody,

I'm trying to backup a database of 330 GB more or less from my server to an external hard disk connected by optical fiber and I'm receiving the next error:

[SQLSTATE 01000] (Message 3211) Write on "H:\sqlbackup\pm_import" failed: 33(The process cannot access the file because another process has locked a portion of the file.) [SQLSTATE 42000] (Error 3202) BACKUP DATABASE is terminating abnormally. [SQLSTATE 42000] (Error 3013). The step failed.

Any idea?

Thanks!

refer this link,

http://msdn2.microsoft.com/en-us/library/ms837537.aspx is there any other process that is accessing your db just type sp_who2 and see if anything is accessing your db.......any operations going in your db other than backup any bulk insert etc?......

|||Absolutely nothing! I put the batabase in SINGLE_USER mode.

|||

no need to bring to Single user mode . SQL Server has online backup architecture. The problem seems to be the Target file. ie the Backup file in H:\SQLBackup. check any process is using the file when u take backup. It need exclusive access to that file. to debug the issue... create a new database and take backup in the same path ie . H:\sqlbackup\test.bak or something like this. if u r getting same error then the problem may be something else. post back the result of this debug process i mentioned

Madhu

|||

Thank you very much Madhu. I thought the data file was locked by another process, but in fact it was the target file who was block by the anti-virus.

So problem solved!

Thanks again.