E
E
Egorithm2016-10-08 00:17:29
SQL Server
Egorithm, 2016-10-08 00:17:29

Why is the procedure not created?

c09fc983f88a41a98ba0cddbec434036.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Nemiro, 2016-10-08
@EgoRusMarch

That's right, you can't be so perverted :-)
If you really want to, you can make a dynamic request and execute it via EXEC . More or less like this:

DECLARE @query AS nvarchar(1024);

SET @query = N'CREATE VIEW WomanAward AS 
SELECT * FROM [Сотрудники] 
WHERE [Пол] = ''Ж'' AND [Премия] BERWEEN 130 AND 210';

EXEC sp_executesql @query;
-- EXEC(@query);

But creating a view in a stored procedure is a very strange and crooked solution, at least in the form shown in the picture. In this case, the representation is not necessary.
- EXECUTE
- sp_executesql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question