SQL Server Performance

insert and reference same paritioned view

Discussion in 'General Developer Questions' started by bucketo, Jul 12, 2005.

  1. bucketo New Member

    Hey guys,

    Quick question: I know you can't insert into a partitioned view if that same view is in the SELECT statement. Here's an example:

    INSERT INTO dbo.fin_cashier
    (store_key, field1,field2,field3)
    SELECT 999 As new_store_key, field1,field2,field3
    FROM dbo.fin_cashier As a
    WHERE store_key = 666


    Is there any way to do this insert in 1 SQL statement as opposed to creating a temp table, inserting into the temp table, then inserting into the view from the temp table? I'm coding this in a stored proc.

    thanks

    Jason

    beer me!

Share This Page