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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select specific value in select statement

Author  Topic 

bevans
Starting Member

10 Posts

Posted - 2012-01-23 : 09:20:21
I'm currenty using the following select statement for my table

insert into #variables
select 'BackupPath', [BackupPath]
from [TEST].[dbo].[t_RefDBs]
where Databasename like 'ITDB'

When using that statement the output is:

Name: BackupPath
Value: "\\pathdirectory\test\"

how do I change that select statement so that the value does not select the quotation marks? -the quotation marks are in the field in the table it selects from, and I don't want to physically delete the quotation marks from the fields.

i.e. I want the output to be:

Name: BackupPath
Value: \\pathdirectory\test
Thanks

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2012-01-23 : 09:50:51
Hello bevans,

Have a look at the REPLACE function.

HTH.
Go to Top of Page

bevans
Starting Member

10 Posts

Posted - 2012-01-24 : 09:56:25
quote:
Originally posted by ehorn

Hello bevans,

Have a look at the REPLACE function.

HTH.



Yeah, it was either going to be that, or run an update command on the table itself, I opted for the latter.
Go to Top of Page
   

- Advertisement -