Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | 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
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shanmugaraj
Posting Yak Master

219 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
1054 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

219 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  
 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