.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Management Studio extract to flat file tool outputs dates with 9 digits after the point (unparseable

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :Sql Server


I hope this is the right forum for this. I tried exporting data from a table using this procedure:

  • SQL Server Management Studio -> Right-click on database -> Tasks -> Export Data...
  • Source: SQL Server, Destination: Flat File destination (delimited).

The data was correctly exported, but when I try to parse the file using FileHelpers, DateTime.ParseExact() fails for any date with non-integer seconds: I discovered the decimal part of the number of seconds has 9 digits, while DateTime.ParseExact() accepts only up to 7 digits, even with a custom format.

//The output date has the following format, and I can't:
// either find a format that accepts it,
// or prevent SQL server from outputting all those digits.
 "2010-10-12 16:21:10.960000000",
 "yyyy-MM-dd HH:mm:ss.FFFFFFFFF", //This doesn't work
//A FormatException is thrown.

View Complete Post

More Related Resource Links

Inserting a row on an extract flat file

Hi, I want to add in a header row to an extracted file. The file contains 5 columns of data but I only want to add in a 5chr id (stored in a variable) in the very first line of the extracted flat file.. please can you assit and tell me the best way of doing this..

Can't save SQL Server Management Studio sql file back into Sharepoint Document Library

I created an sql query file in SQL Server Management Studio and saved it onto my hard drive.  I then moved that file into a Sharepoint Document Library so others on my team could use that query.I opened the file from within sharepoint, it launched SSMS.I made a change to the file and pressed save.here is the error message that comes up."The operation could not be completed.  The process cannot access the file because it is being used by another process"Am I doing something wrong?

Problem trying to attach database file to Microsoft SQL Server Management Studio

I was trying to attach a database to SQL Server MGT Studio and got an exception error.  The message stated that the database file I was trying to attach could not be opened because it was version 661.  The SQL Server shows to support version 655 and earlier.  It states that a downgrade path is not supported. Question:  Is there some download ; fix; I can make to SQL Server 2008 that will allow me to attach the version 661????  I am not technical at all.  Please speak slowly.  :)  Thanks

SQL Server Management Studio crashes when browsing to open a file...


SSMS has started crashing on me frequenly in the last 24 hours--perhaps related to the latest round of updates?  It always happens when I'm attempting open a file and browsing to it.  This behavior seems new.


This is the dialog box I get:



Dialog: Microsoft SQL Server Management Studio


Microsoft SQL Server Management Studio has encountered a problem and needs to close.  We are sorry for the inconvenience.


If you were in the middle of something, the information you were working on might be lost.


DEBUG button                                                              CLOSE button



Current sta

Can't find "Recent files" in File menu SQL Management Studio 2008


After installing SSMS 2008 the menu item File->Recent files   disappeared. I tried to add this item via Tools-> Customize. Now I can see it in menu "File" but it still doesn't work. I click on it but there is no result. What should I do to fix this problem. It is very inconvenient to open files with File->Open->File.

SQL Server Management Studio - File Encoding

I have been searching the forums for this issue and I haven't found anything on it so I apologize in advance if this issue has already been covered. My eyes are droopy and the coffee supply is low.

Is there a way to always save a file as UTF-8 or ANSI in SQL Server Management Studio? In analyzer you could save as ANSI, etc.

- d

Precision and scale from flat file with no decimal point


I can't figure out if "precision" and "scale" in flat files connection manager can give me an implied decimal. 

Say each record is an amount and a name:



The numbers represent 1.01 and 1.02

I would hope I could put in the flat file something to say the Scale is 2 and Precision is 5, and down-pipeline tasks would see 1.01 and 1.02.  I've tried dt_numeric and dt_decimal data types in my flat file connection manager advanced properties and tried setting DataScale to 2 and (in numeric, no such option in decimal) setting DataPrecision to 5, but the numbers just come out as 101 and 102 when I write them into an ODBC database. 


Would you expect this to work (I'm doing the right thing wrong) or is there something similar (I'm doing the wrong thing)?

In fact what I have is dozen of currency fields and percentages with no decimal points - old Cobol style data we get from competitors who won't change the format.  I realize that I could transform the field(s) but then that has to be done for each dataflow that uses the connection manager.


Can't attach my project database (.mdf file) using SQL Server Management Studio R2

Hi.  I've encountered a strange issue in SQL Server Management Studio (not the express version).  I had to uninstall SQL Server 2008 Developer in order to install SQL Server 2008 R2 Developer.  As a result of doing this, the database from one of my ASP.NET MVC projects is not attached to the database server.  I see the ".mdf" file in my project's AppData folder in Windows Explorer, but I can't navigate to it in SQL Server Management Studio.  I go to "C:\Users\<my name>" and the attach database interface will not let me go any further.  The folder that I need to access is "C:\Users\<my name>\Documents\Visual Studio 2010\NerdDinner\NerdDinner\App_Data".  How can I access this directory from SQL Server Management Studio?  Is there some sort of strange permission issue?  Thanks in advance for any help.

Toolbox: Easy File Backup, Exploring Files And Folders Inside Visual Studio, Multiple Monitor Softwa


If the responsibility for creating, managing, and executing routine backups is yours, these tools will make it easier. Also see how you can browse folders and files from inside Visual Studio.

Scott Mitchell

MSDN Magazine May 2009

Resource File: Windows Media 9 Series Digital Rights Management


If you have an application that handles Windows Media content and you need an effective way to track content usage, Windows Media 9 Series now offers Digital Rights Management (DRM). It allows you to take advantage of the peer-to-peer distribution model and still redirect users back to your app once they have downloaded your content (prior to viewing).

MSDN Magazine May 2003

Bug Tracker: Build a Configurable Web-Based Bug Management Tool Using ADO.NET, XML, and XSLT


One of the most significant features of ADO.NET is its integration with XML. Developers can either use an ADO-like API to access the data or work directly with an XML representation of the data. This article demonstrates how both of these techniques can be used together to create Web applications that take advantage of XML standards such as XSLT. The example presented here is a bug tracking application built using C# and the.NET Framework. The development of the application covers several topics including data access using ADO.NET, the presentation of data using XSLT stylesheets, and the integration of ADO.NET with the .NET XML Framework.

Roy Margolis

MSDN Magazine July 2002

Scripting Windows: Windows Management Instrumentation Provides a Powerful Tool for Managing Windows


The new Windows Management Instrumentation (WMI) technology for Windows 2000, Windows NT 4.0, and Windows 98 provides powerful scripting technology that can be used to administrate Windows-based systems. With WMI, you can create scripts to simplify management of devices, user accounts, services, networking, and other aspects of your system. This piece will introduce you to WMI and the WMI Scripting Object Model, taking a look at the available objects, methods, and properties. Along the way, you'll see how these elements can be used to create system management scripts.

Alan Boshier

MSDN Magazine April 2000

Create table in the database using management studio


 I have database already on the server. However, when I created new table, the new created table Schema is not dbo. it is my user name. How to solve this?

It shows the new created table Schema is my username but not dbo.

Even though I rename it, it couldn't change. I can see this in table property.



SQL Server Management Studio


Hi folks


Am sorry if this mght be abit silly question am a Novice Developer.

If am using Visual Studio 2008 Pro, Do I need SQL Server Management Studio? or is it included in the VS 2008 Pro Suite? Am learning C# and SQL Server.



How to connect to local instance of SQL Server 2008 Management Studio Express ?


I just installed SQL Server 2008 Management studio Express on my Vista machine.

i tried connecting to local machine using :

.\sqlexpress, (local)\sqlexpress, or .\SQLExpress, MyPCNAME\SQLExpress

nothing is working, getting this error:

Cannot connect to PC-NAME\SQLEXPRESS. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Tables not showing in Management Studio Express


Hi all

(needing help!)

Have used Visual Web Developer 2008 to make ASP application, with SQL server 2008 R2 Express for database. Works very nicely.

However, when I come to use Management Studio Express 2008 R2, I cannot see all my tables.

The ones I CAN see were created by the MS script that creates membership tables (and are called dbo.aspnet_membership etc), presumably because the owner of the tables was specified as 'dbo'.

The ones I can't see from Management Studio are the ones I created. I never specified an owner.

I think this is a permissions issue, but I can't fathom it. There's only ever been me on my development machine (laptop) doing it all, hence always the same log ins.

Running Management Studio as Adminstrator doesn't help.

I can't even ask Management Studio who own's the tables that I can't see because Management Studio can't see them so rejects the script.

Any ideas/links very (very) welcome !


**** Actually, it is even wierder. The tables in Management Studio have full structure, but are empty. But if I look at them in Visual Basic 2008 they are full !!!  And...if I create a table in Management Studio it does not appear at all in Visual Basic, and likewise, a table created in Visual Basic does not appear at all in Management

Can Not load WPF project in Visual Studio 2005 on Win7 64 system, says "Project file not supported b

Dear all I am facing an issue in creating new wpf project or loading a WPF project in Visual studio 2005. I have installed Visual Studio 2005 Service pack - 1 (http://www.microsoft.com/downloads/details.aspx?familyid=bb4a75ab-e2d4-4c96-b39d-37baf6b5b1dc&displaylang=en) but still I can not see the option for wpf project  while creating a new project. Generally we can see WPF listing under item File -->New-->Project--> ".Net Framework 3.0" in VS 2005. I have few WPF project and when i try to load them it says "Project file not supported by this Installation". My System Config is given below: OS: Windows 7 (64 Bit) VS: Visual Studio 2005 with Service Pack 1 .Net Framework: 3.5 (By default inbuilt in Win7 OS)   I am suspecting something bugging related to .Net framework 3.0 in Win7. We have one option in control panel to alter .NetFramework 3.5 under "Turn Windows Features on or Off" but there I can not see something related to 3.0 :-(.   Kindly suggest how can I load my existing project and how can enable option to create new wpf Projects.   I saw few solutions suggested by people on following Thread bt most of them related to Windows XP or Vista: http://social.msdn.microsoft.com/Forums/en/vswpfdesigner/thread/06cf7bca-982c-44cf-aec9-99cf399b3000 Do someone has solution for Windows 7 (64 bit OS)
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend