Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How To export Date From Sql Server

Author  Topic 

MAKAL
Starting Member

2 Posts

Posted - 2013-01-15 : 11:40:06
Hi, I want to export data from a data base on Sql Server.. Every data were exported successfully but dates which are in lines appear like that : "CAST(0x0000A05700000000 AS DateTime)"... Please How can I do it .....??

theboyholty
Posting Yak Master

226 Posts

Posted - 2013-01-15 : 11:53:48
It depends what you are exporting the data to?

You could try something like
CONVERT(VARCHAR(12),yourDateField,103)


---------------------------------------------------------------------------------
http://www.mannyroadend.co.uk A Bury FC supporters website and forum
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-15 : 12:42:02
are you asking about scripting out data from date fields in table?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

MAKAL
Starting Member

2 Posts

Posted - 2013-01-16 : 10:48:34
Yes, I want to export data of a table in a file (.sql) like request (INSERT INTO 'tablaName' VALUES (1, '01-16-22012', 'column2', .....)
In my file .sql I have this :
INSERT INTO MVT_ENTRE (Ntck, Datent, Chrg, Ctransit, Nimmat, Clieu, Remorq, Nimmat2, ProvMarch, BonCh, NumBonEntre) VALUES ('D08457810', CAST(0x0000A05700000000 AS DateTime), 'OUI',768, '40GK-8669-B', 'TP3', 'NO','TOGO')
INSERT INTO MVT_ENTRE (Ntck, Datent, Chrg, Ctransit, Nimmat, Clieu, Remorq, Nimmat2, ProvMarch, BonCh, NumBonEntre) VALUES ('D084885', CAST(0x0000A05700000000 AS DateTime), 'NO', 76, 'TG-7879-L', 'SP FILM', 'NO')
INSERT INTO MVT_ENTRE (Ntck, Datent, Chrg, Ctransit, Nimmat, Clieu, Remorq, Nimmat2, ProvMarch, BonCh, NumBonEntre) VALUES ('D084887', CAST(0x0000A05700000000 AS DateTime), 'NO', 76, 'TG-1370-AH', 'SP FILM', 'NO')
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-16 : 22:30:42
so whats the issue? are you concerned about those binary values coming for dates?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -