cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pedro_Okazaki
Frequent Visitor

SQL No Lock Query

Hello,

 

I am currently trying to connect into a data warehouse and import its views using a SQL query. since we have scheduled refreshes for different dashboards in the same hour, it was suggested that I include a NoLock in the source query.

 

I have tried the below statement on power query but it is not working, could anyone suggest me the correct one ?

 

Pedro_Okazaki_0-1618346067685.png

Thank you in advance!

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Pedro_Okazaki ,

You can refer this blog and viedo which introduce NOLock in power query:

  1. Solving NOLOCK SQL Power BI issues with Sample Code for STEEMSQL 
  2. Solving NOLOCK SQL Power BI issues 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
daxer-almighty
Solution Sage
Solution Sage

@Pedro_Okazaki 

 

As a T-SQL veteran (15+ years of hardcore experience) I can tell you one thing: you should never use the hint NOLOCK. NEVER. If someone tells you to the contrary... then they don't have the foggiest idea what they advocate. But it's your choice.

 

By the way, readers never block readers on tables. Readers can only be blocked by writers. And such blocks should last for a split second, not more. If you have a problem with writers, then you should not use NOLOCK but rather run your query under the SNAPSHOT isolation level.

v-yingjl
Community Support
Community Support

Hi @Pedro_Okazaki ,

You can refer this blog and viedo which introduce NOLock in power query:

  1. Solving NOLOCK SQL Power BI issues with Sample Code for STEEMSQL 
  2. Solving NOLOCK SQL Power BI issues 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

edhans
Super User III
Super User III

Many SQL commands are not available in Power Query, and you are really harming the performance of your query by using select * from. 

Commands like delete, update, etc. are not available either. I don't think Power Query locks anything anyway - it is just a query of the view. If they want to put the no-lock in their view definition that is what should be done.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors