Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Thursday, March 29, 2012

about activeX script error in ssis package in SQL server 2005

when i run activex Script it's shows this error

[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x001B6438

Moving from .NET Framework Data Access and Storage...|||So is there a solution to this?
I've had a similar error when using the "scripting.filesystemobject" from within a script task in ssis.

about activeX script error in ssis package in SQL server 2005

when i run activex Script it's shows this error

[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x001B6438

Moving from .NET Framework Data Access and Storage...|||So is there a solution to this?
I've had a similar error when using the "scripting.filesystemobject" from within a script task in ssis.

about accessing SQL Server2005 database file from a remote computer

hi every one. i am a new user of asp.net 2.0 using C# code and i am facing a problem in accessing a SQL Server2005 database file in the remote computer. i have connected two pc with peer to peer connection and trying to add a databse using the "Add connection" option from the visual studio 2005. in the add connection dialog box it is showing me the remote server and it was supposed to show all the database in that SQL Server when i select one. but when i am choosing the server name it was not showing me anything. by the way i have configuered the surface area for "both TCP/IP and named pipes" and both the pc's server browser is turned on. is it the right way to access a database file from a remote pc or not?? please send me a good solution to do this things and try to explain the codes with example. waiting for response...plz send me the solution.. as soon as possible

Hi,

Try the following KB article, it may be helpful to you.

http://support.microsoft.com/kb/316649

Thanks.

|||

Hi,

SQL Server 2005 is not allowing remote connections by default. You have to configure the SQL Server 2005 for remote connections using SQL Server Surface Area Configuration tool.

If you refer to article athttp://www.kodyaz.com/content/SQLServerdoesnotallowremoteconnections.aspx , you may see how you can use this tool for allowing remote connections for a sql server instance.

Eralper

sql

Tuesday, March 27, 2012

ability to use variables in package configurations and set their values at runtime

Hi,

My scenario:

I am using a FTP Connection Manager and the configuration setting for it is being set in the package configuration xml file. So the xml file contains the Ftpserver, FTp server username and password. The package is picking up the values from the xml file and is executing successfully. I have to do this because I was not able to provide an expression to the Connection Manager Server Password property.

Now, I want to pick up the ftp details from a database table and set it in the xml file during runtime. Is this possible? OR something like using the

<Configuration ConfiguredType="Property" Path="\Package.Connections[FTP Connection Manager].Properties[ServerPassword]" ValueType="Variable"><ConfiguredValue>@.[user::FtpPassword]</ConfiguredValue></Configuration>

Kindly look at the items in bold. Is this possible? Then I can set the value of the variable in the package before the FTP connection manager task is executed.

Thanks for all the help.

$wapnil

You could use a configuration storage as DB.

Or you can use Script task to query the DB and set the FTP connection properties or Variable values at runtime

Or even Execute SQL task to get the variable values from DB|||

Thanks

Reply to the options that you have provided

1) We want to use XML for the configuration. Just something which we want to follow if we could.

2) We are trying to minimuize the script tasks in the package by bringing the configuration details outside of the package and storing it in XML.

3) same as 1

Lets take a FTP connection Manager for example. The details of the FTP server are present in the database and I have also created variables for that but atleast I am not able to set the FTP Server password using a variable so I resorted to using the xml file and putting in the password there.

Now if I want to connect to multiple FTP server using the same package and the connection details are there in the database then I can pull out the connection details using an Execute SQL task but then how to update the xml files with values......knowing that the FTP server password can be only be set dynamically using the xml file.

Correct me if I am wrong. is storing the variable in the DB the only solution.

Thanks,

$wapnil

|||

spattewar wrote:

Now if I want to connect to multiple FTP server using the same package and the connection details

Are you trying to connect multiple FTP servers at the same time or are you trying to run the package in different environments?

For example if I would need to pull info from 3 different FTP servers - I would create 3 different configuration files:
1 for Development
1 for staging
and 1 for Production site|||

I am trying to connect to multiple FTP servers. But it can be at the same time or in sequence. But I am planning to use a single package for this task.

Thanks for your response.

$wapnil

|||Why don't you use Parent Package Configurations instead? A simple 2-package setup could work where:
Your mother package cycles through a list of FTP server configurations or whatever is needed.|||

That looks like a good idea.

But there is one concern. Even though I pass the configuration as a parent package variable to the child package, will I be able to set the FTP ServerPassword property of the FTP connection manager using a variable. I doubt I can do that, then it boils down to the same thing picking up the package configuration from the xml file or a database, here we would prefer xml file.

Maybe we can do this by.

1) Running the master package which will have a script task to update a xml configuration file.

2) Pass that xml file as a configuration parameter to the child package and execute the child package.

Thanks for your response.

$wapnil

|||I don't have any reason to believe that you can't pass the password or even the whole connectionstring as a variable.

However do note that if your variable values refuse to change (although I don't see any reason why they won't) you might have to tweak the ProtectionLevel of the package to DontSaveSensitive or some other value that allows you to modify your connectionstring variable.

HTHsql

Ability to load a TextBox with RichText ?

Is it possible (using SQL Server Reporting Services) to load a 'TextBox'
component with the contents of a RichText file (i.e. from a saved file
'testRpt.rtf') ?
Any suggestions would be appreciated.
Thanks in advance ...
SteveNo but yes I can solve your problem!
You can't get RTF text neatly formatted into a Reporting Services Textbox
control. - you could create a .NET function to strip the RTF content and
just display the raw text - but that's not what you really want is it?
So what you can do is create a .NET function in a custom assembly that you
pass the RTF into and have it return an image stream and what you then do is
bind that image data to a Reporting Services Image control.
(in the function you'll need to use the CreateGraphics() method.)
Hope that helps. If you need help on creating custom assemblies Chapter 9 of
our book does a great job showing how to progress and how to get Code Access
Security properly configured. We had intended to include the RTF example
but time and space meant that we didn't. I'll probably be doing an article
on this RTF example in the coming months in the Premium area of our web
site.
Peter Blackburn
www.sqlreportingservices.net
"Steve_S3T" <SteveS3T@.discussions.microsoft.com> wrote in message
news:BC061D8B-5FCC-4465-BE99-233BF1CFB292@.microsoft.com...
> Is it possible (using SQL Server Reporting Services) to load a 'TextBox'
> component with the contents of a RichText file (i.e. from a saved file
> 'testRpt.rtf') ?
> Any suggestions would be appreciated.
> Thanks in advance ...
> Steve|||Due to the fact that there's no direct route with this - I'm going to leave
it well alone. :(
Much least of all because I hate doing excessive coding if there's a more
direct approach - in this case I've found an alternate route via DataDynamics
ActiveReports - cue many groans ...
I'm still waiting on a copy of your book - it's been on order a while now.
I'll give that chapter a look through when the book finally gets to me ...
Steve
"Peter Blackburn (www.sqlreportingservice" wrote:
> No but yes I can solve your problem!
> You can't get RTF text neatly formatted into a Reporting Services Textbox
> control. - you could create a .NET function to strip the RTF content and
> just display the raw text - but that's not what you really want is it?
> So what you can do is create a .NET function in a custom assembly that you
> pass the RTF into and have it return an image stream and what you then do is
> bind that image data to a Reporting Services Image control.
> (in the function you'll need to use the CreateGraphics() method.)
> Hope that helps. If you need help on creating custom assemblies Chapter 9 of
> our book does a great job showing how to progress and how to get Code Access
> Security properly configured. We had intended to include the RTF example
> but time and space meant that we didn't. I'll probably be doing an article
> on this RTF example in the coming months in the Premium area of our web
> site.
> Peter Blackburn
> www.sqlreportingservices.net
>
>
> "Steve_S3T" <SteveS3T@.discussions.microsoft.com> wrote in message
> news:BC061D8B-5FCC-4465-BE99-233BF1CFB292@.microsoft.com...
> > Is it possible (using SQL Server Reporting Services) to load a 'TextBox'
> > component with the contents of a RichText file (i.e. from a saved file
> > 'testRpt.rtf') ?
> > Any suggestions would be appreciated.
> > Thanks in advance ...
> > Steve
>
>

Thursday, March 22, 2012

A way to get Table shema as xml ?

Dear all,
Is there a way to get from SQL table and XML shema file (XSD) that can be
read afterwards from a .NEt application ?
I know that I could read frommy ASP.NET code the whole table structure but
having the local xsd file would be faster for reading
regards
serge
Hello serge,

> Is there a way to get from SQL table and XML shema file (XSD) that can
> be read afterwards from a .NEt application ?
> I know that I could read frommy ASP.NET code the whole table structure
> but having the local xsd file would be faster for reading
AFAIK, not directly. One of the things I've done in the past is generate
information about the schema from the metadata. Something like this:
alter function dbo.GetColumnsForTable(@.TableObjectID int)
returns xml
as begin
declare @.rv xml
set @.rv = (select
c.column_id'@.position'
, c.name'name'
, y.name'dataType'
, c.max_length'maxLength'
, c.precision'precision'
, c.scale'scale'
, c.collation_name'collationName'
, c.is_nullable'nullable'
, c.is_rowguidcol'isRowGUID'
, c.is_identity'isIdentity'
, c.is_computed'isComputed'
, x.name
from sys.columns c
join sys.types y on c.system_type_id = y.system_type_id
left join sys.xml_schema_collections x on c.xml_collection_id = x.xml_collection_id
where c.object_id = @.TableObjectID
for xml path('column'),type)
return @.rv
end
go
select t.name'name',
dbo.GetColumnsForTable(t.object_id) as 'table/columns'
from sys.tables t
for xml path('table'),root('tables')
go
While its not a schema per se, you can get a lot of information doing this
kind of coding.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/

A way to get Table shema as xml ?

Dear all,
Is there a way to get from SQL table and XML shema file (XSD) that can be
read afterwards from a .NEt application ?
I know that I could read frommy ASP.NET code the whole table structure but
having the local xsd file would be faster for reading
regards
sergeHello serge,

> Is there a way to get from SQL table and XML shema file (XSD) that can
> be read afterwards from a .NEt application ?
> I know that I could read frommy ASP.NET code the whole table structure
> but having the local xsd file would be faster for reading
AFAIK, not directly. One of the things I've done in the past is generate
information about the schema from the metadata. Something like this:
alter function dbo.GetColumnsForTable(@.TableObjectID int)
returns xml
as begin
declare @.rv xml
set @.rv = (select
c.column_id '@.position'
, c.name 'name'
, y.name 'dataType'
, c.max_length 'maxLength'
, c.precision 'precision'
, c.scale 'scale'
, c.collation_name 'collationName'
, c.is_nullable 'nullable'
, c.is_rowguidcol 'isRowGUID'
, c.is_identity 'isIdentity'
, c.is_computed 'isComputed'
, x.name
from sys.columns c
join sys.types y on c.system_type_id = y.system_type_id
left join sys.xml_schema_collections x on c.xml_collection_id = x.xml_collec
tion_id
where c.object_id = @.TableObjectID
for xml path('column'),type)
return @.rv
end
go
select t.name 'name',
dbo.GetColumnsForTable(t.object_id) as 'table/columns'
from sys.tables t
for xml path('table'),root('tables')
go
While its not a schema per se, you can get a lot of information doing this
kind of coding.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/

a way to export data from table to flat file

Hi there!
I know bulk insert for importing data into tables and bcp for both
importing, exporting data between tables..from flat files...ok..
But is there any way to export data using a SQL statement and a format
file (need to export in kind of csv) just like bcp ? a kind of *bulk
output*...:)
any idea'
thanks a lot
++
Vincelook at DTS...|||Vince
select * from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt;
*.csv)};
DefaultDir=D:\FolderName;','select * from Text1.txt')
"Vince .>" <vincent@.<remove> wrote in message
news:ro7751hjpvc9l0lks58pds2dda1prok8lu@.
4ax.com...
> Hi there!
> I know bulk insert for importing data into tables and bcp for both
> importing, exporting data between tables..from flat files...ok..
> But is there any way to export data using a SQL statement and a format
> file (need to export in kind of csv) just like bcp ? a kind of *bulk
> output*...:)
> any idea'
> thanks a lot
> ++
> Vince
>

a visual basic script to DTS

Hello I am trying to convert a VB script someone wrote for my company into a DTS package that will fire automatically whenever the file is updated on the server. I am using vb.net for the firing of the DTS package, but I am having trouble writting the DTS package itself. This is what the code looks like now

If fso.FileExists(cSource) Then
With cne
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & cSource & ";" _
& "Extended Properties=Excel 8.0"
.Open
cSQL = "SELECT * FROM " & sSheet
Set rse = .Execute(cSQL)
End With

While Not rse.EOF
i = i + 1
Me.Label1.Caption = "Updating Sold: " & i
Me.Refresh
If Not IsNull(rse("VEHICLE-STOCK-NO###")) Then
sSearch = "'" & rse("VEHICLE-STOCK-NO###") & "'"
cSQL = "UPDATE Inventory SET SoldDate = '" & rse("FNLZ-DT") & "', "
cSQL = cSQL & "LastUpdate = '" & Now & "' WHERE StockNo = " & sSearch
cSQL = cSQL & " AND SoldDate IS NULL"
cn.Execute (cSQL)
End If
rse.MoveNext
Wend
rse.Close
cne.Close
End If


So basically I have an excel file that is downloaded once a week and then I run this program, well I am having some toubles with making it a DTS

I need to convert this into an active X transfermation code I think
If Not IsNull(rse("VEHICLE-STOCK-NO###")) Then
sSearch = "'" & rse("VEHICLE-STOCK-NO###") & "'"
cSQL = "UPDATE Inventory SET SoldDate = '" & rse("FNLZ-DT") & "', "
cSQL = cSQL & "LastUpdate = '" & Now & "' WHERE StockNo = " & sSearch
cSQL = cSQL & " AND SoldDate IS NULL"
end if

Thanks a lot

DamianSearch SQLDTS (http://www.sqldts.com) website for code examples and more information.

HTHsql

Tuesday, March 20, 2012

A tool for aggregation design XMLA file viewing/editing ?

Is the best way to specify the most useful aggregations to actually edit the XMLA for measure group and hand pick the aggregations I need?

In that case has anyone seen a basic tool for viewing the attributes in each aggregation and perh
In taht case has aaps even deleting them/editing the XMLA file a little bit? The reason I am looking for a tool is to make sense out of 2000 aggregations created by the wizard.

A new sample app for viewing and editing aggregations should become available as part of SP2...

Thanks,

Akshai

|||what is the name of that sample? I have SP2 final, but only samples under Microsoft SQL Server\90\Sample\Analysis Services are:

\Administrator\ActivityViewer
\DataMining\Data Mining Web Controls
\DataMining\SQL Server Data Mining Plug-In Algorithms
\Programmability\AMO
\Tutorials\Lesson4
\Tutorials\Lesson7

I checked the Programmability\AMO sample, but all it does is provide drilldown into properties. I can drill into aggregations but it's very laborious to use to find see which attributes each aggregation aggregates, because you would need to click 2 times on each dimention in each aggregation to see which attributes it affects. I did not see an ability to create a new aggregation or change an aggregation.

Did I miss something?
Where is the sample that Edward and you mention ?

|||

It's called AggregationManager and is under Administrator/AggregationManager.

I don't think the samples are included in the main SP2 download. I think you have to download them separately. The SQL Server sample are now all available from codeplex. The download page for the SSAS samples is here http://www.codeplex.com/MSFTASProdSamples/Release/ProjectReleases.aspx?ReleaseId=2461

The AggManager sample only works with a deployed database. I am looking to add support for this tool directly in BIDS through a project I am working on at www.codeplex.com/BIDSHelper. I hope to get an initial beta release out in the next week or two if you are interested.

A tool for aggregation design XMLA file viewing/editing ?

Is the best way to specify the most useful aggregations to actually edit the XMLA for measure group and hand pick the aggregations I need?

In that case has anyone seen a basic tool for viewing the attributes in each aggregation and perh
In taht case has aaps even deleting them/editing the XMLA file a little bit? The reason I am looking for a tool is to make sense out of 2000 aggregations created by the wizard.

A new sample app for viewing and editing aggregations should become available as part of SP2...

Thanks,

Akshai

|||what is the name of that sample? I have SP2 final, but only samples under Microsoft SQL Server\90\Sample\Analysis Services are:

\Administrator\ActivityViewer
\DataMining\Data Mining Web Controls
\DataMining\SQL Server Data Mining Plug-In Algorithms
\Programmability\AMO
\Tutorials\Lesson4
\Tutorials\Lesson7

I checked the Programmability\AMO sample, but all it does is provide drilldown into properties. I can drill into aggregations but it's very laborious to use to find see which attributes each aggregation aggregates, because you would need to click 2 times on each dimention in each aggregation to see which attributes it affects. I did not see an ability to create a new aggregation or change an aggregation.

Did I miss something?
Where is the sample that Edward and you mention ?|||

It's called AggregationManager and is under Administrator/AggregationManager.

I don't think the samples are included in the main SP2 download. I think you have to download them separately. The SQL Server sample are now all available from codeplex. The download page for the SSAS samples is here http://www.codeplex.com/MSFTASProdSamples/Release/ProjectReleases.aspx?ReleaseId=2461

The AggManager sample only works with a deployed database. I am looking to add support for this tool directly in BIDS through a project I am working on at www.codeplex.com/BIDSHelper. I hope to get an initial beta release out in the next week or two if you are interested.

Monday, March 19, 2012

a text file data source

I would know how to create a report which has as data source a text file

someone can help me?

Hi Maaloul-

To retrieve data directly from a text file, you would need to implement your own custom data extension. A sample data extension can be found here:

http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5

-Jon

|||Another option is to create an ODBC connection to the text file. This has been written up several times.

a text file data source

I would know how to create a report which has as data source a text file

someone can help me?

Hi Maaloul-

To retrieve data directly from a text file, you would need to implement your own custom data extension. A sample data extension can be found here:

http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5

-Jon

|||Another option is to create an ODBC connection to the text file. This has been written up several times.

A text file data source

Hi all,
I have to write a report that uses a .txt file as a data-source and I
am not sure how to do that.
Anyone know where I can find out how to set this up? ODBC Connection?
The .txt file format is like this...(top 5 rows)
20040881 2004/12/22 01:30:12 NONIMPACT
20040883 2004/12/22 15:02:12 NONIMPACT
20040884 2004/12/22 17:52:12 NONIMPACT
20040885 2004/12/23 11:20:12 NONIMPACT
20040891 2004/12/23 15:10:12 NONIMPACT
and so one....
Any help would be great!!!!!!!!!!!!
Thanks, KerrieI've never tried to reach a flat text file, but I do not think that SRS
supports connecting directly to a flat file...(correct me if I am
wrong).
You may have to write your own data processing extension that can
connect to the files you want and extract the data therein. Hope this
helps!
Lance M.
Kerrie wrote:
> Hi all,
> I have to write a report that uses a .txt file as a data-source and I
> am not sure how to do that.
> Anyone know where I can find out how to set this up? ODBC Connection?
> The .txt file format is like this...(top 5 rows)
> 20040881 2004/12/22 01:30:12 NONIMPACT
> 20040883 2004/12/22 15:02:12 NONIMPACT
> 20040884 2004/12/22 17:52:12 NONIMPACT
> 20040885 2004/12/23 11:20:12 NONIMPACT
> 20040891 2004/12/23 15:10:12 NONIMPACT
> and so one....
> Any help would be great!!!!!!!!!!!!
> Thanks, Kerrie|||Create a linked data source of type CSV to the flat file and use it in
your report against the text file.
Lance M wrote:
> I've never tried to reach a flat text file, but I do not think that SRS
> supports connecting directly to a flat file...(correct me if I am
> wrong).
> You may have to write your own data processing extension that can
> connect to the files you want and extract the data therein. Hope this
> helps!
> Lance M.
> Kerrie wrote:
> > Hi all,
> > I have to write a report that uses a .txt file as a data-source and I
> > am not sure how to do that.
> >
> > Anyone know where I can find out how to set this up? ODBC Connection?
> >
> > The .txt file format is like this...(top 5 rows)
> > 20040881 2004/12/22 01:30:12 NONIMPACT
> > 20040883 2004/12/22 15:02:12 NONIMPACT
> > 20040884 2004/12/22 17:52:12 NONIMPACT
> > 20040885 2004/12/23 11:20:12 NONIMPACT
> > 20040891 2004/12/23 15:10:12 NONIMPACT
> >
> > and so one....
> >
> > Any help would be great!!!!!!!!!!!!
> >
> > Thanks, Kerrie

A strong SA password is required for security reasons?

When I try to install SQL Server I get the follwing message when I click on the installation file :

A strong SA password is required for securityreasons.

Please use SAPWDswitch to supply the same. Refer to readme

for more details.Setup will now exit.

I've checked the readme but can't really find any info on how to fix this.
I don't know what password this SA password is nor how to change it.
Can anyone help me out?Huh? [:^)]


It sounds like you are trying to set up MSDE. Instead of runningSETUP.EXE, you need to run SETUP.EXE with a SAPWD switch, somethinglike this:
setup sapwd="astrongpassword" securitymode=sql

|||Thanks for the help but there are just a few things I want to know about what you said.
1.How do I run this switch. By going to Start->Run and then typing in the switch?
2. Where you said sapwd="astrongpassword". Can this be any password or is this some existing password?
Smile [:)]
|||

What steps are you taking to do the installation?

Do you have the readme file that came with the MSDE installation files?

It should really explain how to do all of this. You are likelyrunning a .bat file in which one of the lines being executed issetup.exe. This is the line to which the switch should beadded. Something like this:

setup SAPWD="AStrongSAPwd" SECURITYMODE=SQL

According toSecurity Rulesa strong password is:

at least seven characters long|||

Hi,

Looks like you got some good advice already. I just wanted to add a caution that you'll likely need to consider soon enough. While having a strong (harder to crack) PW is important, youdon't everwant to use the sa (System Administrator) account when creating your ASP.NET applications. There are other "users" that you'll be able to have access your DBs. ASP.NET has a worker process that acts as a user on behalf of ASP.NET applications. It's called ASPNET (though you'll need to use NETWORK SERVICE if you're using IIS 6). In any case, you can look up those terms when the time comes.

Hope it helps. BRN..

|||

Hi,

I changed the sa PWD on my system just a while ago. I noticed that it would not accept spaces in the PWD. I generally like to use pass phrases now, as they're easier for me to remember. Not having spaces makes it awkward. Wonder why windows and SQL Server differ on that? Do you happen to know why? BRN..

|||Thank you very much for the help as I got the problem sorted out as you suggested.

Sunday, March 11, 2012

a stored procedure in C# creates a file (the file cant be deleted)

hi,
I wrote a dll in c#. It creates a bitmap file. the dll is appended to sql
server 2005 as an assembly. when I call that stored procedure it creates a
bitmap file on my local disk. the problem is, that the file cant be deleted.
I get error saying that the file is being used by another person or
application. but it isnt!. moreover, when I create an exe file and launch it,
everything works ok. then, the exe creates the bitmap which can be easy
deleted.
how to check what application is using the bitmap (a resource)? what is the
difference in creating the bitmap by launching a stored sql procedure than by
launching an exe application?
Hello Chris,
FileMon from WinTernals comes to mind. See http://www.winternals.com/
Chances are that the SQL Server is holding a lock on that file because you
didn't close the file handle on it. Can you post the bit of code that writes
the bitmap to the file?
Thanks,
Kent Tegels
DevelopMentor

a stored procedure in C# creates a file (the file cant be deleted)

hi,
I wrote a dll in c#. It creates a bitmap file. the dll is appended to sql
server 2005 as an assembly. when I call that stored procedure it creates a
bitmap file on my local disk. the problem is, that the file cant be deleted.
I get error saying that the file is being used by another person or
application. but it isnt!. moreover, when I create an exe file and launch it
,
everything works ok. then, the exe creates the bitmap which can be easy
deleted.
how to check what application is using the bitmap (a resource)? what is the
difference in creating the bitmap by launching a stored sql procedure than b
y
launching an exe application?Hello Chris,
FileMon from WinTernals comes to mind. See http://www.winternals.com/
Chances are that the SQL Server is holding a lock on that file because you
didn't close the file handle on it. Can you post the bit of code that writes
the bitmap to the file?
Thanks,
Kent Tegels
DevelopMentor

a stored procedure in C# creates a file (the file cant be deleted)

hi,
I wrote a dll in c#. It creates a bitmap file. the dll is appended to sql
server 2005 as an assembly. when I call that stored procedure it creates a
bitmap file on my local disk. the problem is, that the file cant be deleted.
I get error saying that the file is being used by another person or
application. but it isnt!. moreover, when I create an exe file and launch it,
everything works ok. then, the exe creates the bitmap which can be easy
deleted.
how to check what application is using the bitmap (a resource)? what is the
difference in creating the bitmap by launching a stored sql procedure than by
launching an exe application?Hello Chris,
FileMon from WinTernals comes to mind. See http://www.winternals.com/
Chances are that the SQL Server is holding a lock on that file because you
didn't close the file handle on it. Can you post the bit of code that writes
the bitmap to the file?
Thanks,
Kent Tegels
DevelopMentor

a sql datatime question..

according to sql 2k book online
Date and time data from January 1, 1753 through December 31, 9999
what if a couple of records in a huge data file actually have dates
backed to 1500 (and those are actual and valid publication dates), what
should i do? I want to be able to query the data by datetime, and don't
want to use varchar just for a couple of records, but at the same time,
i couldn't bring in the records with a record dated in 1500. is there a
work around?
thank you.=== Steve L === wrote:
> according to sql 2k book online
> Date and time data from January 1, 1753 through December 31, 9999
> what if a couple of records in a huge data file actually have dates
> backed to 1500 (and those are actual and valid publication dates),
> what should i do? I want to be able to query the data by datetime,
> and don't want to use varchar just for a couple of records, but at
> the same time, i couldn't bring in the records with a record dated in
> 1500. is there a work around?
> thank you.
Since you don't want to use a varchar column, how about encoding the dates
in this column by adding a couple thousand years to them before storing
them?
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.|||The data type datetime does not hold dates earlier than 1753 because of
the major changes that occurred in the calender system (in many
countries) in 1752. Because of that, IMO it would not be a good idea to
try to force it into a datetime column with some kind of workaround.
My advice would be to use a char(8) definition (a suggestion you already
rejected), use the format yyyymmdd when entering dates, and use a
constraint to enforce the format. For example:
CHECK ( MyDate LIKE Replicate('[0-9]',8) -- just digits
AND Floor(CAST(MyDate as int)/10000) BETWEEN 1000 AND 2099 --
year
AND Floor(CAST(MyDate as int)/100)%100 BETWEEN 1 AND 12 --
month
AND CAST(MyDate as int) %100 BETWEEN 1 AND 31 --
day
)
For dates >= 1753, you can safely cast these values to datetime. Also,
this format allows sorting on the column and range selections.
Hope this helps,
Gert-Jan
=== Steve L === wrote:
> according to sql 2k book online
> Date and time data from January 1, 1753 through December 31, 9999
> what if a couple of records in a huge data file actually have dates
> backed to 1500 (and those are actual and valid publication dates), what
> should i do? I want to be able to query the data by datetime, and don't
> want to use varchar just for a couple of records, but at the same time,
> i couldn't bring in the records with a record dated in 1500. is there a
> work around?
> thank you.|||thank you guys..
but that sucks.
i'm using the bulk insert to bring in library of congress data.(they
are huge)
i believe there are only a handful of publication dates are in 1950s
but that failed the process if i declare it as datetime datatype
(which is what i really want). i don't think i can do any
transformation in the bulk insert as suggested.|||Steve,
Basically you are out of luck here, but there is something you can do.
Create a temp table, bcp into it with the char date format and then massage
the date as the format you'd like to see while importing into a permanent
table. Possibilities include the ones mentioned in the previous replies on a
classic approach of having 3 integer fields for year, month and day.
Ilya
"=== Steve L ===" <steve.lin@.powells.com> wrote in message
news:1107196701.961705.64680@.f14g2000cwb.googlegroups.com...
> according to sql 2k book online
> Date and time data from January 1, 1753 through December 31, 9999
> what if a couple of records in a huge data file actually have dates
> backed to 1500 (and those are actual and valid publication dates), what
> should i do? I want to be able to query the data by datetime, and don't
> want to use varchar just for a couple of records, but at the same time,
> i couldn't bring in the records with a record dated in 1500. is there a
> work around?
> thank you.
>

Tuesday, March 6, 2012

A Search for SQLFiles

Someone at my job who was a IT Professional before me wrote a SQL
statement. That statement or file is working with a program that we
use called Papervision and the purpose of that SQL is to assign data
to a table. I need help on how to locate this SQL file. I know it is
running because it is working with the program papervision but it is
not working correctly. Is there any easy way to locate SQL files off
the server we are using?On Mar 13, 1:14 pm, "The Man" <LeJon7...@.gmail.comwrote:

Quote:

Originally Posted by

Someone at my job who was a IT Professional before me wrote a SQL
statement. That statement or file is working with a program that we
use called Papervision and the purpose of that SQL is to assign data
to a table. I need help on how to locate this SQL file. I know it is
running because it is working with the program papervision but it is
not working correctly. Is there any easy way to locate SQL files off
the server we are using?


Yes. Try the following:

On the server click "Start" and then choose "Search."
In the box that opens, where is says "All or part of the file name"
enter *.sql
Where it says "Look in" select "Local Hard Drives"
Click the button that says "Search"

Then just wait for the results.|||On Mar 13, 11:14 pm, "The Man" <LeJon7...@.gmail.comwrote:

Quote:

Originally Posted by

Someone at my job who was a IT Professional before me wrote a SQL
statement. That statement or file is working with a program that we
use called Papervision and the purpose of that SQL is to assign data
to a table. I need help on how to locate this SQL file. I know it is
running because it is working with the program papervision but it is
not working correctly. Is there any easy way to locate SQL files off
the server we are using?


What is papervision? Are you familiar with this product? Maybe the sql
is located somewhere within this app.|||On Mar 14, 4:56 pm, othell...@.yahoo.com wrote:

Quote:

Originally Posted by

On Mar 13, 11:14 pm, "The Man" <LeJon7...@.gmail.comwrote:
>

Quote:

Originally Posted by

Someone at my job who was a IT Professional before me wrote a SQL
statement. That statement or file is working with a program that we
use called Papervision and the purpose of that SQL is to assign data
to a table. I need help on how to locate this SQL file. I know it is
running because it is working with the program papervision but it is
not working correctly. Is there any easy way to locate SQL files off
the server we are using?


>
What is papervision? Are you familiar with this product? Maybe the sql
is located somewhere within this app.


I got some idea from your other post regarding asking for 'SQL Help'.
It seems that your app scans invoices and puts them into sql server
and when you tried to import new data (to match and merge) it failed
with an ODBC error. Your best bet is the product support help. Also,
the server might have some tables that store your invoices (scanned)
with all the information. You might want to find out from QA under
database-tables and view the data itself and might want to get to the
data itself using Enterprise Manager!