SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Dynamic Connection Strings in Reporting Services 2005


Dynamic Connection Strings in Reporting Services 2005

Author
Message
Jeswanth Jaishanker
Jeswanth Jaishanker
SSC Veteran
SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)

Group: General Forum Members
Points: 292 Visits: 172
yes you can , but all teh sqls in data set shluld be stored procs. then u can pass username and password as a parameters to the report.

--------------------------------
samcneal
samcneal
SSC Rookie
SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)

Group: General Forum Members
Points: 30 Visits: 67
I found your article interesting and a great solution. I am testing it out and receive this error and cannot seem to implement a work-around.

An error has occurred during report processing.
Cannot create a connection to data source 'master'.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Do you have any idea what is causing this error? I already checked the remote connectios and we do allow them against the test servers.
jvansandt
jvansandt
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 33
Hey Crunchy...what did you do to get the database names into a dropdown? That is the only part that I am trying to make work.
Ritesh_Dev
Ritesh_Dev
SSC Journeyman
SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)

Group: General Forum Members
Points: 83 Visits: 411
Anyone got it working with multiple values of parameter? I get this error:

"Error during processing of the ConnectString expression of datasource ‘xxx’."

conn string: ="Data Source=servername;Initial Catalog="+Parameters!CountryName.Value

For single value its working fine but foe multiple values its not working.

Any hint would be greatly appreciated!

Ankur
Jeswanth Jaishanker
Jeswanth Jaishanker
SSC Veteran
SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)SSC Veteran (292 reputation)

Group: General Forum Members
Points: 292 Visits: 172
ankurk2 (11/23/2011)
Anyone got it working with multiple values of parameter? I get this error:

"Error during processing of the ConnectString expression of datasource ‘xxx’."

conn string: ="Data Source=206.17.24.23;Initial Catalog="+Parameters!CountryName.Value

For single value its working fine but foe multiple values its not working.

Any hint would be greatly appreciated!

Ankur


Ankur,
you may use the following string for creating conneciton string

="Data Source=" & Parameters!ServerName.Value & ";Initial Catalog=" & Parameters!DBName.Value

we use Windows Authentication to connect , so the first parameter is for servername and second for databasename
this works.


Jeswanth

--------------------------------
Ritesh_Dev
Ritesh_Dev
SSC Journeyman
SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)

Group: General Forum Members
Points: 83 Visits: 411
HI Jeswanth,

Thanks for the reply!! Sorry to say but your method won't work. You are just making server name dynamic.
My question was can we select multiple values for parameter with that connection string.

As it is single connection string and it can take only one database at a time. And in your given string it can take only one server name and related database name.

I hope you understand now. Some1 has any idea about selecting multiple values for parameter. Please let me know.

Thanks
crunchycocktail
crunchycocktail
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 84
First things first. If you want to use Server Names in the drop down list then make a dataset which would populate your server names. and then create another dataset with servername as parameter and populate database names. Now your Stored Procedure should be written using execute sql command


SP_executesql N'servername+databasename+storedproc'

so now you will get the dropdown list populated which inturn would execute your stored proc on different servers.


remember if you have a query instead of SP then you need to have dynamic sql statements prepared.

let me know if you have any more questions
jvansandt
jvansandt
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 33
I am trying to statically set the Server and choose which database that I want to pull the reports from. Is that possible? And if so, is it possible to choose which db's that I want to use and restrict the list to those?
Ritesh_Dev
Ritesh_Dev
SSC Journeyman
SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)

Group: General Forum Members
Points: 83 Visits: 411
I have few questions:
1. Are all databases in one server?
2. Do you want to select one database at a time or multiple?

Thanks
jvansandt
jvansandt
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 33
Hi Grasshopper,
All db's are on one server and I am only looking to access one of them at a time.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search