<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=iso-8859-1" http-equiv=Content-Type> <META name=GENERATOR content="MSHTML 8.00.6001.18876"> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT size=2 face=Arial><FONT size=1> <P>Case closed</P></FONT></FONT></DIV> <BLOCKQUOTE style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px" dir=ltr> <DIV>"Pilas" <<A href="mailto:fipaul1NEREIKIANUTRINTI@yahoo.com">fipaul1NEREIKIANUTRINTI@yahoo.com</A>> wrote in message <A href="news:hjs0d0$hhs$1@trimpas.omnitel.net">news:hjs0d0$hhs$1@trimpas.omnitel.net</A>...</DIV> <DIV><FONT size=2 face=Arial>sveiki,</FONT></DIV> <DIV><FONT size=2 face=Arial></FONT> </DIV> <DIV><FONT size=2 face=Arial>turiu excel lapa ir kurio reikai suimportuoti kodus i SQL lentele kaip charakterius.</FONT></DIV> <DIV><FONT size=2 face=Arial></FONT> </DIV> <DIV><FONT size=2 face=Arial>pasirasiau su CAST :</FONT></DIV> <DIV><FONT size=2 face=Arial>-------------------------------------</FONT></DIV> <DIV> <P><FONT size=2 face=Arial>insert INTO [Baze].[dbo].[list]</FONT></P> <P><FONT size=2 face=Arial>SELECT cast( [code] as char(20))</FONT></P> <P><FONT size=2 face=Arial>FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',</FONT></P> <P><FONT size=2 face=Arial>'Excel 8.0;Database=C:\SQL\baze\list.xls',</FONT></P> <P><FONT size=2 face=Arial>'SELECT * FROM [Sheet1$]')</FONT></P> <P><FONT size=2 face=Arial>----------------------------------------</FONT></P> <P><FONT size=2 face=Arial>bet dalis kodu nesusiimportuoja teisingai : kodai 6 zenklu tvarkingai gaunasi : 123456, o visi 7-zenkliai gaunasi kaip skaicius : 1.2345e+006</FONT></P></DIV> <DIV><FONT size=2><FONT face=Arial>jei bandau trumpinti char - tada netelpa meta klaida " </FONT><FONT size=1><FONT size=2 face=Arial>Arithmetic overflow error for type varchar, value = 5266700.000000" cia turetu buti kodas 5266700 - 7zenklis.</FONT></FONT></FONT></DIV> <DIV><FONT size=2><FONT size=1><FONT size=2 face=Arial></FONT></FONT></FONT> </DIV> <DIV><FONT size=2 face=Arial>cia mano SQL pradmenys, todel labai nemuskit. </FONT></DIV> <DIV><FONT size=2><FONT size=1><FONT size=2 face=Arial></FONT> </DIV> <DIV><FONT size=2 face=Arial></FONT></FONT></FONT> <P> </P> <P><FONT size=2 face=Arial></FONT> </P> <P><FONT size=2 face=Arial></FONT> </P> <P><FONT size=2 face=Arial></FONT> </P></DIV></BLOCKQUOTE></BODY></HTML>