parameter in dataset

  • I am creating a parameter with the default value as test

    in the dataset i need to use it in the query for the schema name. how do i do it

    select * from (Parameters!param0.value).tablename;

    i am getting an error missing right parenthesis. NOt sure how to do it? any suggestion

  • You may use dynamic SQL statements. something like,

    --@schema is parameter

    Declare @val1 nvarchar(500)

    SET @val1 ='Select * from ' + @schema+'.'+'TableName'

    execute(@val1)

  • Snigdha Vartak (8/17/2013)


    You may use dynamic SQL statements. something like,

    --@schema is parameter

    Declare @val1 nvarchar(500)

    SET @val1 ='Select * from ' + @schema+'.'+'TableName'

    execute(@val1)

    In similar case, Dynamic SQL worked for me.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply