Solved

how set a column to a description concatenated with a value

Posted on 2010-11-29
4
237 Views
Last Modified: 2012-06-27
SET SubDescription1 = 'MTD:'  SubDescription1 + te.Quantity,

I'm trying to use this code but I'm getting the following error

Incorrect syntax near 'SubDescription1'.
0
Comment
Question by:solarisinfosys
  • 2
4 Comments
 
LVL 7

Expert Comment

by:luceysupport
ID: 34236869
should be

SET SubDescription1 = 'MTD:'  + SubDescription1 + te.Quantity

you may also need convert(nvarchar, te.Quantity)
0
 
LVL 4

Accepted Solution

by:
MSSystems earned 500 total points
ID: 34238641
Maybe try something like this

SET SubDescription1 = 'MTD:' + Cast([SubDescription1] as NvarChar(100)) + Cast([te].[Quantity] as NvarChar(100))

Open in new window

0
 

Author Closing Comment

by:solarisinfosys
ID: 34253714
MSSystems
 
Thank You. this is exactly the solution I was looking for.
0
 
LVL 7

Expert Comment

by:luceysupport
ID: 34255324
The solution to your problem was the + was missing as per my response. You did not specify the data types of your columns so I don't see how an answer that assumes them could be more correct.

I would object to how these points were awarded
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Solution for warm standby SQL server 20 50
SSRS 2013 - Creating a summarized report 19 37
SSRS 2013 - Overlapping reports 2 22
SQL Syntax: How to force case sensitive query? 2 32
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question