Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
I need to use directquery to use parameter in slicer,
but my sql query is success in SQL SERVER but happen error when using direct query,
I have try to use -->select * from (.......my program......) as SourceQuery
still show error
"Microsoft SQL: Incorrect syntax near keyword 'declare'.
Incorrect syntax near ')'. "
I have so idea:(
I have the solution!
Convert your stored procedure to function that returns a table. It works!
Something like this:
create or alter function dbo.my_function()
returns @my_data table
(
Field1 varchar(20),
Field2 int,
Field3 int
)
as
begin
declare @test int
set @test = 1
insert into @my_data
select [Field1, Field2, Field3]
from [your table]
where Field3 = @test
return
end
@Lily36876 , You have to use select here. declare etc is not supported.
SP is supported, But not sure that can work direct query
thx For reply,that meas I can't use any declare in DQ?
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 62 | |
| 62 | |
| 42 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 120 | |
| 113 | |
| 38 | |
| 29 | |
| 28 |