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
 syntax issue for commented query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shanmugaraj
Posting Yak Master

212 Posts

Posted - 05/06/2013 :  09:31:05  Show Profile  Send shanmugaraj a Yahoo! Message  Reply with Quote

declare @str_folder_path varchar(1000)='\\Dataupload'
,@str_media_data_file_path_csv varchar(200)='Data File.csv'

BULK INSERT vw_pkg_dataload
-- FROM '\\Dataupload\Data File.csv'
FROM '''' + @str_folder_path + '\' + @str_media_data_file_path_csv +''''
WITH
(
FIRSTROW = 2,
FIELDTERMINATOR ='|',ROWTERMINATOR = '\n'
)


THANKS
SHANMUGARAJ
nshanmugaraj@gmail.com

MIK_2008
Flowing Fount of Yak Knowledge

Pakistan
1050 Posts

Posted - 05/06/2013 :  09:47:10  Show Profile  Reply with Quote
I think you should use dynamic SQL .. wrap up the command into a string parameter and then use Exec (@variable)

Cheers
MIK
Go to Top of Page

shanmugaraj
Posting Yak Master

212 Posts

Posted - 05/06/2013 :  10:14:18  Show Profile  Send shanmugaraj a Yahoo! Message  Reply with Quote
ok thanks

THANKS
SHANMUGARAJ
nshanmugaraj@gmail.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.02 seconds. Powered By: Snitz Forums 2000