SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How To export Date From Sql Server
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MAKAL
Starting Member

Togo
2 Posts

Posted - 01/15/2013 :  11:40:06  Show Profile  Reply with Quote
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

United Kingdom
221 Posts

Posted - 01/15/2013 :  11:53:48  Show Profile  Visit theboyholty's Homepage  Reply with Quote
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

India
52317 Posts

Posted - 01/15/2013 :  12:42:02  Show Profile  Reply with Quote
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

Togo
2 Posts

Posted - 01/16/2013 :  10:48:34  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 01/16/2013 :  22:30:42  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000