this is new error I get:
IF object_id('Osvezi') IS NULL
EXEC sp_executesql N'
CREATE PROCEDURE Osvezi
-- Add the parameters for the stored procedure here
@tablica nvarchar(200)
AS
BEGIN
IF @tablica = 'Uporabniki' THEN SELECT * FROM Uporabniki;
IF @tablica = 'Dokumenti' THEN SELECT * from Dokumenti;
END'
GO
SELECT *by itself is a bad idea. Combining it with dynamically choosing the table is a worse idea. What are you trying to accomplish? - John SaundersIF @tableName = 'Table1' THEN SELECT col1, col2 FROM Table1;IF @tableName = 'Table2' THEN SELECT col1, col2, col3 from Tabel2;` - John Saunders