Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7504391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:33:20+00:00 2026-05-29T21:33:20+00:00

I am using SQL Server 2005 Management Studio Express. Coins and themes are my

  • 0

I am using SQL Server 2005 Management Studio Express. Coins and themes are my tables. I created a stored procedures using the above two and got struck with

Error:Msg 102, Level 15, State 1, Procedure themestat, Line 1
Incorrect syntax near ‘id2’.

Here is my whole procedure:

create procedure themestat(id2 In numeric, id1 In numeric)
is
   @userid nvarchar(50), @co nvarchar(50), @price nvarchar(50)
begin
   update themes set prioirty=1 where themeid=id2;
   select credits as co from coins where uid=id1;
   select rate as price from themes where priority=1;
   if(co>price)
   begin
     update themes set status=1 where priority=1;
     update themes set priority=0 where themeid=id2;
   end
   else
   begin
     update themes set priority=0 where theme=id2;
     PRINT 'no sufficient coins'
   end
end

I am curious to know where I went wrong ??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:33:20+00:00Added an answer on May 29, 2026 at 9:33 pm

    I’m not sure where you’ve got the syntax from, but datatypes are declared as ‘@param type’, so the first line should read:

    create procedure themestat 
        @id2 numeric
        @id1 numeric
    

    Then obviously change all references of id1 and id2 as appropriate. There’s other syntax errors in the script (missing declare, is instead of as, possibly others – I’ve not looked much closer).

    This makes me wonder whether you’ve come from a different SQL dialect? I suggst reading about CREATE PROCEDURE on the MSDN (as well as other pages).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using SQL Server 2005 and Management Studio how do I insert a picture into
When using SQL Server Management Studio from SQL Server 2005, I can connect to
I'm using SQL Server 2008 Management studio viewing a 2005 server and have just
Using MS SQL Server Management Studio 2005 - To Restore a Database: Restore Database
In my SQL Server 2005 server I create databases and logins using Management Studio.
I am looking to manage a SQL Server 2008 DB using Management Studio 2005.
Im using Microsoft SQL Server Management Studio Express to connect to our SQL Server
I installed SQL Server 2005 express on two computers. I installed SQL Server Management
Visual Studio 2005 I connect with SQL Server Express edition with SQL Server Management
Using SQL Server 2005 management studio, I have exported each Sprocs and Functions as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.