-
Posts
5 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by ironcurtain
-
-
While trying to run below query I got error:
Incorrect syntax near '+'.
declare @filepath varchar(50)set @filepath = 'e:\tsql\'create table #tab1 (name varchar(100))insert #tab1 exec master..xp_cmdshell 'dir /b "'+@filepath'"+"'*.txt'"'
I think there is issue with quatation marks but I couldn't find any solution. Please help.
-
Please close the topic.
-
I thought that maby there is some solution similar to "servers.servername like history.serverName" or there is possibility to cut of the last character in serverName.Anyway thank You for the reply.
-
Hi Everyone, I have two tables: table1: history dayid nofile servername11082012 1 server112082012 1 server213082012 1 server314082012 1 server1* table2 servers: serverName unitserver1 emeaserver2 uaeserver3 emea I wrote a querry to join tables:
select history.dayid, history.nofile, history.servername, servers.unitfrom historyleft joinserversonhistory.servername = servers.serverName
In my case server1* is the same as server1but SQL see that as a different names. Is there a possibility to join the tables without empty cells?I'd like to avoid creating temporary tables. Thank You for answering my question.
[TSQL] String concatenation
in SQL
Posted
I founded solution for above: