Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: sp and conditional temp table
Message
From
23/05/2005 13:03:58
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01016662
Message ID:
01016824
Views:
9
>
	SELECT *
>	INTO #TEMPTABLE
>	FROM (SELECT 	1 x WHERE @choice=0
>	UNION ALL
>	SELECT 0 x WHERE @choice<>0) dt1
>
Now, try this:
two tables, where:
- tableSource1 : User have not read permission
- tableSource2 : User have read permission
...
IF @UserRole = 0
   SELECT * INTO #TEMP1 FROM dbo.tableSource1
ELSE
   SELECT * INTO #TEMP1 FROM dbo.tableSource2
Of course i can split sp, write views or functions,
but this is another issue.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform