|
blitz2bleach wrote: UPDATE UserTable
SET ((UserTable.[password] = [@password])
WHERE ((UserTable.username = [@username])
The SET clause has two sets of opening brackets and only one closing.
The same goes for the WHERE clause.
Also, you encapsulate the parameters in square brackets which mean they will be interpreted as column names.
I would have written your SELECT query without the profusion of brackets. You also encapsulated the parameters in square brackets which mean they will be interpreted as column names.
Try this:
SELECT COUNT(*) AS Num_of_User
FROM UserTable
WHERE username=@username AND pasword=@password;
|
|
|
|
|
Hi
Use square brackets if you have spaces in column or table name or if column name is a SQL Keyword
For eg.,
SELECT [ID],[Product Name],Price From [Products of ABC]
Harini
|
|
|
|
|
Hi all
What are the advantages of sqlserver2005 over sqlserver2000?
Thanks in advance
|
|
|
|
|
Better datatypes
“Some have an idea that the reason we in this country discard things so readily is because we have so much. The facts are exactly opposite - the reason we have so much is simply because we discard things so readily. We replace the old in return for something that will serve us better.”--Alfred P. Sloan
|
|
|
|
|
More satisfyingly expensive.
|
|
|
|
|
Hello Friends,
I develop a project and i use mssql 2005(express) and i want to use project in another computer that has not have sql server. (actually i mean i want to use sql server mdf file like access) Is it possible?
If it is, how can it be?
Thanks for your helps?
Best Regards
Eray
|
|
|
|
|
It's kind of possible, but the only way to make it work is if the machine has SQL Server Express installed on it. You simply cannot get around that requirement.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
The whole purpose of Sql Server is to have data developement projects move out of the amateurish world of Access. What you do is the following:
The application would go on any machine but you create a connection string
in the app.config that contains all of the connection data.
Now in your connection string you specify some url "\\DevelopmentServer" for example.
Whatever you do -- eliminate all existance of localmachine from your connections!!!
Now on the development machines you modify the hosts file as follows
your machine : DevelopmentServer 127.0.0.1
others machine: DevelopmentServer {your ip address}
The only downside to this approach is that any time your IP is reissued via DHCP you need to have the others update their hosts file. The other possibility is you have your engineers give your machine a fixed address until you can deploy a real database server with a fixed address.
|
|
|
|
|
i have 1 labels, 1 text box and one check box
suppose label contains name,
in textbox user have to enter its age
and checkbox is checkd if he is married.
i have given conneection string using oledb in access sheet
and its storing the values of label, textbox and checkbox succesfully
but nw i have problem when i have many number of labels like thereare more than one name and correspondin textboxes and checkboxes.
when i enter all the values i want them to get store on one button click in my acccess table.
m uanble to implement any logic.
can smbody help.... please tell the stored procedure
u can tell on either acces or SQL server 2000.
thanks
|
|
|
|
|
Hi
I'm easy to me to select any field that begain with any letter or word ,,
but how can I select all fields that contain a word like "bil" ..
jooooo
|
|
|
|
|
|
Hi
You can select these fields by LIKE operator
Example:
SELECT * FROM MyTable WHERE MyField LIKE %c "bil" c%
|
|
|
|
|
Hi
Excuse me
Your code look like this
SELECT * FROM MyTable WHERE MyField LIKE '%bil%'
|
|
|
|
|
Thanks My friend
it's ok
jooooo
|
|
|
|
|
Hi..
Iam trying to connect to a host sql server 2000 using SQL enterprise manager.I made it successfully using one of my desktop computers but I could not do it using my new Laptop.When I try I get the error:specified sql server not found.I dont know what cause this problem.May be because I have Mcafee installed on this laptop But I don't know how to fix this problem?.
Please any advice could be helpful.
-- modified at 11:01 Saturday 10th March, 2007
I am too late but i will never give up
|
|
|
|
|
You've either got a name resolution problem or a firewall issue.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
May you explain to me what do you mean by name resolution problem?
I am too late but i will never give up
|
|
|
|
|
Open a CMD prompt and type PING sqlServerName like it shows in your connection string. If it doesn't come back with an IP address, your machine can't resolve the name, and hence, can't find the IP address of the server.
If if CAN get the IP address, but the server doesn't respond, you either have a network routing issue or a firewall or two in the way.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
It gives me the IP and other data about sent and recieved packets.
What could I do to solve this problem?
I am too late but i will never give up
|
|
|
|
|
The TCP/IP stack of the target machine responds. It didn't tell you anything about the SQL Server that's apparently either not running on it or is being blocked by a firewall.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you very much for all these valuable informations.I have change some network settings in mcafee and install some updates then I delete the old SQL server registeration and add a new one with the same settings but with a different name and it works.May be the old name was similar to one of the SQL servers in the network and it caused some kind of conflict.But now every thing is working perfectly.
Thank you for helping me all the time.
I am too late but i will never give up
|
|
|
|
|
Hi
I have a table
ID Name THEAD VAlue
-------------------------
1 Anish H1 400
2 Anish H2 300
3 Joseph H2 600
4 Joseph H1 100
5 Anish H3 50
6 Joeph H3 60
------------------------
Can I get output as shown below
Name H1 H2 H3
----------------------
Anish 400 300 50
Joseph 600 100 60
--------------------
regards
anish mm
|
|
|
|
|
You need PIVOT functionality.
What database and version do you use?
|
|
|
|
|
Ofcourse, but with some restrictions,
such
how many h1 h2 h3 exists bcs they will becom coulmns
Perhaps there will be a temp table #T(name nvarchar(x),[h1] integer,...)
and over some loop or cursor(wich is slow) u will fill the #T
|
|
|
|