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

  • SEARCH
  • Home
  • 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 6972559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:59:06+00:00 2026-05-27T16:59:06+00:00

I am making a project in C# and I have connected to my SQL

  • 0

I am making a project in C# and I have connected to my SQL Server 2008 database. I created a procedure but I keep getting error that it couldn’t be found. Funny thing is that I created 2 more procedures in same script and everything works fine.

First I read script and execute all code, and that passes very well, then one table is created and 2 procedures and finally I come to my last procedure but it keep’s giving me error. I’ll put some code so you guys can see what have I done wrong.

IF object_id('Uporabniki') IS NULL
CREATE TABLE Uporabniki
    (
        id_uporabnika int,
        ime_uporabnika nvarchar(200) not NULL,
        skupina_uporabnika nvarchar(200) not NULL,
        PRIMARY KEY  (id_uporabnika)
    )
GO

IF object_id('Dodaj_uporabnika') IS NULL
EXEC sp_executesql N'
CREATE PROCEDURE Dodaj_uporabnika
    -- Add the parameters for the stored procedure here
    @ime_uporabnika nvarchar(200),
    @skupina_uporabnika nvarchar(200)

AS
BEGIN
    DECLARE @id_konec INT
        SET @id_konec=(SELECT MAX(id_uporabnika) FROM Uporabniki);
        IF(@id_konec IS NULL)
            BEGIN
                SET @id_konec= 1
                insert into Uporabniki (id_uporabnika,ime_uporabnika, skupina_uporabnika) values (@id_konec, @ime_uporabnika,@skupina_uporabnika);
            END
        ELSE
        BEGIN
            insert into Uporabniki (id_uporabnika,ime_uporabnika, skupina_uporabnika) values (@id_konec + 1, @ime_uporabnika,@skupina_uporabnika);
        END
END'
GO

IF object_id('Spremeni_uporabnika') IS NULL

EXEC sp_executesql N'
CREATE PROCEDURE Spremeni_uporabnika
    -- Add the parameters for the stored procedure here
    @stari_id int,
    @novo_ime_uporabnika nvarchar(200),
    @nova_skupina_uporabnika nvarchar(200)

AS
BEGIN
    BEGIN
        UPDATE Uporabniki SET ime_uporabnika=@novo_ime_uporabnika,skupina_uporabnika=@nova_skupina_uporabnika WHERE @stari_id=id_uporabnika;
    END
END'
GO

IF object_id('Brisanje_uporabnika') IS NULL

EXEC sp_executesql N'
CREATE PROCEDURE Brisanje_uporabnika
    -- Add the parameters for the stored procedure here
    @id_uporabnika int

AS
BEGIN
    BEGIN
        DELETE * FROM Uporabniki WHERE @id_uporabnika = id_uporabnika;
    END
END'
GO
  • 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-27T16:59:07+00:00Added an answer on May 27, 2026 at 4:59 pm

    DELETE * FROM Uporabniki is invalid syntax so Brisanje_uporabnika will never be created.

    use

    DELETE FROM Uporabniki instead. Not sure how you are submitting this script but you should see the following error when you run it.

    Msg 102, Level 15, State 1, Procedure Brisanje_uporabnika, Line 9

    Incorrect syntax near ‘*’.

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

Sidebar

Related Questions

I am making a project that should compile on Windows and Linux. I have
I have a Appengine connected Andorid project, to enable RPC calls between the server
I am making a project that sells product and I want to have a
I have a number of editions of the project for which I am making
I am making a Python gui project that needs to duplicate the look of
I have a client-server project (small project for companies in C#) and the server
I'm making a project in flash together with 4 more people, but we've faced
I have a very large ASP.NET project that i need to make good with
I'm on a asp.net MVC 2 project and have a view that inherits from
I have a VisualStudio solution created in Vs2005 which is making use of Microsoft

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.