June 1, 2011 at 11:51 am
INSERT INTO [dbo].[Events]
([ID]
, [Questions]
,[Answer_A]
,[Answer_B]
,[Answer_C]
,[Answer_D]
,[Answer_Key])
VALUES
(7
,'When completing an event report it is necessary to document the following except:'
,'the severity level of the patient or resident' & [font="Arial Black"]chr(44)[/font] & 'injury'
,'the patient’s roommate’s name'
,'the condition of the patient or resident'
,'date, time and location of the event'
,'b')
Thanks.
I tried this it did not work , too.
INSERT INTO [dbo].[Events]
([ID]
, [Questions]
,[Answer_A]
,[Answer_B]
,[Answer_C]
,[Answer_D]
,[Answer_Key])
VALUES
(7
,'When completing an event report it is necessary to document the following except:'
,'the severity level of the patient or resident' & [font="Arial Black"]''''[/font] & 'injury'
,'the patient’s roommate’s name'
,'the condition of the patient or resident'
,'date, time and location of the event'
,'b')
that is the text I need to import.
the severity level of the patient or resident's injury
June 1, 2011 at 1:35 pm
char(44) is a comma, is that your special character?
this statement in syntactically correct:
--the char
select char(44)
--an example
select 'the severity level of the patient or resident' + char(44) + 'injury'
INSERT INTO [dbo].[Events]
([ID]
, [Questions]
,[Answer_A]
,[Answer_B]
,[Answer_C]
,[Answer_D]
,[Answer_Key])
SELECT 7
,'When completing an event report it is necessary to document the following except:'
,'the severity level of the patient or resident' + char(44) + 'injury'
,'the patient’s roommate’s name'
,'the condition of the patient or resident'
,'date, time and location of the event'
,'b'
select char(44)
Lowell
June 1, 2011 at 1:48 pm
To help you find the change that Lowell did to make your code work, you've done a little too much VB.NET. 🙂
SQL uses + where VB.NET uses & (well, and the correct function name). Makes life interesting when you're trying to work with a number and a varchar.
& in T-SQL is a Bitwise AND result.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
June 2, 2011 at 6:22 am
Thanks. you are right. I could not recall + sign any more after no coding for a while.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply