#Temporary tables, indexes and procedures work!

0

Please login or register to vote for this query.

(click on this box to dismiss)

#Temporary views and functions return errors stating they're not allowed. Use Text-only results, and include the execution plan to see the index has been used.

German Language Meta

Q&A about the site for speakers of German wanting to discuss the finer points of the language and translation

-- #Temporary tables, indexes and procedures work!
-- #Temporary views and functions return errors stating they're not allowed.
-- Use Text-only results, and include the execution plan to see the index has been used.

CREATE TABLE #Test (id int IDENTITY(1,1) NOT NULL, v VARCHAR(MAX) NOT NULL);
go
CREATE INDEX #IX_T on #Test(id)
go
-- CREATE VIEW #V_T AS SELECT v FROM #Test
-- go
CREATE PROCEDURE #T_P AS
  PRINT GETDATE()
RETURN
go
-- CREATE FUNCTION #G_D() RETURNS DATETIME AS
-- BEGIN
--   RETURN GETDATE()
-- END
-- go
CREATE PROCEDURE #T_P2 @v VARCHAR(MAX) AS
  PRINT @v
RETURN
GO
INSERT INTO #Test(v) SELECT @@VERSION;
go
INSERT INTO #Test(v) VALUES ('Yay!');
go
#T_P
go
#T_P2 'Test'
go
SELECT * FROM #Test ORDER BY id;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results