Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

concatenation strings within a select statement

Status
Not open for further replies.

junkmail

Programmer
Jan 7, 2001
134
US
can someone tell me the correct syntax for replacing the hard coded path and file name with a declared variable? I am assuming I have to build it by concatenation but the apostrophe's are throwing me off.



SELECT * into test FROM OPENROWSET('VFPOLEDB', 'c:\work\'; ' '; ' ', 'SELECT * FROM test.dbf')
 
Double all apostrophes in the string:
Code:
DECLARE @Test varchar(300)
SET @Test = '  c:\Work\;'' '';'' ''    '


Borislav Borissov
VFP9 SP2, SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top