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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 select query question?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-04-19 : 10:56:36
Frank writes "I created two same queries but only first one give me right result. I don't know what's the problem with second one.

I have a problem from second query. first query works fine on Northwind

First query:

select 'xcopy e:\codes\test.pem'+' '+ '\\'+ [lastname] + '\c$\comp\wb\ts'
from northwind..employees

The result is (this is good one):

xcopy e:\codes\test.pem \\Buchanan\c$\comp\wb\ts
xcopy e:\codes\test.pem \\Callahan\c$\comp\wb\ts

second query:

select 'xcopy e:\codes\test.pem'+' '+ '\\'+ [name] + '\c$\comp\wb\ts'
from Insight..devices

The result is (this is wrong result):

xcopy e:\codes\test.pem \\bcdccim05(missing \c$\comp\wb\ts)
xcopy e:\codes\test.pem \\kbedeapgfs02(missing \c$\comp\wb\ts)

Please let me know if someone know the problem for this.

Thank you very much.

My e-mail address: frankli88@hotmail.com"

raymondpeacock
Constraint Violating Yak Guru

367 Posts

Posted - 2004-04-19 : 11:49:32
What is the datatype of the [name]column in Insight..devices? If it's char or nchar try changing it to varchar or nvarchar as it may be trailing spaces that's causing you problems.


Raymond
Go to Top of Page
   

- Advertisement -