I have an excel file with 2 rows that I am importing into a staging table. The format on the excel sheet is a custom one which is DD-MMM-YY so in the actual cell the data appears as 01-NOV-07 and 30-OCT-07. The format of the data in the input window above the spreadsheet is 01/11/2007 and 30/10/2007.
The format in the Excel source of the data flow task is Unicode String [DT_WSTR] length 255. I then have a data conversion step that changes this to a string [DT_STR] length 255 as the staging table is non unicode. I then have a derived column function that simply does a ISNULL replace on NULL values to blank. Finally there is an OLE DB destination which is the staging table.
This is where the problem occurs. If I breakpoint the package here and look at the staging table the dates now read as 11/1/2007 and 10/30/2007. The data type in the staging table is varchar 255. I am not doing any other transformations or T-SQL stuff on the data - it is being flipped to MM/DD/YYYY during the import.
By the way I am english hence I need the english variation on the date. I know i could put some T-SQL in to flip it around to english again but wondered why it was happening like this
Hi, I have one column of data which is 15.678 but in the excel, i format it to 15.68 ( two decimal place, so in excel i should see 15.68), when i am trying to import the data from excel to sql server by using odbc connection, it still getting 15.678, how can i get the data from 15.678 to 15.68 ( what i see is wat i get). Thanks for help.
Hello, I have the following scenario, and my main question is why Excel Formatted file errors out while TXT formatted file does not? Any workaround would be helpful, but I do want to avoid dtexec, and still want to manage it as SSIS.
MAIN ISSUES - permission issue & excel connection issue
SSIS Package Run Directly (not SQL Job, not automated) * Every format and and folder location works!
Package Run under SQL JOB TXT Format A. Project Folder - GOOD B. Client Folder - FAILS! Conclusion - TXT Format works, but Client Folder does not have sufficient permission for PRODsvcSQLDMS
EXCEL Format A. Project Folder - FAILS! B. Client Folder - FAILS! Conclusion - EXCEL Format DOES NOT work. Maybe SSIS Excel Connection Bug.
Hi all,I have a huge excel format file wants to export to sql serverdatabase. One of the field has combination of numeric andalphanumeric. When I import the excel format to sql server database,the numeric is successfully imported but the alphanumeric does notimport at all.Does anyone know how to solve my problem?Thanks.-HS Phuah
I have a huge excel format file wants to export to sql server database. One of the field has combination of numeric and alphanumeric. When I import the excel format to sql server database, the numeric is successfully imported but the alphanumeric does not import at all.
Does anyone know how to solve my problem?
I am using SQL 2k and the spreadsheet is excel 2003
I have an Excel file(.xls) that I need to import to SQL Server database. I am trying to use the Import wizard. However, when I select the file and click next I get the warning "External table is not in the expected format.(Microsoft JET Database Engine)" . I opened the .xls file using a text editor. It looks like some html document.
Help!I have a table that has datetime format field, I exported the table toa csv while I dropped it and tried some other data, but now sqldoesn't recognise the date format for importing, heck I don't!The dates look something like:40:58.1Whick means nothing to me, or any of us here for that matter...Any ideas?John
Running into a very bizarre problem here. I'm querying a couple of tables based on a date range. Nothing fancy; simply stuff. The query runs fine when I hard-code the dates, but when I use variables, the query just hangs.
This works fine: SELECT AVG(DATEDIFF(ss, B.SomeDate, C.SomeDate)) FROM A WITH(NOLOCK) INNER JOIN B WITH(NOLOCK) ON A.BID = B.BID INNER JOIN C WITH(NOLOCK) ON A.CID = C.CID WHERE A.SomeDate>='2008-02-09 00:00:00.000' AND A.SomeDate<'2008-02-09 01:00:00.000' AND DATEDIFF(ss, B.SomeDate, C.SomeDate)<100000
This does NOT: NO clue why :confused: DECLARE @FromDate DATETIME , @ToDate DATETIME
SELECT AVG(DATEDIFF(ss, B.SomeDate, C.SomeDate)) FROM A WITH(NOLOCK) INNER JOIN B WITH(NOLOCK) ON A.BID = B.BID INNER JOIN C WITH(NOLOCK) ON A.CID = C.CID WHERE A.SomeDate>=@FromDate AND A.SomeDate<@ToDate AND DATEDIFF(ss, B.SomeDate, C.SomeDate)<100000
I'm currently having problems exporting formatted dates from reporting services 2005 to excel.
Basically what I require is a way to format a date in reporting services so that it only shows the date without the time (preferably british format) and when it is exported to excel it is still formatted as a date.
This is so the user can sort the data file via date, I appreciate it is easy to select the column and format the cells but i would prefer to have a 'cleaner' solution to this problem which avoids the need for users to be formatting exported reports.
Originally I was formatting the dates as convert(varchar,@date,103) in the SP which converts it to a character string and excel picks this up as a character as would be expected. So I changed this to a date and set about trying to format the date in Reporting Services, so far i've been unsuccesfull using cdate (brings back the time) and format as it again converts it to a character string.
I have created an package in SSIS and getting some problem when i am export date from OLEDB to Excel its format getting change. I am passing date format MM/dd/yyyy and its showing yyyy-MM-dd.
I am using vs 2010 and I have an .xls file that I am trying to import into SQL Server 2012, and I have most of it figured out, but I have a date field that is giving me problems, and what I would like to do is put that date in a variable so I can add it to every record in my SQL Table.
I am using a SQL Task Editor with an excel connection and I have no problem getting other data from the excel document and putting into my variable, its just the date that I have problems.
E.g, i have a store procedure. The start date is long date (4/15/2007 3:00pm). i want to select the start date with a particular date (short date format 4/15/2006). Thanks in advance.
I am trying get my VB6 application to insert a record into a table (SQL Express) which has a datetime column but it would not process if the data format is differ to *American Date format*.
The date() function in VB returns 15/11/2006 which is in Australian Date format (DD/MM/YYYY) according to my setting in "Reginal and Lanuage Option-> Locale 0> English (Australia)" setting.
I get the following error:
Msg 242, Level 16, State 3, Server KITSQLEXPRESS, Line 1 The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statement has been terminated.
My computer's locale is set to English (Australia) and I expect the datetime format would follow what is set in system locale
I've read an article somewhere on the net about how SQL 2005 eliminate the confusion of date conversion when read/write datetime records into a table...but it seems to me that it is still as in-flexible as MS Access
Is there a setting in the database that takes care of it?
Hi, I am trying to import a excel file in to my database... The improt works fine.. But some of the data is missing though it is present in the excel spread sheet.
I have some data for cusip which are 9 characters and they be a combination of numbers wiht a letter.. for eg.. 123456789 or 12345R789. And in the my spread sheet there are around 73 rows.. until the 62 row it has numbers like 123456789 and from the 62 to 73 it has 12345R789 this is an just example but the data is in that format.
I went to sqlServer 2005 and imported the data using Tasks -ImportData and selected my excel spreadsheet, the user name and password for the database and i selected the sheet i want to import.. and when i preview the data ... Until the 62 row i can see the numbers and after that i cannot see any data in that column.... and when i import the data from 62 row the value is NULL...
So can some please tell me what going on why isnt that data been recognised by the importer in sql server.
Hi, I am trying to import a excel file in to my database... The improt works fine.. But some of the data is missing though it is present in the excel spread sheet.
I have some data for cusip which are 9 characters and they be a combination of numbers wiht a letter.. for eg.. 123456789 or 12345R789. And in the my spread sheet there are around 73 rows.. until the 62 row it has numbers like 123456789 and from the 62 to 73 it has 12345R789 this is an just example but the data is in that format.
I went to sqlServer 2005 and imported the data using Tasks -ImportData and selected my excel spreadsheet, the user name and password for the database and i selected the sheet i want to import.. and when i preview the data ... Until the 62 row i can see the numbers and after that i cannot see any data in that column.... and when i import the data from 62 row the value is NULL...
So can some please tell me what going on why isnt that data been recognised by the importer in sql server.
I have a column date in my database which I should send it to Oracle database. The Date format in Oracle is number. I don’t know how should I convert the date to that format? Example : SQL FormatOracle Format 02/16/05 105046
I am trying to import an xlsx spreadsheet into a sql 2008 r2 database using the SSMS Import Wizard. When pointed to the spreadsheet ("choose a data source") the Import Wizard returns this error:
"The operation could not be completed" The Microsoft ACE.OLEDB.12.0 provider is not registered on the local machine (System.Data)
How can I address that issue? (e.g. Where is this provider and how do I install it?)
I have a simple query which has a parameter 'between @Start and @Finish' My user within the SQL management studio is set to British English. My report language properties are set to English (United Kingdom)
If I set the parameter to data type string and use start and finish of 31/12/2007, 30/12/2008 the report works fine. If I change the data type of the parameter to Datetime (to use the calander pickers) the date values are no longer valid.
Where else should I be looking for regional settings? Or is there another reason for this?
l've some excel files controlled by Vendor which changing frequently. The only thing does not change is the header name of each column.
So my question is, is there any way to create a new table based on the excel file selected including the column name in SSIS? So that l can use the data reader as source to select those columns l am interested on and start the integration.
I have date coming to one page as a string in the following format"May 4 2005 12:00AM" I need to query one of my tables using this date in combination of other nondate values. How can I convert this date into valid sql server datetime format before I query a database tables Please help
I've been googling this for a while now and can't seem to find any elegant answers.
I'm looking for an automated way to present a FORMATED Excel Spreadsheet to the Customer from a stored procedure output.
Can anyone advise me the best method of doing this - should I / can I assign an Excel Template to the DTS Task output ?
His mind is set on Excel and the formatting is basic and easy to write in a Macro which I've done, but this requires human interaction to finish the task (Automated Run Once on opening etc).
In an ideal world an individual would send an email to the Server with two formated parameters (@FromDate & @ToDate) and would be emailed back a ready formatted S/Sheet. But I believe he would be willing to just select the relevant SpreadSheet for the Daily / Weekly / Monthly periods dumped.
Hi,I have a problem with updating a datetime column,When I try to change the Column from VB I get "Incorrect syntax near'942'" returned from [Microsoft][ODBC SQL Server Driver][SQL Server]'942' is the unique key column valueHowever if I update any other column the syntax is fineThe same blanket update query makes the changes no matter what isupdatedThe problem only happens when I set a unique key on the date field inquestionKey is a composite of an ID, and 2 date fieldsIf I allow duplicates in the index it all works perfectlyI am trying to trap 'Duplicate value in index' (which is working onother non-date columns in other tables)This is driving me nutsAny help would be appreciated
A server with SQL 2005 sp2, Reporting Services and Sharepoint services (ver 3.0) (in integrated mode) gives an odd error. When viewing a Reporting Services report with a Date Time Picker, the date chosen is wrong. The preferred setting is Danish with the date format dd-mm-yyyy. The date picker shows the months in Danish but when selecting a date, and clicking on the Apply-button, the date reformats to US (mm-dd-yyyy).
Example: When choosing 5th of September 2007 and clicking apply, it shows in the picker, 9th of May 2007. When choosing 26th of September 2007 and clicking apply, it shows, again in US format, the RIGHT date but adds a timestamp 12:00 AM? in the end, making further enquiries to fail.
The report itself receives the right date and shows correctly. The only case it fails is, when the time stamp appears.
The server is a 32-bit one with 4 GB RAM. A testserver with identical collation on the Reportserver database cannot recreate the error. The site containing the reports has been set to Danish in the regional settings. To Reinstall is not an option.
The test report has no database connection whatsoever.
When setting the site to US, the timestamp wont appear at all.
The server has been restarted and the installation procedure was of the simple kind. No special tweaks at all.
I am having report parameter end date I am showing the default value "5/21/2007 11:59:59 PM" in the end date paramter. And also I want to show date time format "(MM/DD/YYYY HH:MMS)" in the right hand side of the parameter. How to do this?
Hi I want to import excel in SSIS via sql command and change the data types. can anyone guide me on this or give me some sample command on how to change datatypes explicitly.
I am using reporting services, when I go to view my report in Report Manager (web browser is IE7), I choose a date from a date picker control, and the date that populates the date field is in US format mm/dd/yyyy, however in my regional settings, although I have English(United States) I have altered my short date format to be dd/mm/yyyy.
Currently my report will display an error saying the date is an invalid format if I pick a date that violates the mm/dd/yyyy format. I want it to display the date format that I have defined in my regional settings, without modifying the 'Language Preference' settings for IE.
The report properties has =User!Language for the 'Language' property.
dear all can anybody help me soon.... i am using visual studio 2005 webapplication based on sql server 2005 database. i can get one date from sql using one query. I am selecting my field based on following code CONVERT(varchar, Oman.Positions.Datum, 9) AS LastUpdate this case my output is May 4 2008 3:19:45:000AM..... this output is correct but from this output i want to avoid millisecond part. ie i want the output like May 4 2008 3:19:45 AM.... how i can do this regards
I asked this question below, but the answer was that the conversion will take place automatically, but I can't get that to happen. I have a flat file with an 8 position field that I identify as string (and I also tried date) that is yyyymmdd and it needs to go into the database field that is datetime format. IS there something I am doing wrong with the definition of it, or do I need to add some kind of conversion, and if so, what and how would that be done. I'm a dts Sql2000 expert, but the SSIS thing is driving me crazy. I have a ton of dts' to convert and the migration tool doesn't work because there are a lot of active X scripts in them. thanks for your help. Boston Rose