Showing posts with label sqlserver. Show all posts
Showing posts with label sqlserver. Show all posts

Sunday, March 25, 2012

Configuration file for dts package

Hi all,
I am building a DTS pakage to read from a text file and Populate a SQL
Server table. I am using the Enterprise manager to build the package.
I wanted to know if there is a way where I can specify information like the
path of the source text files, Login/pwd,server name of the detination
server in a separate "configuration file".
The reason I am looking for this is that I might need to move my packages to
different severs who may have different name and login/pwd. Also I dont want
to hadrcode the source file path in the package.
I think It is possible with UDL files but I dont know how.
any suggestions will be highly appreciated.
Cheers,
siajHi
Good stuff is here
www.sqldts.com
"siaj" <siaj@.discussions.microsoft.com> wrote in message
news:5FF4F79F-29D6-4B2E-99DD-9EB65724F768@.microsoft.com...
> Hi all,
> I am building a DTS pakage to read from a text file and Populate a SQL
> Server table. I am using the Enterprise manager to build the package.
> I wanted to know if there is a way where I can specify information like
the
> path of the source text files, Login/pwd,server name of the detination
> server in a separate "configuration file".
> The reason I am looking for this is that I might need to move my packages
to
> different severs who may have different name and login/pwd. Also I dont
want
> to hadrcode the source file path in the package.
>
> I think It is possible with UDL files but I dont know how.
> any suggestions will be highly appreciated.
> Cheers,
> siaj|||You can use a text file or an xml document to save this info. Open it from
your package a populate global variables.
AMB
"siaj" wrote:

> Hi all,
> I am building a DTS pakage to read from a text file and Populate a SQL
> Server table. I am using the Enterprise manager to build the package.
> I wanted to know if there is a way where I can specify information like th
e
> path of the source text files, Login/pwd,server name of the detination
> server in a separate "configuration file".
> The reason I am looking for this is that I might need to move my packages
to
> different severs who may have different name and login/pwd. Also I dont wa
nt
> to hadrcode the source file path in the package.
>
> I think It is possible with UDL files but I dont know how.
> any suggestions will be highly appreciated.
> Cheers,
> siaj|||I discussed some methods here in my article:
http://vyaskn.tripod.com/sql_server...t_practices.htm
You could make use of Dynamic Properties task, .ini files.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"siaj" <siaj@.discussions.microsoft.com> wrote in message
news:5FF4F79F-29D6-4B2E-99DD-9EB65724F768@.microsoft.com...
Hi all,
I am building a DTS pakage to read from a text file and Populate a SQL
Server table. I am using the Enterprise manager to build the package.
I wanted to know if there is a way where I can specify information like the
path of the source text files, Login/pwd,server name of the detination
server in a separate "configuration file".
The reason I am looking for this is that I might need to move my packages to
different severs who may have different name and login/pwd. Also I dont want
to hadrcode the source file path in the package.
I think It is possible with UDL files but I dont know how.
any suggestions will be highly appreciated.
Cheers,
siaj|||Thanks every body ...
These stff should help me.
siaj
"siaj" wrote:

> Hi all,
> I am building a DTS pakage to read from a text file and Populate a SQL
> Server table. I am using the Enterprise manager to build the package.
> I wanted to know if there is a way where I can specify information like th
e
> path of the source text files, Login/pwd,server name of the detination
> server in a separate "configuration file".
> The reason I am looking for this is that I might need to move my packages
to
> different severs who may have different name and login/pwd. Also I dont wa
nt
> to hadrcode the source file path in the package.
>
> I think It is possible with UDL files but I dont know how.
> any suggestions will be highly appreciated.
> Cheers,
> siaj

Configuing SQLServer Express for internet access

Could someone point me to an article that shows how to configure SQLServer express so I can connect to it over the lan and Internet?

Thanks

These articles should help guide you.

Configuration -Configure SQL Server 2005 to allow remote connections
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

Configuration -Connect to SQL Express from "downlevel clients"
http://blogs.msdn.com/sqlexpress/archive/2004/07/23/192044.aspx

Configuration -Connect to SQL Express and ‘Stay Connected’
http://betav.com/blog/billva/2006/06/getting_and_staying_connected.html

Configuration - Guideline for Connectivity Question Posting
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=362498&SiteID=1

Thursday, March 22, 2012

coneverting oledb code to connect to remote sqlserver

i have some oledb code made in c#(vs 2005) it is for local msaccess file. i want to conevert the code for sql server where connection string placed in web.config file seperately. please help me.
here is code

private void buildGrid(){string conStr ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="; conStr += Server.MapPath("~/common/db/demo.mdb"); System.Data.OleDb.OleDbConnection dbCon =new System.Data.OleDb.OleDbConnection(conStr); dbCon.Open();string sql ="SELECT * FROM Posts ORDER BY LastPostDate DESC"; System.Data.OleDb.OleDbDataAdapter dbAdapter =new System.Data.OleDb.OleDbDataAdapter(sql, dbCon); DataSet ds =new DataSet(); dbAdapter.Fill(ds); ds.Tables[0].TableName ="Inbox"; Grid1.DataSource = ds;}

please healp me..

Try this:

private void buildGrid(){string conStr ="Server=MyServer; Database=MyDatabase; User Id = MyUser; Password=MyPassword";System.Data.SqlClient.SqlConnection dbCon =new System.Data.SqlClient.SqlConnection(conStr); dbCon.Open();string sql ="SELECT * FROM Posts ORDER BY LastPostDate DESC"; System.Data.SqlClient.SqlDataAdapter dbAdapter =new System.Data.SqlClient.SqlDataAdapter(sql, dbCon); DataSet ds =new DataSet(); dbAdapter.Fill(ds); ds.Tables[0].TableName ="Inbox"; Grid1.DataSource = ds;}

I hope this will help.

Good luck.

|||

thank you,

i got you but i placed my connection string in to the web.config file how to use connection string placed in the web.config file with code you posted

|||

Try this:

private void buildGrid(){string conStr =ConfigurationSettings.AppSettings("MyConnectionStringInWebConfig"); System.Data.SqlClient.SqlConnection dbCon =new System.Data.SqlClient.SqlConnection(conStr); dbCon.Open();string sql ="SELECT * FROM Posts ORDER BY LastPostDate DESC"; System.Data.SqlClient.SqlDataAdapter dbAdapter =new System.Data.SqlClient.SqlDataAdapter(sql, dbCon); DataSet ds =new DataSet(); dbAdapter.Fill(ds); ds.Tables[0].TableName ="Inbox"; Grid1.DataSource = ds;}

Here is a good link:
How to: Read Connection Strings from the Web.config File
http://msdn2.microsoft.com/en-us/library/ms178411.aspx

Good luck.

Sunday, February 19, 2012

Concurrent queries exceeded

I am getting the following error message on a test SQL
Server:
'This SQL Server has been optimized for 8 concurrent
queries. This limit has been exceeded by 7 queries and
performance may be adversely affected.'
However, I can't seem to find any reference to this
anywhere let alone how to actually change the number of
concurrent queries!
Has anybody else had this problem or know's how to chnage
the setting?
Cheers
Lee.Looks like you are running MSDE. MSDE is optimized for 5 client and 3 server
process concurrent queries.
MSDE is free but is governed to limit performance.
If you need more concurrent connections and queries, you need to install a
full version of SQL Server.
--
Mike Epprecht, Microsoft SQL Server MVP
Epprecht Consulting (PTY) LTD
Johannesburg, South Africa
Mobile: +27-82-552-0268
IM: mike@.NOSPAMepprecht.net
Specialist SQL Server Solutions and Consulting
"Lee Pantling" <Lee.Pantling@.SGP.co.uk> wrote in message
news:054f01c3d9e4$83b146b0$a001280a@.phx.gbl...
quote:

> I am getting the following error message on a test SQL
> Server:
> 'This SQL Server has been optimized for 8 concurrent
> queries. This limit has been exceeded by 7 queries and
> performance may be adversely affected.'
> However, I can't seem to find any reference to this
> anywhere let alone how to actually change the number of
> concurrent queries!
> Has anybody else had this problem or know's how to chnage
> the setting?
> Cheers
> Lee.
|||This is generated by the workload governor that is in SQL Server 2000
Personal Edition and SQL Server 2000 Desktop Engine (MSDE 2000). Information
about the governor is at this Web page:
http://www.microsoft.com/sql/msde/t...workloadgov.asp
You cannot change the setting of the workload governor. If it is limiting
the performance of your instance of SQL Server, you would have to upgrade to
SQL Server 2000 Standard Edition or Enterprise Edition to get a version of
SQL Server that does not have the governor. If the governor is not getting
invoked often, it may not have much of an effect on the performance of your
systsem.
Alan Brewer [MSFT]
Lead programming Writer
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights

Friday, February 17, 2012

Concurrent executions of "fn_trace_gettable" function are failing.

Hi,
While executing
select * from fn_trace_gettable('C:\Program Files\Microsoft SQL
Server\MSSQL.10\MSSQL\DATA\log.trc', default);
query simulateneously from multiple clients, only one
of them succeeds and all others give the following error message:
File 'C:\Program Files\Microsoft SQL Server\MSSQL.10\MSSQL\DATA\log.trc'
either does not exist or is not a recognizable trace file. Or there was an
error opening the file.
Seems like the "fn_trace_gettable" function is locking the trace log file
internally during it's execution. I do not have any alternative other than
executing the query simulateously from multiple clients. Can anyone suggest
a workaround for this problem?
Thanks,
NileshI haven't tested this myself, but definitely seems like a locking issue on
the file, and can see why that would be the case.
Can you load the file into one table first, and then use DTS to parallelly
copy that table to multiple locations?
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Nilesh" <nilesh.oswal@.gmail.com> wrote in message
news:%23rXnKvzjEHA.3664@.TK2MSFTNGP12.phx.gbl...
Hi,
While executing
select * from fn_trace_gettable('C:\Program Files\Microsoft SQL
Server\MSSQL.10\MSSQL\DATA\log.trc', default);
query simulateneously from multiple clients, only one
of them succeeds and all others give the following error message:
File 'C:\Program Files\Microsoft SQL Server\MSSQL.10\MSSQL\DATA\log.trc'
either does not exist or is not a recognizable trace file. Or there was an
error opening the file.
Seems like the "fn_trace_gettable" function is locking the trace log file
internally during it's execution. I do not have any alternative other than
executing the query simulateously from multiple clients. Can anyone suggest
a workaround for this problem?
Thanks,
Nilesh|||Narayana,
I am firing this query from two datasets for generating a report (to be
deployed on SQL Reporting server). Unable to think of any workaround for
that. Any help would be greatly appreciated.
thanks,
Nilesh
"Narayana Vyas Kondreddi" <answer_me@.hotmail.com> wrote in message
news:eOsdGr1jEHA.384@.TK2MSFTNGP10.phx.gbl...
> I haven't tested this myself, but definitely seems like a locking issue on
> the file, and can see why that would be the case.
> Can you load the file into one table first, and then use DTS to parallelly
> copy that table to multiple locations?
> --
> HTH,
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
>
> "Nilesh" <nilesh.oswal@.gmail.com> wrote in message
> news:%23rXnKvzjEHA.3664@.TK2MSFTNGP12.phx.gbl...
> Hi,
> While executing
> select * from fn_trace_gettable('C:\Program Files\Microsoft SQL
> Server\MSSQL.10\MSSQL\DATA\log.trc', default);
> query simulateneously from multiple clients, only one
> of them succeeds and all others give the following error message:
> File 'C:\Program Files\Microsoft SQL Server\MSSQL.10\MSSQL\DATA\log.trc'
> either does not exist or is not a recognizable trace file. Or there was an
> error opening the file.
> Seems like the "fn_trace_gettable" function is locking the trace log file
> internally during it's execution. I do not have any alternative other than
> executing the query simulateously from multiple clients. Can anyone
suggest
> a workaround for this problem?
> Thanks,
> Nilesh
>
>

Concurrent executions of "fn_trace_gettable" function are failing.

Hi,
While executing
select * from fn_trace_gettable('C:\Program Files\Microsoft SQL
Server\MSSQL.10\MSSQL\DATA\log.trc', default);
query simulateneously from multiple clients, only one
of them succeeds and all others give the following error message:
File 'C:\Program Files\Microsoft SQL Server\MSSQL.10\MSSQL\DATA\log.trc'
either does not exist or is not a recognizable trace file. Or there was an
error opening the file.
Seems like the "fn_trace_gettable" function is locking the trace log file
internally during it's execution. I do not have any alternative other than
executing the query simulateously from multiple clients. Can anyone suggest
a workaround for this problem?
Thanks,
Nilesh
I haven't tested this myself, but definitely seems like a locking issue on
the file, and can see why that would be the case.
Can you load the file into one table first, and then use DTS to parallelly
copy that table to multiple locations?
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Nilesh" <nilesh.oswal@.gmail.com> wrote in message
news:%23rXnKvzjEHA.3664@.TK2MSFTNGP12.phx.gbl...
Hi,
While executing
select * from fn_trace_gettable('C:\Program Files\Microsoft SQL
Server\MSSQL.10\MSSQL\DATA\log.trc', default);
query simulateneously from multiple clients, only one
of them succeeds and all others give the following error message:
File 'C:\Program Files\Microsoft SQL Server\MSSQL.10\MSSQL\DATA\log.trc'
either does not exist or is not a recognizable trace file. Or there was an
error opening the file.
Seems like the "fn_trace_gettable" function is locking the trace log file
internally during it's execution. I do not have any alternative other than
executing the query simulateously from multiple clients. Can anyone suggest
a workaround for this problem?
Thanks,
Nilesh
|||Narayana,
I am firing this query from two datasets for generating a report (to be
deployed on SQL Reporting server). Unable to think of any workaround for
that. Any help would be greatly appreciated.
thanks,
Nilesh
"Narayana Vyas Kondreddi" <answer_me@.hotmail.com> wrote in message
news:eOsdGr1jEHA.384@.TK2MSFTNGP10.phx.gbl...
> I haven't tested this myself, but definitely seems like a locking issue on
> the file, and can see why that would be the case.
> Can you load the file into one table first, and then use DTS to parallelly
> copy that table to multiple locations?
> --
> HTH,
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
>
> "Nilesh" <nilesh.oswal@.gmail.com> wrote in message
> news:%23rXnKvzjEHA.3664@.TK2MSFTNGP12.phx.gbl...
> Hi,
> While executing
> select * from fn_trace_gettable('C:\Program Files\Microsoft SQL
> Server\MSSQL.10\MSSQL\DATA\log.trc', default);
> query simulateneously from multiple clients, only one
> of them succeeds and all others give the following error message:
> File 'C:\Program Files\Microsoft SQL Server\MSSQL.10\MSSQL\DATA\log.trc'
> either does not exist or is not a recognizable trace file. Or there was an
> error opening the file.
> Seems like the "fn_trace_gettable" function is locking the trace log file
> internally during it's execution. I do not have any alternative other than
> executing the query simulateously from multiple clients. Can anyone
suggest
> a workaround for this problem?
> Thanks,
> Nilesh
>
>