Hello All,
I am currently importing datarows into a sql 2000 database. when I use my
stored procedure which contains sp_xml_preparedocument... and FROM OPENXML,
I get the error stated above in the subject heading.
In reading other websites I have found that the error above:
An invalid character was found in text content.
You will get this error message if a character in the XML document does not
match the encoding attribute. Normally you will get this error message if
your XML document contains "foreign" characters, and the file was saved with
a single-byte encoding editor like Notepad, and no encoding attribute was
specified.
The actual error is:
Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line 15
XML parsing error: An Invalid character was found in text content.
Based on what I found on the other webisite, the only foreign character in
my data the è in ARKTX="XXX CRèME 1x20 KG".
Is there anyway to encode this character so I do not get a parsing error?
Thank you in advance
Eric
I found that I have to place an xml declaration
of
<?xml version="1.0" encoding="ISO-8859-1"?>
in my XML string so the sp_xml_prepared_Document stored procedure will treat
the data as UTF-8 and not the Database's code page.
"E-Cube" wrote:
> Hello All,
> I am currently importing datarows into a sql 2000 database. when I use my
> stored procedure which contains sp_xml_preparedocument... and FROM OPENXML,
> I get the error stated above in the subject heading.
> In reading other websites I have found that the error above:
> An invalid character was found in text content.
> You will get this error message if a character in the XML document does not
> match the encoding attribute. Normally you will get this error message if
> your XML document contains "foreign" characters, and the file was saved with
> a single-byte encoding editor like Notepad, and no encoding attribute was
> specified.
>
> The actual error is:
> Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line 15
> XML parsing error: An Invalid character was found in text content.
> Based on what I found on the other webisite, the only foreign character in
> my data the è in ARKTX="XXX CRèME 1x20 KG".
> Is there anyway to encode this character so I do not get a parsing error?
>
> Thank you in advance
> Eric
>
Showing posts with label character. Show all posts
Showing posts with label character. Show all posts
Tuesday, March 27, 2012
Error: An invalid character was found in text content.
Hello All,
I am currently importing datarows into a sql 2000 database. when I use my
stored procedure which contains sp_xml_preparedocument... and FROM OPENXML,
I get the error stated above in the subject heading.
In reading other websites I have found that the error above:
An invalid character was found in text content.
You will get this error message if a character in the XML document does not
match the encoding attribute. Normally you will get this error message if
your XML document contains "foreign" characters, and the file was saved with
a single-byte encoding editor like Notepad, and no encoding attribute was
specified.
The actual error is:
Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line
15
XML parsing error: An Invalid character was found in text content.
Based on what I found on the other webisite, the only foreign character in
my data the è in ARKTX="XXX CRèME 1x20 KG".
Is there anyway to encode this character so I do not get a parsing error?
Thank you in advance
EricI found that I have to place an xml declaration
of
<?xml version="1.0" encoding="ISO-8859-1"?>
in my XML string so the sp_xml_prepared_Document stored procedure will treat
the data as UTF-8 and not the Database's code page.
"E-Cube" wrote:
> Hello All,
> I am currently importing datarows into a sql 2000 database. when I use my
> stored procedure which contains sp_xml_preparedocument... and FROM OPENXML
,
> I get the error stated above in the subject heading.
> In reading other websites I have found that the error above:
> An invalid character was found in text content.
> You will get this error message if a character in the XML document does no
t
> match the encoding attribute. Normally you will get this error message if
> your XML document contains "foreign" characters, and the file was saved wi
th
> a single-byte encoding editor like Notepad, and no encoding attribute was
> specified.
>
> The actual error is:
> Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Lin
e 15
> XML parsing error: An Invalid character was found in text content.
> Based on what I found on the other webisite, the only foreign character in
> my data the è in ARKTX="XXX CRèME 1x20 KG".
> Is there anyway to encode this character so I do not get a parsing error?
>
> Thank you in advance
> Eric
>sql
I am currently importing datarows into a sql 2000 database. when I use my
stored procedure which contains sp_xml_preparedocument... and FROM OPENXML,
I get the error stated above in the subject heading.
In reading other websites I have found that the error above:
An invalid character was found in text content.
You will get this error message if a character in the XML document does not
match the encoding attribute. Normally you will get this error message if
your XML document contains "foreign" characters, and the file was saved with
a single-byte encoding editor like Notepad, and no encoding attribute was
specified.
The actual error is:
Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Line
15
XML parsing error: An Invalid character was found in text content.
Based on what I found on the other webisite, the only foreign character in
my data the è in ARKTX="XXX CRèME 1x20 KG".
Is there anyway to encode this character so I do not get a parsing error?
Thank you in advance
EricI found that I have to place an xml declaration
of
<?xml version="1.0" encoding="ISO-8859-1"?>
in my XML string so the sp_xml_prepared_Document stored procedure will treat
the data as UTF-8 and not the Database's code page.
"E-Cube" wrote:
> Hello All,
> I am currently importing datarows into a sql 2000 database. when I use my
> stored procedure which contains sp_xml_preparedocument... and FROM OPENXML
,
> I get the error stated above in the subject heading.
> In reading other websites I have found that the error above:
> An invalid character was found in text content.
> You will get this error message if a character in the XML document does no
t
> match the encoding attribute. Normally you will get this error message if
> your XML document contains "foreign" characters, and the file was saved wi
th
> a single-byte encoding editor like Notepad, and no encoding attribute was
> specified.
>
> The actual error is:
> Server: Msg 6603, Level 16, State 1, Procedure sp_xml_preparedocument, Lin
e 15
> XML parsing error: An Invalid character was found in text content.
> Based on what I found on the other webisite, the only foreign character in
> my data the è in ARKTX="XXX CRèME 1x20 KG".
> Is there anyway to encode this character so I do not get a parsing error?
>
> Thank you in advance
> Eric
>sql
Friday, March 9, 2012
Error xp_cmdshell
I'm having the hardest problem. My input values are of datetime and the cha
racter string that I'm creating is giving me an error saying can't convert d
atetime to char. Is what I'm trying to do possible?
Thanks in advance for your help.
set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtri
m(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where
b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (th
is is a date time value) be
tween ' + (date time value) + ' and ' + end date time value + ''', no_output
'
Because @.dcmd is of varchar and the parms that I'm trying to send it is date
time nothing seems to work. I can't even put quotes around it because it r
efuses to run without it.You have to explictly convert your 2 parameters into a character format
using the CONVERT function if you want to get them into the string.
Herbert
"D" <D@.discussions.microsoft.com> schrieb im Newsbeitrag
news:0B41DF21-B79F-495A-8FE7-6BE5A484FAB4@.microsoft.com...
> I'm having the hardest problem. My input values are of datetime and the
character string that I'm creating is giving me an error saying can't
convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' +
rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m
where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and
date (this is a date time value) between ' + (date time value) + ' and ' +
end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is
date time nothing seems to work. I can't even put quotes around it because
it refuses to run without it.|||You only need to post this question once.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
D wrote:
> I'm having the hardest problem. My input values are of datetime and the c
haracter string that I'm creating is giving me an error saying can't convert
datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd
) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1
= m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time valu
e)
between ' + (date time value) + ' and ' + end date time value + ''', no_output'en">
> Because @.dcmd is of varchar and the parms that I'm trying to send it is date time
nothing seems to work. I can't even put quotes around it because it refuses to run
without it.
racter string that I'm creating is giving me an error saying can't convert d
atetime to char. Is what I'm trying to do possible?
Thanks in advance for your help.
set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtri
m(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where
b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (th
is is a date time value) be
tween ' + (date time value) + ' and ' + end date time value + ''', no_output
'
Because @.dcmd is of varchar and the parms that I'm trying to send it is date
time nothing seems to work. I can't even put quotes around it because it r
efuses to run without it.You have to explictly convert your 2 parameters into a character format
using the CONVERT function if you want to get them into the string.
Herbert
"D" <D@.discussions.microsoft.com> schrieb im Newsbeitrag
news:0B41DF21-B79F-495A-8FE7-6BE5A484FAB4@.microsoft.com...
> I'm having the hardest problem. My input values are of datetime and the
character string that I'm creating is giving me an error saying can't
convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' +
rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m
where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and
date (this is a date time value) between ' + (date time value) + ' and ' +
end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is
date time nothing seems to work. I can't even put quotes around it because
it refuses to run without it.|||You only need to post this question once.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
D wrote:
> I'm having the hardest problem. My input values are of datetime and the c
haracter string that I'm creating is giving me an error saying can't convert
datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd
) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1
= m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time valu
e)
between ' + (date time value) + ' and ' + end date time value + ''', no_output'en">
> Because @.dcmd is of varchar and the parms that I'm trying to send it is date time
nothing seems to work. I can't even put quotes around it because it refuses to run
without it.
Error xp_cmdshell
I'm having the hardest problem. My input values are of datetime and the character string that I'm creating is giving me an error saying can't convert datetime to char. Is what I'm trying to do possible?
Thanks in advance for your help.
set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value) between ' + (date time value) + ' and ' + end date time value + ''', no_output'
Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.You have to explictly convert your 2 parameters into a character format
using the CONVERT function if you want to get them into the string.
Herbert
"D" <D@.discussions.microsoft.com> schrieb im Newsbeitrag
news:0B41DF21-B79F-495A-8FE7-6BE5A484FAB4@.microsoft.com...
> I'm having the hardest problem. My input values are of datetime and the
character string that I'm creating is giving me an error saying can't
convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' +
rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m
where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and
date (this is a date time value) between ' + (date time value) + ' and ' +
end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is
date time nothing seems to work. I can't even put quotes around it because
it refuses to run without it.|||You only need to post this question once.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
D wrote:
> I'm having the hardest problem. My input values are of datetime and the character string that I'm creating is giving me an error saying can't convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value) between ' + (date time value) + ' and ' + end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.
Thanks in advance for your help.
set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value) between ' + (date time value) + ' and ' + end date time value + ''', no_output'
Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.You have to explictly convert your 2 parameters into a character format
using the CONVERT function if you want to get them into the string.
Herbert
"D" <D@.discussions.microsoft.com> schrieb im Newsbeitrag
news:0B41DF21-B79F-495A-8FE7-6BE5A484FAB4@.microsoft.com...
> I'm having the hardest problem. My input values are of datetime and the
character string that I'm creating is giving me an error saying can't
convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' +
rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m
where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and
date (this is a date time value) between ' + (date time value) + ' and ' +
end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is
date time nothing seems to work. I can't even put quotes around it because
it refuses to run without it.|||You only need to post this question once.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
D wrote:
> I'm having the hardest problem. My input values are of datetime and the character string that I'm creating is giving me an error saying can't convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value) between ' + (date time value) + ' and ' + end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.
Error xp_cmdshell
I'm having the hardest problem. My input values are of datetime and the character string that I'm creating is giving me an error saying can't convert datetime to char. Is what I'm trying to do possible?
Thanks in advance for your help.
set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value) be
tween ' + (date time value) + ' and ' + end date time value + ''', no_output'
Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.
You have to explictly convert your 2 parameters into a character format
using the CONVERT function if you want to get them into the string.
Herbert
"D" <D@.discussions.microsoft.com> schrieb im Newsbeitrag
news:0B41DF21-B79F-495A-8FE7-6BE5A484FAB4@.microsoft.com...
> I'm having the hardest problem. My input values are of datetime and the
character string that I'm creating is giving me an error saying can't
convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' +
rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m
where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and
date (this is a date time value) between ' + (date time value) + ' and ' +
end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is
date time nothing seems to work. I can't even put quotes around it because
it refuses to run without it.
|||You only need to post this question once.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
D wrote:
> I'm having the hardest problem. My input values are of datetime and the character string that I'm creating is giving me an error saying can't convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value)
between ' + (date time value) + ' and ' + end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.
Thanks in advance for your help.
set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value) be
tween ' + (date time value) + ' and ' + end date time value + ''', no_output'
Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.
You have to explictly convert your 2 parameters into a character format
using the CONVERT function if you want to get them into the string.
Herbert
"D" <D@.discussions.microsoft.com> schrieb im Newsbeitrag
news:0B41DF21-B79F-495A-8FE7-6BE5A484FAB4@.microsoft.com...
> I'm having the hardest problem. My input values are of datetime and the
character string that I'm creating is giving me an error saying can't
convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' +
rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m
where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and
date (this is a date time value) between ' + (date time value) + ' and ' +
end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is
date time nothing seems to work. I can't even put quotes around it because
it refuses to run without it.
|||You only need to post this question once.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
D wrote:
> I'm having the hardest problem. My input values are of datetime and the character string that I'm creating is giving me an error saying can't convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value)
between ' + (date time value) + ' and ' + end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.
Error with xp_cmdshell command
I'm having the hardest problem. My input values are of datetime and the cha
racter string that I'm creating is giving me an error saying can't convert d
atetime to char. Is what I'm trying to do possible?
Thanks in advance for your help.
set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtri
m(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where
b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (th
is is a date time value) be
tween ' + (date time value) + ' and ' + end date time value + ''', no_output
'
Because @.dcmd is of varchar and the parms that I'm trying to send it is date
time nothing seems to work. I can't even put quotes around it because it r
efuses to run without it.You only need to post this question once.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
D wrote:
> I'm having the hardest problem. My input values are of datetime and the c
haracter string that I'm creating is giving me an error saying can't convert
datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd
) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1
= m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time valu
e)
between ' + (date time value) + ' and ' + end date time value + ''', no_output'en">
> Because @.dcmd is of varchar and the parms that I'm trying to send it is date time
nothing seems to work. I can't even put quotes around it because it refuses to run
without it.
racter string that I'm creating is giving me an error saying can't convert d
atetime to char. Is what I'm trying to do possible?
Thanks in advance for your help.
set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtri
m(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where
b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (th
is is a date time value) be
tween ' + (date time value) + ' and ' + end date time value + ''', no_output
'
Because @.dcmd is of varchar and the parms that I'm trying to send it is date
time nothing seems to work. I can't even put quotes around it because it r
efuses to run without it.You only need to post this question once.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
D wrote:
> I'm having the hardest problem. My input values are of datetime and the c
haracter string that I'm creating is giving me an error saying can't convert
datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd
) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1
= m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time valu
e)
between ' + (date time value) + ' and ' + end date time value + ''', no_output'en">
> Because @.dcmd is of varchar and the parms that I'm trying to send it is date time
nothing seems to work. I can't even put quotes around it because it refuses to run
without it.
Error with xp_cmdshell command
I'm having the hardest problem. My input values are of datetime and the character string that I'm creating is giving me an error saying can't convert datetime to char. Is what I'm trying to do possible?
Thanks in advance for your help.
set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value) between ' + (date time value) + ' and ' + end date time value + ''', no_output'
Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.You only need to post this question once.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
D wrote:
> I'm having the hardest problem. My input values are of datetime and the character string that I'm creating is giving me an error saying can't convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value) between ' + (date time value) + ' and ' + end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.
Thanks in advance for your help.
set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value) between ' + (date time value) + ' and ' + end date time value + ''', no_output'
Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.You only need to post this question once.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
D wrote:
> I'm having the hardest problem. My input values are of datetime and the character string that I'm creating is giving me an error saying can't convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value) between ' + (date time value) + ' and ' + end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.
Error with xp_cmdshell command
I'm having the hardest problem. My input values are of datetime and the character string that I'm creating is giving me an error saying can't convert datetime to char. Is what I'm trying to do possible?
Thanks in advance for your help.
set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value) be
tween ' + (date time value) + ' and ' + end date time value + ''', no_output'
Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.
You only need to post this question once.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
D wrote:
> I'm having the hardest problem. My input values are of datetime and the character string that I'm creating is giving me an error saying can't convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value)
between ' + (date time value) + ' and ' + end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.
Thanks in advance for your help.
set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value) be
tween ' + (date time value) + ' and ' + end date time value + ''', no_output'
Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.
You only need to post this question once.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
D wrote:
> I'm having the hardest problem. My input values are of datetime and the character string that I'm creating is giving me an error saying can't convert datetime to char. Is what I'm trying to do possible?
> Thanks in advance for your help.
> set @.dcmd = 'exec master.dbo.xp_cmdshell ''osql -Sservername -E -o ' + rtrim(@.cmd) + ' -Q" set nocount off;select * from table_one b, table_two m where b.table_one_1 = m.table_two_2 and b.table_one_1= m.table_two_2 and date (this is a date time value)
between ' + (date time value) + ' and ' + end date time value + ''', no_output'
> Because @.dcmd is of varchar and the parms that I'm trying to send it is date time nothing seems to work. I can't even put quotes around it because it refuses to run without it.
Subscribe to:
Posts (Atom)