Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

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 @Anonymous ,

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

@Anonymous 

 

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 @Anonymous ,

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.

edhans
Super User
Super User

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors