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

Is it posible to invoke an stored procedure directly from the ConnectionString?

Hi all,

 

Is it posible to invoke an stored procedure directly from the ConnectionString?

This is an example of my Connection String:

- Data Source=SERVERNAME;

- User Id=myUsername;Password=myPassword;

 

Is it posible to do the following?

Data Source=SERVERNAME;

User Id=myUsername;Password=myPassword;Invoke='EXEC SP_PROCEDURE'

 

Thank you.

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

When connecting to Database like SQL SERVER, you can find the connector in Power BI Desktop,

Select Get data->SQL SERVER-> enter server name/database name, expand "Advanced option", enter the"EXEC stored procedure name" in the "SQL Statement" window.

Capture15.JPG

Reference:

https://community.dynamics.com/crm/b/crmchap/posts/utilising-sql-server-stored-procedures-with-powerbi

Execute SQL Server Stored Procedure With User Parameter In Power BI

 

After clicking on "ok", it will pop out a window where you can select authetication to connect to the database.

Capture16.JPG

 

Best Regards
Maggie
Community Support Team _ Maggie 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
v-juanli-msft
Community Support
Community Support

Hi 

Is this problem sloved? 
If it is sloved, could you kindly accept it as a solution to close this case?
If not, please let me know.
 
Best Regards
Maggie
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

The connection string would be

  1. let  
  2.   
  3. Source = Sql.Database("DHRUVIN\SQLEXPRESS""WMS_201", [Query="EXEC stored procedure "])  
  4.   
  5. in  
  6.   
  7. Source

But i don't see any method to write the password in the connection string, it is easy with a direct way as my last post shown.

 

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

Hi @Anonymous 

When connecting to Database like SQL SERVER, you can find the connector in Power BI Desktop,

Select Get data->SQL SERVER-> enter server name/database name, expand "Advanced option", enter the"EXEC stored procedure name" in the "SQL Statement" window.

Capture15.JPG

Reference:

https://community.dynamics.com/crm/b/crmchap/posts/utilising-sql-server-stored-procedures-with-powerbi

Execute SQL Server Stored Procedure With User Parameter In Power BI

 

After clicking on "ok", it will pop out a window where you can select authetication to connect to the database.

Capture16.JPG

 

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

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.