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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors