I am having trouble with BCP. I get the same error with xp_cmdshell as I do with entering bcp as a DOS command. I have checked and rechecked the file names and permissions and even restart the PC.
Does BCP even work when SQL Server 2005 Express on a PC?
declare @sql varchar(8000)
select @sql = 'bcp SYMITAR..ACCOUNT in C: estEXTRACT.ACCOUNT -T -f C: estACCOUNT.FMT -S'+@@servername
exec SYMITAR..xp_cmdshell @sql
GO
Volume in drive C has no label.
Volume Serial Number is 08E5-2414
Directory of C: est
02/13/2007 08:44 AM <DIR> .
02/13/2007 08:44 AM <DIR> ..
08/31/2006 09:11 AM 27,503,161 EXTRACT.ACCOUNT
08/31/2006 09:12 AM 6,879 FMT.ACCOUNT
02/07/2007 08:46 AM 220 ACCTTYPE.FMT
02/13/2007 08:44 AM 0 filelisting.txt
02/07/2007 08:33 AM 220 ACCTTYPE.xml
5 File(s) 27,510,480 bytes
2 Dir(s) 54,344,847,360 bytes free
Could the fact that it's actually pulling BCP from c:Program FilesMicrosoft SQL Server80Toolsinn be a problem? I know this because it doesn't recognize the -x extensionof the bcp command.
I added the c: est to the path and removed c:Program FilesMicrosoft
SQL Server80Toolsinn from the path. While it recognizes the -x
extension now it still gets the same error message:
SQLState = HY000, NativeError = 0
Error = [Microsoft][SQL Native Client]Unable to open BCP host data-file
NULL
I have checked file names, and I have checked permissions on the files. I do not see any reason why the BCP should fail. Any ideas how I can debug this further?
Unable to open the physical mdf file or log file because it is being used by another process
I am trying to write a Windows Application using ASP.NET 2.0, C#2005 EXPRESS, and SQL 2005 EXPRESS.
I had followed the introductory video to create a connection to the Database using Windows Authentication, and use the wizard to create a dataset and checking all the tables in the database.
After that I dragged a table from the data source created from the above process. The Details Grid so created is able to perform update, delete and addition of records.
But when I went back to the database at my PC I wasn€™t able to connect to the database. And if I opened the database first and then load the windows application and perform some database operations and went back to the physical database I wasn€™t able to open the tables in the database.
The error message is that the physical database connection cannot open the .mdf file or log file because another process is using the database. I guess it refers to the Windows Application.
Is this normal? Will it have any implications after the application is deployed? I suppose that there isn€™t a scenario where a Windows application and a physical process will access the database at the same time.
Will appreciate some feedback and advice on this scenario and whether it is a problem.
Hi, i'm trying to interface a c# application with an sql database created with Visual Web Developer Express. I have published the site (and the db) on iis 5 (xp pro). Everithing goes fine on accessing the database from internet,but when i try to connect the db while it's opened with my c# program i keep an error in the sqlconnection open command: Unable to open the physical file "C:myApp_Datamydb.mdf". Operating system error 32: "32(The file is in use by another process.)". My connection string from webconfig: <add name="MYDBCS" connectionString="Data Source=.SQLEXPRESS;Database="C:myApp_Datamydb.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient" /> .....and the connection string for the c# program: "Data Source=.\SQLEXPRESS;Database=c:myapp_datamydb.mdf;Integrated Security=False;Connect Timeout=30;User ID=abc;Password=abc;Trusted_Connection=False;"; I have used a user to connect the database because there was a conflict trying to open the db with Integrated Security=True.
Does anyone have an idea where is the error? Many thanks Max
Scenario : I have VC++ 2005 Express IDE open and use the database explorer to browse tables in a database. Then I open SQL Server Managament Studio Express and try to browse the same database. I get "Unable to open the physical file ... The process cannot access the file because it is being used by another process".
What is this "other process" that is trying to open the file? I thought the whole point of a database server was that clients talk to the server, and the server accesses the physical file. So only one process should be accessing the file. Do VC++ IDE and SSMSE work directly with the physical file, or do they channel their requests, etc. through the server.
Hi, I've just finished creating my first ASP.NET website. I created it on my laptop and it works perfectly, but I'm having some problems deploying it to my web server (PC).The site works ok, but when I try to log in to my client area, I get this error: "Unable to open the physical file "c:inetpubwwwrootONeillStrataApp_Dataaspnetdb.mdf". Operating system error 5: "5(Access is denied.)".An attempt to attach an auto-named database for file c:inetpubwwwrootONeillStrataApp_Dataaspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share." I've searched far and wide for a solution and have read many articles, but none seem to be able to fix my problem. I've tried using that SEUtil tool, but that didn't work, I've made sure the App_Data directory on the web server isn't read only (the read-only checkbox isn't ticked, but it DOES have that little green square which I can't get rid of), I've assigned the ASPNET user as a db owner and that didn't work and I've manually attached the database to the web server's instance of SQL Express 2005.When I launch the solution in VS2005 on the web server, I can browse through the database and see the tables and data etc, but when I try to run the application, I get that message above... Surely it shouldn't be this hard to get it going?Any help would be massively appreciated.
I am running sql script inside job.But sql is not saving the results in the file which i specified ('Unable to open Step output file'). I tried same thing on different server, it works fine.
Both are are 2008 R2. Is there any server level setting that i have to look at.On both servers i logged in as sa.
Well, I'm to the point of giving up. If there was a 1-800 # that charged $400 /minute for support at this point I would pay it! I have been developing an ASP.net 2.0 web application that basically has login security. I have been struggling to get this thing to work. On my local machine it works fine, but when I copy the code (including the ASPNETDB.mdf that is in the APP_Data directory) over to a web server, I get to the login screen but when I attempt to login I get an error. I've tried using the SSEUTIL.exe and was unsuccessful. At this point I don't even know where to start. Can someone please help me??? The error is listed below: Server Error in '/' Application.
Unable to open the physical file "C:InetpubWIWebApp_Dataaspnetdb.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".Unable to open the physical file "C:InetpubWIWebApp_Dataaspnetdb_log.ldf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".Cannot open user default database. Login failed.Login failed for user 'NT AUTHORITYNETWORK SERVICE'.File activation failure. The physical file name "C:InetpubWIWebApp_Dataaspnetdb_log.ldf" may be incorrect. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Unable to open the physical file "C:InetpubWIWebApp_Dataaspnetdb.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".Unable to open the physical file "C:InetpubWIWebApp_Dataaspnetdb_log.ldf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".Cannot open user default database. Login failed.Login failed for user 'NT AUTHORITYNETWORK SERVICE'.File activation failure. The physical file name "C:InetpubWIWebApp_Dataaspnetdb_log.ldf" may be incorrect.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
[SqlException (0x80131904): Unable to open the physical file "C:InetpubWIWebApp_Dataaspnetdb.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)". Unable to open the physical file "C:InetpubWIWebApp_Dataaspnetdb_log.ldf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)". Cannot open user default database. Login failed. Login failed for user 'NT AUTHORITYNETWORK SERVICE'. File activation failure. The physical file name "C:InetpubWIWebApp_Dataaspnetdb_log.ldf" may be incorrect.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +684835 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +207 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1751 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +32 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +601 System.Data.SqlClient.SqlInternalConnectionTds..ctor(SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +159 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +346 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +445 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +304 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +126 System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +239 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved) +815 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +80 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +78 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +161 System.Web.UI.WebControls.Login.AttemptLogin() +94 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +134 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5670
Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET Version:2.0.50215.44
I have a SQL Server 2005 database file (a .mdf file) that I am trying to open in SQL Server Management Studio so I can add a field to a table, but I am unable to open the file. I can't say that I really understand how SQL Server handles these databases. I especially don't understand the "attaching" and "detaching" operations.
I am working in VB.Net 2008 now, but my background is with VB6 using the JET engine. It was just so straightforward using the JET engine, but seems so much more complicated with SQL Server. I am trying to use .mdf files the same way I used .mdb files. I want my application to find the database file, "attach to it", and let me manipulate it.
At one time I was able to open my database in Sql Server Management Studio and edit the design of the database. The application still works but I am no longer able to modify the database because I cannot attach to it in Management Studio.
Here is a big clue: the files are no longer in the special folder anymore, which is c:Program Files (x86)Microsoft SQL ServerMSSQL.2MSSQLDATA. I might have deleted the files, stupidly, thinking they were redundant. I still have the .mdf file (and the _log.ldf file) on my hard drive and the application can still open it, but when I try to use Management Studio to attach to the .mdf file, I get this error:
Microsoft SQL Server Management Studio Express
An error occurred when attaching the database(s). Click the hyperlink in the Message column for details.
here are the details:
Unable to open the physical file "c:Program Files (x86)Microsoft SQL ServerMSSQL.2MSSQLDATAHEALSExamsSQL.mdf". Operating system error 2: "2(The system cannot find the file specified.)". (.Net SqlClient Data Provider)
Indeed the file is not there, but why is Mgmt Studio looking there? Why doesn't it just open the file where it is? What can I do to get it back? I even copied the files to c:Program Files (x86)Microsoft SQL ServerMSSQL.2MSSQLDATA? I get the same error.
Here is another clue: In Management Studio, when I right-click Databases, and chose Attach, it brings up a dialog. There I click "Add" to get another dialog in which I will select a database, but before the dialog appears I get this error:
Locate Database Files - KURANT-WIN7SQLEXPRESS C:UsersJason KurantDesktop Cannot access the specified path or file on the server. Verify that you have the necessary security privileges and that the path or file exists.
If you know that the service account can access a specific file, type in the full path for the file in the File Name control in the Locate dialog box.
I am working in a C# database application quick test where I basically use two types of access to an SQL Server Express database. In the first part of the code, I use the traditional connection declaring a SqlConnection. When I just use only this kind of connection I do not have any problem. The issue starts when I access to the same database using Data Bindigs at the same time. When I start the application I got and error as soon as the instruction goes to open the data base connection. The reported error is "Unable to open the physical file "<Niños.mdf>". Operating System Error 32: (Process does not have access to the file because is being using by another process)"
For additional information my connection string is:
I am running sql script inside job.But sql is not saving the results in the file which i specified('Unable to open Step output file'). I tried same thing on different server, it works fine.Both are are 2008 R2.Is there any server level setting that i have to look at.On both servers i logged in as sal. Why is it working on server1 ,but not on server2?
I am trying to attach a database to SQL 2005. This database has not previously been attached. I have only just installed SQL.  I get the following message: Unable to open physical file "C:ArrowSQLArr@DataArrow_data.mdf" Operating system error 5: "5(error not found)" (Microsoft SQL Server: Error 5120)".  I have loaded SQL and the database fiel and directory with the same user account which is a local administrator on this machine. I have checked that I have read/write access to the file.  The machine runs Windows Vista Business. SQL has SP 2 loaded. What causes this?
We are trying to attach a database in Sql Server 2005 Express on Windows Vista.It will Show the following Error.
"Unable to open the physical file "Test.mdf". Operating system error 5 :". And then we installed the SQL Server 2005 Service pack 2. This error again comes.Could you please give me the steps to resolve the problem.
Post installation of SQL Server 2014 Express edition, I am able to connect to the Database Instance.
But while opening a new query window in SSMS or opening a table getting the error:
Package 'RadLangSvc.Package, RadLangSvc, Version 12.0.0.0, Culture=Neutral, Public Token=89845dcd8080cc91' failed to load
Object reference not set to an instance of an object. (mscorlib)..Have already tried installing the componentsDACProjectSystemSetup_enu.msi, TSql LanguageService_enu.msi, DACFramework_enu.msi from path VS 2010 WCU DAC.
I am running my package in sql server 2012, in which i am giving network path for flat file destination. And its working fine. But if i give m local path, its giving me  error " cannot open data file" ...
I have seen several problems posted where an SSIS package writes a file successfully when executed manually, but fails when executed via SQL Agent job..I have the opposite problem. I'll try to lay it out succinctly: SSIS writes to a file on a shared folder, specified as HostAShare, for example. I created the share and gave full control to Everyone (out of frustration).I'm working from HostA via RDP, connected to the DB on DBHost via SSMS.If I kick off a SQL Agent job that executes the package, it works fine. (SQL job is running under SQL Server Agent Service Account).If I execute the job interactively (logged in to SSMS with Windows Auth), it fails with "Error: Cannot open the datafile "HostASharefilename.ext""We did find that if I RDP directly to the DBHost, I am able to execute manually.Also, if I try executing an xp_command shell command to write a file to the share, it works. (When RDP's into HostA with an SSMS connection to DBHost under my windows domain auth, as above.)The problem is the same when I RDP to any remote host.
I don't know why my application on the internet try to access the SQL Server 2005, when the host still having the 2000 edition. I put the following connection string: Data Source=##DBSERVER##;Initial Catalog=##DBNAME##;User ID=##DBUSER##;Password=##DBPASSWORD##;
Isn’t everything fine with that? I created the table by host but dosen’t work. I’m wondering if can I conect straight with Data Base, without register in the server, like with mdb?
This is the error that I’m getting. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I recently installed standalone version of SQL 2014 Standard on my work computer. I used Access before but I want to use a SQL server instead.
We have a shared drive that a file gets deposited every day at midnight. I want to be able to get this file and import it to the server (its basically a list of names).
Here what I have done so far:
I created the database
Created the file and successfully imported data into it using the Import Data feature.
I saved the SSIS package
Scheduled an Agent Job for this package to run at certain time,daily
At first the jobs would fail with a Access is Denied. I added a user under Credentials with my network account ( have admin rights on the work computer).Also added a Proxy for the Credential user I made.
Jobs fail with a “Cannot open data file” error. I tried changing things here and there, but I can’t get it to work.
I created a SSIS package which will generate an output file and place it on a remote fileshare location which will look something like this
\RemoteServerNameRemoteFilePath
The package is executing fine when I am executing it through BIDS or through execute package utility and writing the output file to remote file share location.
I created a SQL job for the package and ran the Job. Then, its throwing an error saying
Executed as user: DomainUser. Microsoft (R) SQL Server Execute Package Utility Version 9.00.3042.00 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 10:33:06 AM Error: 2008-03-10 10:33:22.22 Code: 0xC020200E Source: DFT_Generate Output File Description: Cannot open the datafile " \RemoteServerNameRemoteFilePathOutputFileName.txt". End Error Error: 2008-03-10 10:33:22.34 Code: 0xC004701A Source: DFT_Generate Output File DTS.Pipeline Description: component "FF_DST_Output" (160) failed the pre-execute phase and returned error code 0xC020200E. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 10:33:06 AM Finished: 10:33:22 AM Elapsed: 15.891 seconds. The package execution failed. The step failed.
DomainUser have all the permissions on the remote file share location. SQL server agent is running with the log-on account DomainUser(same as the above).
The error message that comes while I preview the source data:
Error:
"The Preview sample contains embedded text qualifiers. The flat file parser doesnot support embedding text qualifiers in data. Parsing columns that contain data with text qualifiers will fail at runtime"
Is there any alternative to remove these text qualifiers from the file. Do we have any utility that can convert these files into text qualifier free CSV file?
Hi all. I'm currently working with SQL Server 2K, and I've installed Analysis Services as well as SP4.
I previously wrote a DTS that had several FTP steps in it. I was able to view/edit/run this package until recently. We were testing out SQL Server '05, and when we uninstalled it, it really screwed up my install of SQL 2k.
Long story short, I've scrubbed the system and reinstalled SQL Server 2K, but am unable to open the DTS package. The error I get is:
Error Source: Microsoft Data Transformation Service (DTS) Package Error Description: Unspecified Error
Then a prompt that says: The selected package cannot be opened. The DTS Designer has been closed
I've googled like crazy, and have been unable to find any resolution on this. Any help would be greatly appreciated!
i have installed Microsoft SQL server 2000(evaluated version). I opened enterprise manager.and opened one of the default database.(Northwind).I clikced on the tables in the Northwind. On the right side of the console I right-clicked on one of the table and tried to open table--> Return all rows.. I am getting a message saying that "Provider cannot be found. It may not be properly installed". I tried to reinstall the sql server evaluated version. I installed it 3 to 4 times restarting my computer. But still its giving me the same problem. I am using Windows Xp OS. Do I need to take care of anything before installation. I even removed Office XP from my system thinking if that has anything to do with the installation. Please let me know as soon as possible. One last question, is this a very rare problem or is the problem only with me. Because I couldnt find a solution as nobody is giving me a reply.
I'm working on a report to show financial transactions from a table over a certain period. For most transactions there is a PDF document that is stored in a separate table in a binairy format. In my report I would like to include a link on every line with transaction information in the report that opens the PDF that is linked to that transaction. Just to be clear, I don't want to embed the PDF in the report but I want the users of the report to have the option to view the PDF that is related to that transaction in their standard pdf reader (adobe).
Code to do the following:
Once a user clicks on the link to view the PDF I need the code to get the binairy data of the PDF file from the table, convert it back to a PDF and open it in the default pdf reader (for example adobe reader). If it can't directly open the file then it's maybe possible to activate the 'open or download' pop up that you also get when you download something from a website.Â
I have just downloaded an evaluation version of SQL server from the microsoft website and installed it in my PC.
Now I want to create file data source.
I followed these steps: -From the control panel, ODBC datasource admin -click the DSN tab -click the add button -select the sql server driver, enter the data source file name -enter "local" in the server text box as I installed the sql server in my standalone PC. -click next After that I had this error. "Connection failed. SQL server does not exist or access denied."
But The sql server service is running.
Can anyone help me where did my configuration go wrong?? Thanks...
Hi All, When i try to open tables under any database i get an error message that says " An unexpected error happened during this operation. [Query] Query designer encountered a Query error: Unspecified error". I uninstalled the Client from my desktop and reinstalled the client.When i try the same operation on the server where the SQL server is installed, i get the same error message. I have sp2 installed.Would it help if i install sp3?
In my machine i am unable to open .sql files. I am trying to open . Sql files it gives error message Windows can't find program.exe. This program is needed for openings files of type"SQL script file"
Any body tell me which file i have to install. Thanks
I am getting this error when i clicked on configuration manager. "Cannot connect to WMI provider. You do not have permissions or the server is unreachable. Note that you can only manage SQL server 2005 and later servers with configuration manager only."