title: In SQL, how can I convert a VARCHAR to a STRING?
body: <p>I am trying to do a BULK INSERT operation on SQL Server 2008 R2 using a parameter. However, I am having problems that the function expects a STRING where I'm passing it a VARCHAR. My SQL is below.</p>
  
  <pre><code>DECLARE @filepath VARCHAR(30)
  DECLARE @current_symbol VARCHAR(30)
  
  DECLARE symbol_cursor CURSOR FOR
  SELECT symbol FROM stocks.dbo.description WHERE 1=1
  
  OPEN symbol_cursor;
  
  FETCH NEXT FROM symbol_cursor INTO @current_symbol
  
  WHILE @current_symbol is not null
  BEGIN
  SET @filepath = 'C:\Users\stkerr\Desktop\stockPricing\' + @current_symbol + '.prices'
  BULK
  INSERT stocks.dbo.pricing
  FROM @filepath
  WITH
  (
      FIRSTROW = 2,
      FIELDTERMINATOR=',',
      ROWTERMINATOR='\n',
      ORDER   ( [date], [open], high, low, [close],volume),
          ERRORFILE='C:\Users\stkerr\errors.txt'.
  )
  
  FETCH NEXT FROM symbol_cursor INTO @current_symbol
  END 
  GO
  </code></pre>
  
  <p>The problem is popping up when I'm executing the SET @filepath statement.</p>
  
  <p>Any ideas?</p>