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.
Author |
Topic |
kumarasari
Starting Member
2 Posts |
Posted - 2013-05-25 : 01:02:09
|
hi,alli have a excel sheet how to import data to table use sql query and how to get total records count and excel sheet call dynamically.........i will try below query...but not getting correct result..pls post queryALTER PROCEDURE [dbo].[TOTAL2]( @FILE_NAME varchar(100), @total varchar(100) out )ASBEGIN set @TOTAL ='SELECT COUNT(*) FROM OPENROWSET(''Microsoft.ACE.OLEDB.12.0'', ''Excel 12.0;Database='+@FILE_NAME +';HDR=YES'', ''SELECT * FROM [Sheet1$]'')' END |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-05-25 : 09:16:10
|
Where are you executing the string? use EXEC (@SQL) to execute it------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|