Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exec database..proc 'arg1','arg2','arg3'
- select distinct column1 from
- (exec database..proc 'arg1','arg2','arg3')
- select
- <any columns you like>
- from
- dbo.myFunc( 'foo', 'bar', 1 )
- where
- <whatever clauses you like>
- order by
- <same>
- CREATE TABLE dbo.Test_Proc_Results_To_Table
- (
- my_id INT NOT NULL,
- my_string VARCHAR(20) NOT NULL
- )
- GO
- CREATE PROCEDURE dbo.Test_Proc_Results_To_Table_Proc
- AS
- BEGIN
- SELECT
- 1 AS my_id,
- 'one' AS my_string
- END
- GO
- INSERT INTO dbo.Test_Proc_Results_To_Table (my_id, my_string)
- EXEC dbo.Test_Proc_Results_To_Table_Proc
- GO
- SELECT * FROM dbo.Test_Proc_Results_To_Table
- GO
- SELECT DISTINCT Column1
- FROM procName(parameter1, parameter2, parameter3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement