Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL advice

Author  Topic 

mentalabilities
Starting Member

2 Posts

Posted - 2006-03-15 : 15:22:32
I tried to run a SQL script and i get the following message
quote:
Error Message = Native SQL Error Code

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ''.
SELECT name, id, description FROM products WHERE id=4INSERT INTO ''admin_login'' (''login_id'', ''login_name'', ''password'', ''details'') VALUES (252,''neo2'',''newpas5'',''NA'')--
Error Code : 350
F:\Inetpub\Parexel\default.ihtml
iSQL dbname="Parexel" ALIAS="prod" SQL="SELECT name, id, description FROM products WHERE id=4INSERT INTO 'admin_login' ('login_id', 'login_name', 'password', 'details') VALUES (252,'neo2','newpas5','NA')--"
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ''.SELECT name, id, description FROM products WHERE id=4INSERT INTO ''admin_login'' (''login_id'', ''login_name'', ''password'', ''details'') VALUES (252,''neo2'',''newpas5'',''NA'')--


Im new to SQL and i dont know what im doing

Also what does this mean

quote:
iSQL dbname="admin" ALIAS="prod" SQL="SELECT name, id, description


What do SQL databases do and what would i need to do to enter data in to SQL such as a email address or cant that be done?

I think dbname is the database name ALIAS is that the table name?

im just trying to enter data in to my database database and i have no clue what im doing.

Iv read guides online but i get the above error 350


D

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-03-15 : 15:35:47
U may not use " (double quote), instead use single quote '
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-03-15 : 15:37:46
From which application r u running this ?

V'd like to c ur source code.
Also, if u don't know anything, howcome u do these things ?
U may need a book or some reference on SQL Server if u need to know stuff like ALIAS

quote:
i dont know what im doing


So do I

Go to Top of Page

mentalabilities
Starting Member

2 Posts

Posted - 2006-03-15 : 15:58:23
I think i need a book

WHERE id=4INSERT INTO 'admin_login' ('login_id', 'login_name', 'password', 'details') VALUES (252,'neo2','newpas5','NA')--"

is the code.

im running it on windows web server

D
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-03-15 : 17:00:13
Go to Site
www.w3schools.com
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-03-15 : 17:57:38
You don't have to enclose the table name & column in single quote.
INSERT INTO admin_login (login_id, login_name, password, details) VALUES (252,'neo2','newpas5','NA')


Use the bracket [] to enclose the object name if you are using reserved word as object name.
INSERT INTO [admin_login] ([login_id], [login_name], [password], [details]) VALUES (252,'neo2','newpas5','NA')






KH


Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-16 : 00:26:35
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -