How can I run a query with parameters in a data flow task? I know I can use a script component and write code that executes the query, but I'm looking for a simpler solution, if there's such one.
View Complete Post
I have an OLE DB source in a data flow task. The connection is pointing to a SQL Server 2008 instance. My SQL works fine when I click the preview button. Now I need to make it parameterized by adding a question mark in my where clause.
After doing so & clicking the Parameters button, I get the error described in
this post . When I try to do what's described therein to correct the problem (click the "build query" button), I get the error "The PIVOT SQL construct or statement
is not supported."
I can't make this query an expression; it's simply too complex to maintain that way (besides, just pasting it into an expression builder window and trying to evaluate
as is doesn't work - can't evaluate).
So the question is, how do I parameterize a query? And why does SQL here work so radically differently from SQL in an execute SQL task?
I am attempting to pass report parameters to my query. My report's data source is a WCF web service. I can run normal queries fine, but I have found that without the know-how to pass parameters to my query I am limited with my capabilities.
Assume a string parameter named "Name" with a specified default value of "Jmachol90", how would I pass that into the following query at the designated place:
<Method Namespace="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09" Name="SecurityPrincipalsGetRequest">
<Parameter Name="Criteria" Type="XML">
<Name>[PASS PARAMETER IN HERE]</Name>
Flow documents offer enormous flexibility in arranging text layout and pagination, but they don't support data binding, so you can't dynamically change content. Here we build a component to solve that problem.
Vincent Van Den Berghe
MSDN Magazine April 2009
LINQ to Objects and LINQ to Entities have an arsenal of Standard Query Operators that operate on sequences to perform a wide variety of operations.
MSDN Magazine March 2008
Find out the best way to store large amounts of XML data in SQL Server, along with the performance implications. What's the maximum length of an XML query to SQL Server in a URL?
Edited by Nancy Michell
MSDN Magazine May 2003
I'm on the edge wondering is it possible ? I have got 2 questions. Please help me out.
1. I have a GridView on my page and it uses sqldatasource with parameterized query. What I want to do is, on page load (where nothing has been selected so no parameter supplied), I want it to query everything (something like SELECT * FROM [this_table]) but since my SelectCommand is something like
SELECT * FROM [this_table] WHERE [this_column] = @someParameters AND [that_column] = @someParameters.
Can I play around with default value to achieve something like that but how ? Now, when the page loads, it doesn't show anything (No Gridview).
2. On my page, I made something like (username, gender, address, and more) and one single search button. That means, no single control enable auto postback. What I am trying to accomplish is building dynamic query
(if username specifed -> SELECT * FROM [this_table] WHERE [username] LIKE @username).
If both username and gender are specified (SELECT * FROM [this_table] WHERE [username] LIKE @username AND [gender] = @gender) and you know the rest. How can I do this using GridView and SqlDataSource ? To my knowledge, I can only specify one SELECT statement in a sqldatasource. I am stucked and desparately looking for help. Thanks all.