Isaac
Lifelong Learner
- Local time
- Today, 06:45
- Joined
- Mar 14, 2017
- Messages
- 10,441
Hello,
I'm doing some experimentation with various SQL objects to connect them to PowerBI just to see if I get any differences in performance.
For example, someone made a View that's pretty slow that we use to connect to PowerBI.
My experiment wants to use a table-valued function, multi-statement, so I can segment the data a little better into temp tables and do joins that are more appropriate/efficient based on the cardinality/relationships between the tables.
I'm finding limitations, but unsure which ones are a hard "no" versus which ones I just have the syntax wrong.
I'm trying to:
Thanks
Isaac
Edit - for clarity, I'm getting the error about side-effecting operators whenever I try to select into, and it's leading to a lot of stack overflow pages about things you can't do in a tvf
I'm doing some experimentation with various SQL objects to connect them to PowerBI just to see if I get any differences in performance.
For example, someone made a View that's pretty slow that we use to connect to PowerBI.
My experiment wants to use a table-valued function, multi-statement, so I can segment the data a little better into temp tables and do joins that are more appropriate/efficient based on the cardinality/relationships between the tables.
I'm finding limitations, but unsure which ones are a hard "no" versus which ones I just have the syntax wrong.
I'm trying to:
- select into #temp tables, several times
- create some indexes on the #temp tables
- Update the temp tables while joining to other base tables
- finally , the Insert into the #Table that the function officially returns.
Thanks
Isaac
Edit - for clarity, I'm getting the error about side-effecting operators whenever I try to select into, and it's leading to a lot of stack overflow pages about things you can't do in a tvf
Last edited: