Jump to content

injesus

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by injesus

  1. Answering to my own questiononly it usesselect fecha=dbo.convertingdata ('20060503')it is quite and this way the majority of the functions can be used
  2. declare @nombret varchar(25)UPDATE prueba2set @nombret=substring(nombre,2,24),nombre=Replace(substring(nombre,1,1),'c','r')+@nombretWHERE nombre LIKE 'c%'@nombret is a temporal variableprueba2 is the tablenombre it is the only field that is modifiedsubstring select from nombre the firt caracter and the rest set to @nombretand only it modifies the first characterI hope can help you
  3. Thank you I already solved the probleminsert into TablaSELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;HDR=Yes;Database=c:\este.xls', 'SELECT * FROM [sheet1$]') It is necessary that the file is physically in the servant but it will not work.If you already have it then the code will work without problems
  4. Hello I have this function but to mark error errors of several forms as I can execute it correctly.the code is:CREATE FUNCTION convertingdata (@inicio int)RETURNS intASBEGIN declare @ano int, @fechastem varchar(14),@mes int, @dia int, @itemtemp int select @fechastem=convert(varchar(14),@inicio) select @dia = substring(@fechastem,7,2),@mes=substring(@fechastem,5,2),@ano=substring(@fechastem,1,4) select @fechastem=convert(varchar(2),@dia)+'/'+convert(varchar(2),@mes)+'/'+convert(varchar(4),@ano) select @itemtemp=convert(int,@fechastem) RETURN(@itemtemp)ENDthe objetive is convert form '20060502' to '02/05/2006'out of the function it works but as function notI hope that they could help me Thank you
  5. Thank you already undefined . It is necessary to consider if the server is remote or local, if it is local there is no problem, but if it is external, it is necessary to copy it to the server so that he recognizes it.This code if it works:SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;HDR=Yes;Database=c:\este.xls', 'SELECT * FROM [sheet1$]')where "este.xls" is the file name in the computer server "C:\" path.
  6. I check the Microsoft Help and the error now is Server: Msg 7314, Level 16, State 1, Line 1OLE DB provider 'Microsoft.Jet.OLEDB.4.0' does not contain table 'Hoja1$'. The table either does not exist or the current user does not have permissions on that table.OLE DB error trace [Non-interface error: OLE DB provider does not contain the table: ProviderName=Microsoft.Jet.OLEDB.4.0', TableName='Hoja1$].My file name is c:\DISPCONF506.xls and the worksheet name is "Hoja1"
  7. ok the filename Workbook is MyExcel.xls, the Worksheet name is usuarios(now), and the code is.--Read Excel Sheet using OpenRowSetselect * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;DATABASE=c:\temp\MyExcel.xls', 'Select * from [usuarios]')Show me the errorServer: Msg 7399, Level 16, State 1, Line 2The Microsoft Jet database engine could not find the object 'usuarios'what's Wrongcan you help methanks
  8. I change the WorkSheet name to "Usuarios" and the error is the same.The Workbook file name is MyExel.xls, not is the problem?
  9. HiMyExel.xls is the name of my workbook and Book1 is the Worksheet.is correct the code syntax?
  10. HiSQL Analyzer show this errorServer: Msg 7399, Level 16, State 1, Line 2OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. [OLE/DB provider returned message: The Microsoft Jet database engine could not find the object 'Book1$'. Make sure the object exists and that you spell its name and the path name correctly.]OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IColumnsInfo::GetColumnsInfo returned 0x80004005: ].The code is--Read Excel Sheet using OpenRowSetselect * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;DATABASE=c:\MyExcel.xls', 'Select * from [book1$]')is the system or the codethanks
  11. Hi I need help you.can showme a Example using OPENROWSET for obtain data form a Excel Table to Sql Table.thanks
×
×
  • Create New...