Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

String Concatenation

Featured Replies

Hi Guys,

I'm trying to perform an automated bulk insert of a file each day, which contains the date in the file name. If I enter the file name it runs fine so I think it is just the formatting of the code/string but I am struggling to find what it can be (if at all possible). The code extract is

BULK Insert HDD_Info_temp 
from 'c:\support\bulkimport\HDD-REPORT-SUCCESS_' + (select convert(varchar,(CAST(CONVERT(varchar, GetDate(), 105) AS DateTime)),105)) + '-09-17-00.csv'
with
(fieldterminator = ',',rowterminator ='\n')
go

the error I get is

Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near '+'.
Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near '+'.

if I run the statement

select ('c:\support\bulkimport\HDD-REPORT-SUCCESS_' + (select convert(varchar,(CAST(CONVERT(varchar, GetDate(), 105) AS DateTime)),105)) + '-09-17-00.csv')

I get the required string

Any idea's or is it not possible via TSQL

Taggs

Since I do not know this langauge so this is just a guess. I dont know if it matter but the working code

has a select ( at the beggining. The non working does not have select ( at the beggining.

Not working code

from 'c:\support\bulkimport\HDD-REPORT-SUCCESS_'

Working Code

select ('c:\support\bulkimport\HDD-REPORT-SUCCESS_'

  • Author

Hi gunsmokingman,

Thanks for that but unfortunately I have already tried that but to no avail.

:(

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.