all groups > sql server programming > june 2007 >
You're in the

sql server programming

group:

Creatin Views on temperary tables


Creatin Views on temperary tables Deepthi
6/19/2007 10:17:36 PM
sql server programming:
Can we create views on temporaty table in sql server2000.If yes how can we do that?

From http://www.developmentnow.com/g/113_2004_3_0_2_0/sql-server-programming.htm

Posted via DevelopmentNow.com Groups
Re: Creatin Views on temperary tables Uri Dimant
6/20/2007 12:00:00 AM
Hi

Views or functions are not allowed on temporary tables.






[quoted text, click to view]

Re: Creatin Views on temperary tables SQL Menace
6/20/2007 12:00:00 AM
[quoted text, click to view]

No but why would you? if you need the table to be accesable to more
than 1 connection use a global (##) temp table

Denis The SQL Menace
http://sqlservercode.blogspot.com
http://sqlblog.com/blogs/denis_gobo/default.aspx
Re: Creatin Views on temperary tables Tom Cooper
6/20/2007 1:31:22 AM
No. See Create View topic in BOL.

Tom

[quoted text, click to view]

RE: Creatin Views on temperary tables Bob
6/20/2007 1:56:02 AM
You can't create views on temporary tables prefixed with #(local) or
##(global). However, there is no reason you can't create views on tables
created in tempdb which are NOT prefixed with # or ##. See example below.
Note, these tables will be dropped automatically when the service is
restarted, as with all tempdb objects.

Hope this helps


wBob

-- Pseduo-code
USE tempdb
GO

CREATE TABLE dbo.test_table ... etc
GO

CREATE VIEW dbo.viw_test

AS

SELECT *
FROM dbo.test_table
GO

[quoted text, click to view]
Re: Creatin Views on temperary tables Alex Kuznetsov
6/20/2007 6:20:27 AM
[quoted text, click to view]

No. What is the problem you are trying to solve?
AddThis Social Bookmark Button