Showing posts with label calling. Show all posts
Showing posts with label calling. Show all posts

Wednesday, March 7, 2012

script component isn't finding a reference dll

I have created this c# dll for one of my packages and I was planning on calling it from the script component, but for some reason when I try to call it I get the following error.

Could not load file or assembly 'VRS.Utilities.Dates, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

I've dropped the dll file in the WINDOWS\Microsoft.NET\Framework\v2.0.50727 folder and it shows up when I go to add the reference however when I try to implement it I get the error.

Any idea's on how to fix this?

Thanks for the help
Saitham8

Add the DLL to GAC.

At run time the script task will check the DLL in GAC, at design time script task will check the DLL in folder WINDOWS\Microsoft.NET\Framework\v2.0.50727

|||That seemed to be the solution thanks for the help

script component isn't finding a reference dll

I have created this c# dll for one of my packages and I was planning on calling it from the script component, but for some reason when I try to call it I get the following error.

Could not load file or assembly 'VRS.Utilities.Dates, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

I've dropped the dll file in the WINDOWS\Microsoft.NET\Framework\v2.0.50727 folder and it shows up when I go to add the reference however when I try to implement it I get the error.

Any idea's on how to fix this?

Thanks for the help
Saitham8

Add the DLL to GAC.

At run time the script task will check the DLL in GAC, at design time script task will check the DLL in folder WINDOWS\Microsoft.NET\Framework\v2.0.50727

|||That seemed to be the solution thanks for the help

script calling script

can a SQL Script refer to and call another sql script?
is there a synatax to run another sql script from within a sql script?
how do you refer to and locate the script you want to run from within another?you could do it by invoking sqlcmd or osql via xp_cmdshell. but why?|||e.g.
C:\tmp>type s1.sql
select 'strt_time'=getdate() into #t1
select count(*) as rows from master..syscolumns where name like '%[a-zA-Z]%'
:r s2.sql
select count(*) as rows from master..sysobjects where name like '%[a-zA-Z]%'
:r s2.sql
drop table #t1
go

C:\tmp>type s2.sql
select 'elapsed(ms)'=datediff(ms,strt_time,getdate()) from #t1
go

C:\tmp>osql -n -Usa -Spdsrv -i s1.sql
Password:
(1 row affected)
rows
----
5080

(1 row affected)
elapsed(ms)
----
46

(1 row affected)
rows
----
1400

(1 row affected)
elapsed(ms)
----
76

(1 row affected)