Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Stupid MSSQL error

 
Post new topic   Reply to topic Printable version
 View previous topic  NEW start for me Post :: Post Language change called for  View next topic  
Author Message
Animate Dreams
Gotta buy them all!
(Consumer whore)


Age:37
Gender:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Sat Dec 01, 2007 12:58 pm   Post maybe stupid    Post subject: Stupid MSSQL error Reply to topic Reply with quote

So I'm trying to create this procedure for a school assignment(that was due probably 5 weeks ago) thatI believe would work in Oracle, which is what they're using in this book to explain how to make procedures. Here it is

Code: Show/Hide
CREATE PROCEDURE PROC1(T_NUM IN INTEGER)
BEGIN
    SELECT * FROM TRUCK
    WHERE TRUCK_NUM = T_NUM
END;


But MSSQL gives me this error:

Server: Msg 170, Level 15, State 1, Procedure PROC1, Line 1
Line 1: Incorrect syntax near 'T_NUM'.

I don't expect many of you have had any experience with MSSQL, but if you have and know wtf the syntax error is, please tell me. I've already tried google.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
Animate Dreams
Gotta buy them all!
(Consumer whore)


Age:37
Gender:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Sat Dec 01, 2007 1:47 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Okay, I eventually got it after talking with some dude who apparently doesn't know SQL.

Code: Show/Hide
CREATE PROCEDURE PROC1(@T_NUM INTEGER) AS
BEGIN
    SELECT * FROM TRUCK
    WHERE TRUCK_NUM = @T_NUM
END;


Why it needed @s, and more specifically, why it wouldn't work with IN declared, I don't know.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 28 page(s) served in previous 5 minutes.

phpBB Created this page in 0.546035 seconds : 26 queries executed (87.9%): GZIP compression disabled