Showing posts with label files. Show all posts
Showing posts with label files. Show all posts

Thursday, March 29, 2012

Configure FTP in Foreach loop

I need to put a FTP task inside a Foreach Loop Container to upload data files to many different FTP servers. The container holds a variable with object data type that includes necessory FTP info (FTP server address, login, password and remote path). How do I configure FTP task so that I can pass the variables to it?

Thanks,

Jia

I get a little work around with command line FTP -

Inside the loop, I create a batch file with the variables passed from the container. Then use xp_cmsshell to call the file. It works although looks a little cumbersome. I still hope there is a better way to do it.

Tuesday, March 27, 2012

Configuration files do not work in CmdExec mode

I have created an Integration Services package on my development machine. The package contains a configuration file witch let's say is stored in c:\projects\MyIntegrationServicesProject\myConfigfile.dtsConfig (on my dev machine).

Then I have another "Production" machine where I import the SSIS package into an SQL database. I then create an sql-job with only one step, to run my SSIS package. This works fine if I configure the step to be an "SQL Integration services package" and configure it to use my configurationfile.

However I would like to configure this package as a CmdExec step. In the commandline, I specify /CONFIGFILE "d:\....\myConfigfile.dtsConfig" (the correct path on the prod machine). But it seems to be ignored, because when I execute the package I get an error telling me that the configuretion file c:\projects\MyIntegrationServicesProject\myConfigfile.dtsConfig cannot be found.

What I try to say is, it seems like it ignors the config-file I specify on the command-line and tries to reach the config-file on a location that's probably stored somewhere in the SSIS package from the time it was created on my development machine.

Is there a way around this?

Does anyone know if this is the correct behaviour of a SSIS package? Shouldn't the config file in the command line overrule any command-line inside the package?|||Can't help with an answer, but curious as to why you need to use CmdExec instead of Integration Services Package?

Greg.|||

Hi GregAbd!

The reason to why I need CmdExec is that running it as an Integration Services Package doesn't give any good output if something goes wrong. And, I also have the problem that my package takes twice as long time if I run it inside a job as if I run it "manually". I'm curious to know if this changes if I run it in the job, but as a cmdexec task.

Regards Andreas

|||Can't help with the run time issue, but you can enable logging in your package - you can literally log everything that happens. Just right-click on the package (i.e. a blank area of the Control Flow) and choose Logging. You can add a Log Provider for Text Files, create a File Connection Manager, and choose which events you want logged.

You can then configure the Log file location from the Data Sources tab on the SQL Agent Job Step.

Greg.|||

You have set a config in your package, the command line allows you to add configurations in addition to the one in the package, it does not change the package structure.

There are similar issues covered in the answers here-

Re: Implementing IDTSLogging - MSDN Forums
(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=816241&SiteID=1)

Configuration files and variables

Hi ..

I need some information on the package configuration files. i.e how to set the configuration parameters from outside the packages. Pls provide me some detailed information along with examples. I want to make my packages to read paramaters from the configuration files as we have in .NET(web.config)////

Secondly I want to know how to play well with variables.. i.e setting a variable.. reading a variable.. passing a variable in the SSIS package dataflows and datatasks.. respectively. Please provide some infomation and a good exam[ple on it I need

sam_idea wrote:

Hi ..

I need some information on the package configuration files. i.e how to set the configuration parameters from outside the packages. Pls provide me some detailed information along with examples. I want to make my packages to read paramaters from the configuration files as we have in .NET(web.config)////

Have you looked in BOL? There's plenty in there regarding SSIS configurations.

Example here: http://www.sqlis.com/?26

sam_idea wrote:

Secondly I want to know how to play well with variables.. i.e setting a variable.. reading a variable.. passing a variable in the SSIS package dataflows and datatasks.. respectively. Please provide some infomation and a good exam[ple on it I need

The 2 most common methods for setting the value of a variable are using an expression (when the variable has EvaluateAsExpression=TRUE, example here: http://blogs.conchango.com/jamiethomson/archive/2005/03/19/1163.aspx) or a script task. There are various tasks (e.g. Execute SQL Task, XML Task) and components (e.g. Rowcount transform, Recordset destination) that can set variable values also.

There is no concept of "passing variables between tasks". A variable is scoped to a container within the package and is accessible by that container and all its ancestral containers. You can pass values between tasks by storing them in variables (note the subtle difference here)

Here's some examples of how you can use variables:

http://blogs.conchango.com/jamiethomson/archive/2005/07/04/1748.aspx

http://blogs.conchango.com/jamiethomson/archive/2005/04/09/1265.aspx

http://blogs.conchango.com/jamiethomson/archive/2005/06/15/1693.aspx

http://blogs.conchango.com/jamiethomson/archive/2005/05/30/1489.aspx

http://blogs.conchango.com/jamiethomson/archive/2005/02/09/964.aspx

Here's a tip for you. Google is your friend and alot quicker than this forum: http://www.google.co.uk/search?hl=en&q=ssis+configurations&meta=

-Jamie

Configuration Files

Hi,

I’m having some issues associated with the configuration files that I can’t understand:

- Having a project with several packages using the same connections in each one (some packages use all connection and others I just have some of them), why can’t I use only one configuration file for all project. Assuming that I would have to configure all packages at least I would like to use always the same file. On the other way I would need 100’s of configuration files (one per package) to configure always the same connection, just because not all the packages use exactly the same connections.

- Having a configuration file on a machine, the package saves the full path, even if the configuration file lays in the same path them the project. When I change my project to another machine that doesn’t use the same file structure forces me to open every package and change the configuration file location.

Having 100’s of packages and a team of developers, even using the source safe, this makes the task just a little difficult

Thanks,
Vítor Ferreira

Sorry for the different fonts
|||

Vítor Ferreira wrote:

Hi,

I’m having some issues associated with the configuration files that I can’t understand:

- Having a project with several packages using the same connections in each one (some packages use all connection and others I just have some of them), why can’t I use only one configuration file for all project. Assuming that I would have to configure all packages at least I would like to use always the same file. On the other way I would need 100’s of configuration files (one per package) to configure always the same connection, just because not all the packages use exactly the same connections.

It is perfectly possible to do this (i.e. share a .dtsconfig file around multiple packages). I'd like to understand why you think it cannot be done.

Admittedly you do have the problem that if a config file references a property that doesn't exist in the package in which it is being used then you will get an error. I have asked for this behaviour to change in the future and I believe it will be.

In the meantime, I aways recommend that you should rationalise your configuration files - splitting them up so that you don't encounter the problem I just spoke of. On the project I have just completed we used a seperate config file for every single Connection Manager and this worked fantasically well because we could easily share config files between seperate packages - I would always take this approach in the future. In fact, I recommend it in my suggested best practices: http://blogs.conchango.com/jamiethomson/archive/2006/01/05/2554.aspx (number 14).

Vítor Ferreira wrote:

- Having a configuration file on a machine, the package saves the full path, even if the configuration file lays in the same path them the project. When I change my project to another machine that doesn’t use the same file structure forces me to open every package and change the configuration file location.

This is why you should use something else I always recommend - Indirect Configurations: http://blogs.conchango.com/jamiethomson/archive/2005/11/02/2342.aspx

Hope that helps!

-Jamie

|||

Jamie,
It works just like you said, that's why i mentioned that i had packages not always using the same connection, because if they all have the same connections or variables used in the configuration file, I have no error. I already have thought on the approach you have mentioned, one configuration file for connection, and it’s probably the best solution.

Thanks,

Vítor Ferreira

|||

Vítor Ferreira wrote:

Jamie,
It works just like you said, that's why i mentioned that i had packages not always using the same connection, because if they all have the same connections or variables used in the configuration file, I have no error. I already have thought on the approach you have mentioned, one configuration file for connection, and it’s probably the best solution.

Thanks,

Vítor Ferreira

Absolutely!!

Its definately the way forward in this scenario. Also, if you use indirect configs its even easier to edit your package configurations because its simply a matter of selecting an environment variable from a list. It works really well!

-Jamie

|||

I would suggest that the indirect configuration feature be augmented to support configuring the root path of configurations from an environment variable. Then just configure the remaining path portion or filename from the designer.

This would allow a single environment variable for a set of packages and each package would just have the configuration file name that is maintained.

Fred

|||

Jamie,
Correct me if I am wrong, but to use environment variables to configure the configuration files path, I will need to use one environment variable for each configuration file, even if they lay all in the same directory!?

Thanks,
Vítor
|||

Vítor Ferreira wrote:

Jamie,
Correct me if I am wrong, but to use environment variables to configure the configuration files path, I will need to use one environment variable for each configuration file, even if they lay all in the same directory!?

Thanks,
Vítor

Vitor,

Correct. That's the approach we used on my last project and we were really happy with it.

-Jamie

|||I'm trying to setup my indirect configuration path using environment variables. I have an environment variable that contains the location of the configuration file. Once I do that I don't have the option to export any variables to this file anymore. Do I have to configure everything using a direct path, then once I'm finished, set it to the environment variable? This seems awckward...|||

Pirooz Javan wrote:

I'm trying to setup my indirect configuration path using environment variables. I have an environment variable that contains the location of the configuration file. Once I do that I don't have the option to export any variables to this file anymore. Do I have to configure everything using a direct path, then once I'm finished, set it to the environment variable? This seems awckward...

Pirooz,

Yes, this is the correct way. I can see how it could be improved like you suggest tho. Why not request it at Microsoft Connect?

-Jamie

sqlsql

Configuration Files

Hi,

I’m having

some issues associated with the configuration files that I can’t understand:

-

Having

a project with several packages using the same connections in each one (some

packages use all connection and others I just have some of them), why can’t I use

only one configuration file for all project. Assuming that I would have to

configure all packages at least I would like to use always the same file. On

the other way I would need 100’s of configuration files (one per package) to

configure always the same connection, just because not all the packages use

exactly the same connections.

-

Having

a configuration file on a machine, the package saves the full path, even if the

configuration file lays in the same path them the project. When I change my

project to another machine that doesn’t use the same file structure forces me

to open every package and change the configuration file location.

Having 100’s of packages and a team of

developers, even using the source safe, this makes the task just a little difficult

Thanks,
Vítor Ferreira

Sorry for the different fonts|||

Vítor Ferreira wrote:

Hi,

I’m having some issues associated with the configuration files that I can’t understand:

- Having a project with several packages using the same connections in each one (some packages use all connection and others I just have some of them), why can’t I use only one configuration file for all project. Assuming that I would have to configure all packages at least I would like to use always the same file. On the other way I would need 100’s of configuration files (one per package) to configure always the same connection, just because not all the packages use exactly the same connections.

It is perfectly possible to do this (i.e. share a .dtsconfig file around multiple packages). I'd like to understand why you think it cannot be done.

Admittedly you do have the problem that if a config file references a property that doesn't exist in the package in which it is being used then you will get an error. I have asked for this behaviour to change in the future and I believe it will be.

In the meantime, I aways recommend that you should rationalise your configuration files - splitting them up so that you don't encounter the problem I just spoke of. On the project I have just completed we used a seperate config file for every single Connection Manager and this worked fantasically well because we could easily share config files between seperate packages - I would always take this approach in the future. In fact, I recommend it in my suggested best practices: http://blogs.conchango.com/jamiethomson/archive/2006/01/05/2554.aspx (number 14).

Vítor Ferreira wrote:

- Having a configuration file on a machine, the package saves the full path, even if the configuration file lays in the same path them the project. When I change my project to another machine that doesn’t use the same file structure forces me to open every package and change the configuration file location.

This is why you should use something else I always recommend - Indirect Configurations: http://blogs.conchango.com/jamiethomson/archive/2005/11/02/2342.aspx

Hope that helps!

-Jamie

|||

Jamie,

It works just like you said, that's why i mentioned that i had packages not

always using the same connection, because if they all have the same connections

or variables used in the configuration file, I have no error. I already have

thought on the approach you have mentioned, one configuration file for

connection, and it’s probably the best solution.

Thanks,

Vítor

Ferreira

|||

Vítor Ferreira wrote:

Jamie,
It works just like you said, that's why i mentioned that i had packages not always using the same connection, because if they all have the same connections or variables used in the configuration file, I have no error. I already have thought on the approach you have mentioned, one configuration file for connection, and it’s probably the best solution.

Thanks,

Vítor Ferreira

Absolutely!!

Its definately the way forward in this scenario. Also, if you use indirect configs its even easier to edit your package configurations because its simply a matter of selecting an environment variable from a list. It works really well!

-Jamie

|||

I would suggest that the indirect configuration feature be augmented to support configuring the root path of configurations from an environment variable. Then just configure the remaining path portion or filename from the designer.

This would allow a single environment variable for a set of packages and each package would just have the configuration file name that is maintained.

Fred

|||

Jamie,

Correct me if I am wrong, but to use environment variables to configure the

configuration files path, I will need to use one environment variable for each

configuration file, even if they lay all in the same directory!?

Thanks,
Vítor|||

Vítor Ferreira wrote:

Jamie,
Correct me if I am wrong, but to use environment variables to configure the configuration files path, I will need to use one environment variable for each configuration file, even if they lay all in the same directory!?

Thanks,
Vítor

Vitor,

Correct. That's the approach we used on my last project and we were really happy with it.

-Jamie

|||I'm trying to setup my indirect configuration path using environment variables. I have an environment variable that contains the location of the configuration file. Once I do that I don't have the option to export any variables to this file anymore. Do I have to configure everything using a direct path, then once I'm finished, set it to the environment variable? This seems awckward...|||

Pirooz Javan wrote:

I'm trying to setup my indirect configuration path using environment variables. I have an environment variable that contains the location of the configuration file. Once I do that I don't have the option to export any variables to this file anymore. Do I have to configure everything using a direct path, then once I'm finished, set it to the environment variable? This seems awckward...

Pirooz,

Yes, this is the correct way. I can see how it could be improved like you suggest tho. Why not request it at Microsoft Connect?

-Jamie

Sunday, March 25, 2012

Config files get lost...

I created a project with multiple packages. I created a global

config file that all packages reference. I also created a config file

for each package that contains the package specific settings. I

checked it all into TFS. I went to a different machine and checked it

all out. Upon loading a package into the IDE I got the following 3

warnings.

Warning loading MT_LSE_PROD_StageLoad.dtsx: The

configuration file "MT_LSE_PROD_StageLoad.dtsConfig" cannot be found.

Check the directory and file name.

e:\contentloader\sprint1a\MT_LSE_PROD_StageLoad.dtsx

Warning

loading MT_LSE_PROD_StageLoad.dtsx: The configuration file

"Environment.dtsConfig" cannot be found. Check the directory and file

name. e:\contentloader\sprint1a\MT_LSE_PROD_StageLoad.dtsx

Warning

loading MT_LSE_PROD_StageLoad.dtsx: Failed to load at least one of the

configuration entries for the package. Check configurations entries and

previous warnings to see descriptions of which configuration failed.

e:\contentloader\sprint1a\MT_LSE_PROD_StageLoad.dtsx

Any

ideas? And yes, the files *ARE* there! I tried building the project

and it builds. I also tried doing a deployment build and that too

built. I am so confused!!!

StarPilot wrote:

I created a project with multiple packages. I created a global config file that all packages reference. I also created a config file for each package that contains the package specific settings. I checked it all into TFS. I went to a different machine and checked it all out. Upon loading a package into the IDE I got the following 3 warnings.

Warning loading MT_LSE_PROD_StageLoad.dtsx: The configuration file "MT_LSE_PROD_StageLoad.dtsConfig" cannot be found. Check the directory and file name. e:\contentloader\sprint1a\MT_LSE_PROD_StageLoad.dtsx

Warning loading MT_LSE_PROD_StageLoad.dtsx: The configuration file "Environment.dtsConfig" cannot be found. Check the directory and file name. e:\contentloader\sprint1a\MT_LSE_PROD_StageLoad.dtsx

Warning loading MT_LSE_PROD_StageLoad.dtsx: Failed to load at least one of the configuration entries for the package. Check configurations entries and previous warnings to see descriptions of which configuration failed. e:\contentloader\sprint1a\MT_LSE_PROD_StageLoad.dtsx

Any ideas? And yes, the files *ARE* there! I tried building the project and it builds. I also tried doing a deployment build and that too built. I am so confused!!!

Could it be a permissions issue? I assume the account running the packages has access to e:\contentloader\sprint1a\

-Jamie

|||Not a permission issue. I've granted every account access to the file system (one of the "joys" of being in a dev environment). Also, I see this behavior in VS.NET not SQL. I do a get latest or check out of the project on a brand new dev machine and it is VS.NET giving me the warnings. I compile (ignoring the warnings) and it works just fine. I turn deployment on and build and the deployment directory has the packages and config files. So, they are there and being used - it's VS.NET that's winpering over it...

config file contents and deployement

Hi all,

I have few config files with db passwords in them. I have to change passwords daily into that(as my system is in UAT phase now). I have deployed my packages on SQL Server.

My question is , do I need to deploy my packages daily after password updation, or it'll automatically taken care by the SQL Server ?

Thanks in Advance

syed

If you are using package configuration files, you should be able to modify just the config file, and not have to re-deploy the packages.|||

thanks for ur response John !!

Can you please tell me how internally it works so that i can have a better picture ?

thanks

|||

The topic "Package Configurations" in Books Online explains it much better than I can Smile

Basically, configurations allow you to store settings for your package outside of the pacakge (in a file, a database, env. variables, etc.). At runtime, the package reads the configurations when it first starts up, and uses the values specified in the configuration when it is executing. You can set connection strings, variable values, task properties, and more through configuration.

config file contents and deployement

Hi all,

I have few config files with db passwords in them. I have to change passwords daily into that(as my system is in UAT phase now). I have deployed my packages on SQL Server.

My question is , do I need to deploy my packages daily after password updation, or it'll automatically taken care by the SQL Server ?

Thanks in Advance

syed

If you are using package configuration files, you should be able to modify just the config file, and not have to re-deploy the packages.|||

thanks for ur response John !!

Can you please tell me how internally it works so that i can have a better picture ?

thanks

|||

The topic "Package Configurations" in Books Online explains it much better than I can Smile

Basically, configurations allow you to store settings for your package outside of the pacakge (in a file, a database, env. variables, etc.). At runtime, the package reads the configurations when it first starts up, and uses the values specified in the configuration when it is executing. You can set connection strings, variable values, task properties, and more through configuration.

Friday, February 24, 2012

condensing log files

I need to set up an automated way to condense log files in a database. I
successfully got a "dbcc shrinkdatabase" command to run in TranSQL, but I
was thinking that if I can create a stored proc that runs through all the
tables in a dabase, I could schedule that to run and it would always keep my
log file sizes down. So I wrote code, but of course the first parameter of
the "dbcc shrinkdatabase" command requires a 'table object' and that is my
problem. How can I write the code to use the table names as table objects
instead of varchar vairables? Here is the code that I have so far:
declare @.name as varchar(50)
create table #tableNames
(name varchar(50))
insert into #tableNames select TABLE_NAME from INFORMATION_SCHEMA.TABLES
while select count(*) from #tableNames > 0
BEGIN
@.name = select top 1 from #tableNames
dbcc shrinkdatabase (@.name, truncateonly)
delete from #tableNames where name = @.name
END
drop table #tableNames
Scott Schuman
Medical AssociatesThere are undocumented stored procedures designed to execute dynamic SQL
against databases and tables:
Undocumented sp_MSforeachdb and sp_MSforeachtable Stored Procedures
http://www.dbazine.com/sql/sql-articles/larsen5
"Schoo" <scott.schuman@.nospam.ma-hc.com> wrote in message
news:OnHXUDD$FHA.1548@.TK2MSFTNGP10.phx.gbl...
>I need to set up an automated way to condense log files in a database. I
> successfully got a "dbcc shrinkdatabase" command to run in TranSQL, but I
> was thinking that if I can create a stored proc that runs through all the
> tables in a dabase, I could schedule that to run and it would always keep
> my
> log file sizes down. So I wrote code, but of course the first parameter
> of
> the "dbcc shrinkdatabase" command requires a 'table object' and that is my
> problem. How can I write the code to use the table names as table objects
> instead of varchar vairables? Here is the code that I have so far:
> declare @.name as varchar(50)
> create table #tableNames
> (name varchar(50))
> insert into #tableNames select TABLE_NAME from INFORMATION_SCHEMA.TABLES
> while select count(*) from #tableNames > 0
> BEGIN
> @.name = select top 1 from #tableNames
> dbcc shrinkdatabase (@.name, truncateonly)
> delete from #tableNames where name = @.name
> END
> drop table #tableNames
> Scott Schuman
> Medical Associates
>|||Schoo (scott.schuman@.nospam.ma-hc.com) writes:
> I need to set up an automated way to condense log files in a database.
> I successfully got a "dbcc shrinkdatabase" command to run in TranSQL,
> but I was thinking that if I can create a stored proc that runs through
> all the tables in a dabase, I could schedule that to run and it would
> always keep my log file sizes down. So I wrote code, but of course the
> first parameter of the "dbcc shrinkdatabase" command requires a 'table
> object' and that is my problem. How can I write the code to use the
> table names as table objects instead of varchar vairables? Here is the
> code that I have so far:
It seems to me to be a poor idea. Shrinking is good if a file has
exploded because a of some special operation. But shrinking the log
regularly is meaningless, the log will grow again, and that will cost
you performance.
Also read this article from Tibor Karazsi's site:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Sunday, February 19, 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
>
>

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
>
>