Hi
When i am changing the owner which is the default owner
for SQL Agent Job, I am getting error as
Error 14269: Job 'DB Maintenance Plan ' ia already
targteted at server xxxxxxx.
The jobs are failing becuase of other user created the
jobs.
Thanks,
John.Have you renamed this server? I'd check the value of the
originating_server in msdb..sysjobs to make sure it's
correct.
-Sue
On Wed, 5 Nov 2003 07:04:28 -0800, "John"
<anonymous@.discussions.microsoft.com> wrote:
>Hi
>When i am changing the owner which is the default owner
>for SQL Agent Job, I am getting error as
>Error 14269: Job 'DB Maintenance Plan ' ia already
>targteted at server xxxxxxx.
>The jobs are failing becuase of other user created the
>jobs.
>Thanks,
>John.
Showing posts with label changing. Show all posts
Showing posts with label changing. Show all posts
Wednesday, March 21, 2012
Sunday, March 11, 2012
error 1069
I have been running my SQL under Local System a/c. I
wanted to change it to run under my NT a/c. I went to
control panel, services and tried changing the account to
this account and gave my NT credentials. It wouldn't start
and I get logon failure error 1069.
Am I missing anything here?
thanks,
balaYou can change it in Enterprise manager (Properties of the Server).
What rights does the new account have on the domain? You need log on locally
rights.
Is it your personal account or an account specific for SQL Server only? It
is best to use a dedicated account as SQL will stop working if your password
expires.
Look at http://support.microsoft.com/defaul...kb;en-us;283811
(HOW TO: Change the SQL Server or SQL Server Agent Service Account Without
Using SQL Enterprise Manager in SQL Server 2000)
Regards
Mike Epprecht, Microsoft SQL Server MVP
Epprecht Consulting (PTY) LTD
Johannesburg, South Africa
Mobile: +27-82-552-0268
IM: mike@.NOSPAMepprecht.net
Specialist SQL Server Solutions and Consulting
"bala" <balal@.microsoft.com> wrote in message
news:00ff01c3d613$d8533400$a401280a@.phx.gbl...
wanted to change it to run under my NT a/c. I went to
control panel, services and tried changing the account to
this account and gave my NT credentials. It wouldn't start
and I get logon failure error 1069.
Am I missing anything here?
thanks,
balaYou can change it in Enterprise manager (Properties of the Server).
What rights does the new account have on the domain? You need log on locally
rights.
Is it your personal account or an account specific for SQL Server only? It
is best to use a dedicated account as SQL will stop working if your password
expires.
Look at http://support.microsoft.com/defaul...kb;en-us;283811
(HOW TO: Change the SQL Server or SQL Server Agent Service Account Without
Using SQL Enterprise Manager in SQL Server 2000)
Regards
Mike Epprecht, Microsoft SQL Server MVP
Epprecht Consulting (PTY) LTD
Johannesburg, South Africa
Mobile: +27-82-552-0268
IM: mike@.NOSPAMepprecht.net
Specialist SQL Server Solutions and Consulting
"bala" <balal@.microsoft.com> wrote in message
news:00ff01c3d613$d8533400$a401280a@.phx.gbl...
quote:
> I have been running my SQL under Local System a/c. I
> wanted to change it to run under my NT a/c. I went to
> control panel, services and tried changing the account to
> this account and gave my NT credentials. It wouldn't start
> and I get logon failure error 1069.
> Am I missing anything here?
> thanks,
> bala
Friday, March 9, 2012
Error 0x80070534 when changing service account
Hi people
I'm trying to change the SQL Server service account to a domain account and
got error 0x80070534. I explain a little...
I have three servers, a DC, another DC with SQL Server installed and a
member server with SQL Server installed.
In the member server I wasable to successfully change the SQL Server service
account (and for other SQL services also), so the doman user has needed
privileges in domain and in member server files.
In the second DC, I installed SQ Server prior to promote it to DC. In this
server, if I use domain administrator account to start SQL Server, it starts
without problem. But I want to make it start with same domain account the
other SQL Server starts. So I try to assign the service account using SQL
Configuration Manager and error 0x80070534 "No mapping between account names
and security IDs was done" appears.
Any help will be geatly appreaciated.
Thank you
AlexYou can get the error when the account can't be mapped to
the correct SID - did you try another account? With the DC
issue, you may also want to try without the domain prefix -
along the lines of ServiceAcctName (instead of
Domain\ServiceAcctName)
-Sue
On Tue, 13 Feb 2007 15:35:01 -0800, Alex Luna
<AlexLuna@.discussions.microsoft.com> wrote:
>Hi people
>I'm trying to change the SQL Server service account to a domain account and
>got error 0x80070534. I explain a little...
>I have three servers, a DC, another DC with SQL Server installed and a
>member server with SQL Server installed.
>In the member server I wasable to successfully change the SQL Server servic
e
>account (and for other SQL services also), so the doman user has needed
>privileges in domain and in member server files.
>In the second DC, I installed SQ Server prior to promote it to DC. In this
>server, if I use domain administrator account to start SQL Server, it start
s
>without problem. But I want to make it start with same domain account the
>other SQL Server starts. So I try to assign the service account using SQL
>Configuration Manager and error 0x80070534 "No mapping between account name
s
>and security IDs was done" appears.
>Any help will be geatly appreaciated.
>Thank you
>Alex|||Hello Sue,
Thank you or your help. If I try using the account name without domain name
prefix, an error 0x80070056 "The specified network password is not correct."
shows up.
I also tried to use another domain account as service account and error
0x80070534 appears. I added the desired service account to domain admin grou
p
and still got the same error. So, only with admin user account I'm able to
start SQL Server.
Any suggestions?
Alex
"Sue Hoegemeier" wrote:
> You can get the error when the account can't be mapped to
> the correct SID - did you try another account? With the DC
> issue, you may also want to try without the domain prefix -
> along the lines of ServiceAcctName (instead of
> Domain\ServiceAcctName)
> -Sue
> On Tue, 13 Feb 2007 15:35:01 -0800, Alex Luna
> <AlexLuna@.discussions.microsoft.com> wrote:
>
>|||When you create a new account, make sure to set the correct
settings for the service account. Then add the account to
the sysadmins server role in SQL Server. Then change the
service account using the Configuration Manager.
-Sue
On Wed, 14 Feb 2007 06:19:03 -0800, Alex Luna
<AlexLuna@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Hello Sue,
>Thank you or your help. If I try using the account name without domain name
>prefix, an error 0x80070056 "The specified network password is not correct.
"
>shows up.
>I also tried to use another domain account as service account and error
>0x80070534 appears. I added the desired service account to domain admin gro
up
>and still got the same error. So, only with admin user account I'm able to
>start SQL Server.
>Any suggestions?
>Alex
>"Sue Hoegemeier" wrote:
>|||Thank you Sue, but still got the same error at Configuration Manager.
The account has granted Logon as Service right in the domain and in Domain
Controllers. I had set the same permissions for that account in both SQL
Server. The only difference I see is that the SQL Server where the account i
s
able to start the service is not a domain controller, and the other SQL
Server it is.
-Alex
"Sue Hoegemeier" wrote:
> When you create a new account, make sure to set the correct
> settings for the service account. Then add the account to
> the sysadmins server role in SQL Server. Then change the
> service account using the Configuration Manager.
> -Sue
> On Wed, 14 Feb 2007 06:19:03 -0800, Alex Luna
> <AlexLuna@.discussions.microsoft.com> wrote:
>
>|||Which same error? One error you are getting due to running
SQL Server on a domain controller is using the domain
prefix. When you removed the prefix, the error was:
"The specified network password is not correct."
Which means the password you used for the account was
incorrect.
-Sue
On Thu, 22 Feb 2007 13:02:47 -0800, Alex Luna
<AlexLuna@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Thank you Sue, but still got the same error at Configuration Manager.
>The account has granted Logon as Service right in the domain and in Domain
>Controllers. I had set the same permissions for that account in both SQL
>Server. The only difference I see is that the SQL Server where the account
is
>able to start the service is not a domain controller, and the other SQL
>Server it is.
>-Alex
>"Sue Hoegemeier" wrote:
>|||Sue
If I use the prefix, I got error 0x80070534, if I don't use the prefix I got
the error 0x80070056, incorrect network password, but I'm sure the password
is correct. Something similar happens when I use RUN AS command (or screen)
on the DC, if I type the user with domain prefix, it starts the app as that
user (the same I want SQL services start with), but if I don't use the prefi
x
at RUN AS window or command, the password error appears. Maybe, I have a
misconfiguration at domain level...?
Thank you for your help
-Alex
"Sue Hoegemeier" wrote:
[vbcol=seagreen]
> Which same error? One error you are getting due to running
> SQL Server on a domain controller is using the domain
> prefix. When you removed the prefix, the error was:
> "The specified network password is not correct."
> Which means the password you used for the account was
> incorrect.
> -Sue
> On Thu, 22 Feb 2007 13:02:47 -0800, Alex Luna
> <AlexLuna@.discussions.microsoft.com> wrote:
>|||Hi Alex,
Managing this on a domain controller can be a pain. The
permissions don't always get set correctly due to security
issues - it's a different risk when you install SQL Server
on a domain controller.
You'll need to start by walking through all the permissions
for the service account. The following link is probably the
best resource on this:
http://support.microsoft.com/?id=283811
-Sue
On Mon, 26 Feb 2007 08:11:08 -0800, Alex Luna
<AlexLuna@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Sue
>If I use the prefix, I got error 0x80070534, if I don't use the prefix I go
t
>the error 0x80070056, incorrect network password, but I'm sure the password
>is correct. Something similar happens when I use RUN AS command (or screen)
>on the DC, if I type the user with domain prefix, it starts the app as that
>user (the same I want SQL services start with), but if I don't use the pref
ix
>at RUN AS window or command, the password error appears. Maybe, I have a
>misconfiguration at domain level...?
>Thank you for your help
>-Alex
>"Sue Hoegemeier" wrote:
>
I'm trying to change the SQL Server service account to a domain account and
got error 0x80070534. I explain a little...
I have three servers, a DC, another DC with SQL Server installed and a
member server with SQL Server installed.
In the member server I wasable to successfully change the SQL Server service
account (and for other SQL services also), so the doman user has needed
privileges in domain and in member server files.
In the second DC, I installed SQ Server prior to promote it to DC. In this
server, if I use domain administrator account to start SQL Server, it starts
without problem. But I want to make it start with same domain account the
other SQL Server starts. So I try to assign the service account using SQL
Configuration Manager and error 0x80070534 "No mapping between account names
and security IDs was done" appears.
Any help will be geatly appreaciated.
Thank you
AlexYou can get the error when the account can't be mapped to
the correct SID - did you try another account? With the DC
issue, you may also want to try without the domain prefix -
along the lines of ServiceAcctName (instead of
Domain\ServiceAcctName)
-Sue
On Tue, 13 Feb 2007 15:35:01 -0800, Alex Luna
<AlexLuna@.discussions.microsoft.com> wrote:
>Hi people
>I'm trying to change the SQL Server service account to a domain account and
>got error 0x80070534. I explain a little...
>I have three servers, a DC, another DC with SQL Server installed and a
>member server with SQL Server installed.
>In the member server I wasable to successfully change the SQL Server servic
e
>account (and for other SQL services also), so the doman user has needed
>privileges in domain and in member server files.
>In the second DC, I installed SQ Server prior to promote it to DC. In this
>server, if I use domain administrator account to start SQL Server, it start
s
>without problem. But I want to make it start with same domain account the
>other SQL Server starts. So I try to assign the service account using SQL
>Configuration Manager and error 0x80070534 "No mapping between account name
s
>and security IDs was done" appears.
>Any help will be geatly appreaciated.
>Thank you
>Alex|||Hello Sue,
Thank you or your help. If I try using the account name without domain name
prefix, an error 0x80070056 "The specified network password is not correct."
shows up.
I also tried to use another domain account as service account and error
0x80070534 appears. I added the desired service account to domain admin grou
p
and still got the same error. So, only with admin user account I'm able to
start SQL Server.
Any suggestions?
Alex
"Sue Hoegemeier" wrote:
> You can get the error when the account can't be mapped to
> the correct SID - did you try another account? With the DC
> issue, you may also want to try without the domain prefix -
> along the lines of ServiceAcctName (instead of
> Domain\ServiceAcctName)
> -Sue
> On Tue, 13 Feb 2007 15:35:01 -0800, Alex Luna
> <AlexLuna@.discussions.microsoft.com> wrote:
>
>|||When you create a new account, make sure to set the correct
settings for the service account. Then add the account to
the sysadmins server role in SQL Server. Then change the
service account using the Configuration Manager.
-Sue
On Wed, 14 Feb 2007 06:19:03 -0800, Alex Luna
<AlexLuna@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Hello Sue,
>Thank you or your help. If I try using the account name without domain name
>prefix, an error 0x80070056 "The specified network password is not correct.
"
>shows up.
>I also tried to use another domain account as service account and error
>0x80070534 appears. I added the desired service account to domain admin gro
up
>and still got the same error. So, only with admin user account I'm able to
>start SQL Server.
>Any suggestions?
>Alex
>"Sue Hoegemeier" wrote:
>|||Thank you Sue, but still got the same error at Configuration Manager.
The account has granted Logon as Service right in the domain and in Domain
Controllers. I had set the same permissions for that account in both SQL
Server. The only difference I see is that the SQL Server where the account i
s
able to start the service is not a domain controller, and the other SQL
Server it is.
-Alex
"Sue Hoegemeier" wrote:
> When you create a new account, make sure to set the correct
> settings for the service account. Then add the account to
> the sysadmins server role in SQL Server. Then change the
> service account using the Configuration Manager.
> -Sue
> On Wed, 14 Feb 2007 06:19:03 -0800, Alex Luna
> <AlexLuna@.discussions.microsoft.com> wrote:
>
>|||Which same error? One error you are getting due to running
SQL Server on a domain controller is using the domain
prefix. When you removed the prefix, the error was:
"The specified network password is not correct."
Which means the password you used for the account was
incorrect.
-Sue
On Thu, 22 Feb 2007 13:02:47 -0800, Alex Luna
<AlexLuna@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Thank you Sue, but still got the same error at Configuration Manager.
>The account has granted Logon as Service right in the domain and in Domain
>Controllers. I had set the same permissions for that account in both SQL
>Server. The only difference I see is that the SQL Server where the account
is
>able to start the service is not a domain controller, and the other SQL
>Server it is.
>-Alex
>"Sue Hoegemeier" wrote:
>|||Sue
If I use the prefix, I got error 0x80070534, if I don't use the prefix I got
the error 0x80070056, incorrect network password, but I'm sure the password
is correct. Something similar happens when I use RUN AS command (or screen)
on the DC, if I type the user with domain prefix, it starts the app as that
user (the same I want SQL services start with), but if I don't use the prefi
x
at RUN AS window or command, the password error appears. Maybe, I have a
misconfiguration at domain level...?
Thank you for your help
-Alex
"Sue Hoegemeier" wrote:
[vbcol=seagreen]
> Which same error? One error you are getting due to running
> SQL Server on a domain controller is using the domain
> prefix. When you removed the prefix, the error was:
> "The specified network password is not correct."
> Which means the password you used for the account was
> incorrect.
> -Sue
> On Thu, 22 Feb 2007 13:02:47 -0800, Alex Luna
> <AlexLuna@.discussions.microsoft.com> wrote:
>|||Hi Alex,
Managing this on a domain controller can be a pain. The
permissions don't always get set correctly due to security
issues - it's a different risk when you install SQL Server
on a domain controller.
You'll need to start by walking through all the permissions
for the service account. The following link is probably the
best resource on this:
http://support.microsoft.com/?id=283811
-Sue
On Mon, 26 Feb 2007 08:11:08 -0800, Alex Luna
<AlexLuna@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Sue
>If I use the prefix, I got error 0x80070534, if I don't use the prefix I go
t
>the error 0x80070056, incorrect network password, but I'm sure the password
>is correct. Something similar happens when I use RUN AS command (or screen)
>on the DC, if I type the user with domain prefix, it starts the app as that
>user (the same I want SQL services start with), but if I don't use the pref
ix
>at RUN AS window or command, the password error appears. Maybe, I have a
>misconfiguration at domain level...?
>Thank you for your help
>-Alex
>"Sue Hoegemeier" wrote:
>
Sunday, February 19, 2012
Error - identifier too long
Hi All
I have to work with a list of values passed through from an application that
I have no way of changing. I have to get the values into a procedure.
The values come through in the following format:
('value1','value2','value3',...)
I have no way of knowing how many values will come through.
I developed the following type pf proc:
SET QUOTED_IDENTIFIER off
GO
SET ANSI_NULLS ON
GO
ALTER procedure MyProc @.InParm varchar(8000)
as
begin
declare @.MyVar varchar(8000)
set @.MyVar = @.InParm
--..... this is an examle
end
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
And called it like this using " to enclose the value list:
Exec MyProc "('this is my','list','of choices','that is sent like','this
from the','application','which I have no way','of changing.','this is a very
long list that comes through')"
I get the following error:
Server: Msg 103, Level 15, State 7, Line 1
The identifier that starts with '('this is my','list','of choices','that is
sent like','this from the','application','which I have no way','of
changing.','this i' is too long. Maximum length is 128.
I found somewhere that I should set quoted identifier off, but this didn't
seem to help.
I have to get this list into my proc. Any Suggestions?
Thanks!You can replace all ' with '' (two single quotes) and then surround the
whole text with a single quote. For example:
=====
CREATE PROCEDURE takeLongList (@.theList VARCHAR(8000)) AS
BEGIN
PRINT @.theList
END
GO
EXEC takeLongList '''This is my'', ''Long List'', ''That I cannot change'',
''From what it was'''
GO
=====
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
"Chan" <Chan@.discussions.microsoft.com> wrote in message
news:61815D17-ED68-49D6-8489-BC397B466EC1@.microsoft.com...
> Hi All
> I have to work with a list of values passed through from an application
> that
> I have no way of changing. I have to get the values into a procedure.
> The values come through in the following format:
> ('value1','value2','value3',...)
> I have no way of knowing how many values will come through.
> I developed the following type pf proc:
> SET QUOTED_IDENTIFIER off
> GO
> SET ANSI_NULLS ON
> GO
> ALTER procedure MyProc @.InParm varchar(8000)
> as
> begin
> declare @.MyVar varchar(8000)
> set @.MyVar = @.InParm
> --..... this is an examle
> end
>
> GO
> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS ON
> GO
> And called it like this using " to enclose the value list:
> Exec MyProc "('this is my','list','of choices','that is sent like','this
> from the','application','which I have no way','of changing.','this is a
> very
> long list that comes through')"
>
> I get the following error:
> Server: Msg 103, Level 15, State 7, Line 1
> The identifier that starts with '('this is my','list','of choices','that
> is
> sent like','this from the','application','which I have no way','of
> changing.','this i' is too long. Maximum length is 128.
> I found somewhere that I should set quoted identifier off, but this didn't
> seem to help.
> I have to get this list into my proc. Any Suggestions?
> Thanks!|||Hi
tried that tho I can't change how the app sends the list through which is:
('val1','val2','val3',...)
so I tried:
declare @.myVar varchar(8000)
select @.myvar = "('this is my','list','of choices','that is sent like','this
from the','application','which I have no way','of changing.','this is a very
long list that comes through')"
set @.myvar = replace(@.myvar, '''',''')
which still gives the same error.
Am I missing your point here?
Thanks
--
Chan
Programmer
"SriSamp" wrote:
> You can replace all ' with '' (two single quotes) and then surround the
> whole text with a single quote. For example:
> =====
> CREATE PROCEDURE takeLongList (@.theList VARCHAR(8000)) AS
> BEGIN
> PRINT @.theList
> END
> GO
> EXEC takeLongList '''This is my'', ''Long List'', ''That I cannot change''
,
> ''From what it was'''
> GO
> =====
> --
> HTH,
> SriSamp
> Email: srisamp@.gmail.com
> Blog: http://blogs.sqlxml.org/srinivassampath
> URL: http://www32.brinkster.com/srisamp
> "Chan" <Chan@.discussions.microsoft.com> wrote in message
> news:61815D17-ED68-49D6-8489-BC397B466EC1@.microsoft.com...
>
>|||> Am I missing your point here?
Yes. SQL Server expects ' to be a string delimiter. So, when you pass
'val1','val2'
What I would suggest doing, unless ' appears in the data itself, is
replacing all instances of ' with space(0) (empty space) and surrounding the
whole string with a single set of quotes.
> tried that tho I can't change how the app sends the list
Well, the app is doing it wrong, and it will need to change. How can you
not be in a position to change an app that could never have possibly worked?
A|||What I showed was an example and you can see that I do the '' when I
actually pass the parameter to the SP. This means that your application will
have to change to send it this way.
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
"Chan" <Chan@.discussions.microsoft.com> wrote in message
news:24688FF2-F179-436D-B0A0-0C35AE87D7FE@.microsoft.com...
> Hi
> tried that tho I can't change how the app sends the list through which is:
> ('val1','val2','val3',...)
> so I tried:
> declare @.myVar varchar(8000)
> select @.myvar = "('this is my','list','of choices','that is sent
> like','this
> from the','application','which I have no way','of changing.','this is a
> very
> long list that comes through')"
> set @.myvar = replace(@.myvar, '''',''')
> which still gives the same error.
> Am I missing your point here?
> Thanks
> --
> Chan
> Programmer
>
> "SriSamp" wrote:
>|||Hi
I really have no way of changing the app as it was something we purchased
froom another company and they have the parameters setuyp the way they need
to use them.
--
Chan
Programmer
"SriSamp" wrote:
> What I showed was an example and you can see that I do the '' when I
> actually pass the parameter to the SP. This means that your application wi
ll
> have to change to send it this way.
> --
> HTH,
> SriSamp
> Email: srisamp@.gmail.com
> Blog: http://blogs.sqlxml.org/srinivassampath
> URL: http://www32.brinkster.com/srisamp
> "Chan" <Chan@.discussions.microsoft.com> wrote in message
> news:24688FF2-F179-436D-B0A0-0C35AE87D7FE@.microsoft.com...
>
>|||Then go back to them, because they are wrong.
> I really have no way of changing the app as it was something we purchased
> froom another company and they have the parameters setuyp the way they
> need
> to use them.
I have to work with a list of values passed through from an application that
I have no way of changing. I have to get the values into a procedure.
The values come through in the following format:
('value1','value2','value3',...)
I have no way of knowing how many values will come through.
I developed the following type pf proc:
SET QUOTED_IDENTIFIER off
GO
SET ANSI_NULLS ON
GO
ALTER procedure MyProc @.InParm varchar(8000)
as
begin
declare @.MyVar varchar(8000)
set @.MyVar = @.InParm
--..... this is an examle
end
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
And called it like this using " to enclose the value list:
Exec MyProc "('this is my','list','of choices','that is sent like','this
from the','application','which I have no way','of changing.','this is a very
long list that comes through')"
I get the following error:
Server: Msg 103, Level 15, State 7, Line 1
The identifier that starts with '('this is my','list','of choices','that is
sent like','this from the','application','which I have no way','of
changing.','this i' is too long. Maximum length is 128.
I found somewhere that I should set quoted identifier off, but this didn't
seem to help.
I have to get this list into my proc. Any Suggestions?
Thanks!You can replace all ' with '' (two single quotes) and then surround the
whole text with a single quote. For example:
=====
CREATE PROCEDURE takeLongList (@.theList VARCHAR(8000)) AS
BEGIN
PRINT @.theList
END
GO
EXEC takeLongList '''This is my'', ''Long List'', ''That I cannot change'',
''From what it was'''
GO
=====
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
"Chan" <Chan@.discussions.microsoft.com> wrote in message
news:61815D17-ED68-49D6-8489-BC397B466EC1@.microsoft.com...
> Hi All
> I have to work with a list of values passed through from an application
> that
> I have no way of changing. I have to get the values into a procedure.
> The values come through in the following format:
> ('value1','value2','value3',...)
> I have no way of knowing how many values will come through.
> I developed the following type pf proc:
> SET QUOTED_IDENTIFIER off
> GO
> SET ANSI_NULLS ON
> GO
> ALTER procedure MyProc @.InParm varchar(8000)
> as
> begin
> declare @.MyVar varchar(8000)
> set @.MyVar = @.InParm
> --..... this is an examle
> end
>
> GO
> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS ON
> GO
> And called it like this using " to enclose the value list:
> Exec MyProc "('this is my','list','of choices','that is sent like','this
> from the','application','which I have no way','of changing.','this is a
> very
> long list that comes through')"
>
> I get the following error:
> Server: Msg 103, Level 15, State 7, Line 1
> The identifier that starts with '('this is my','list','of choices','that
> is
> sent like','this from the','application','which I have no way','of
> changing.','this i' is too long. Maximum length is 128.
> I found somewhere that I should set quoted identifier off, but this didn't
> seem to help.
> I have to get this list into my proc. Any Suggestions?
> Thanks!|||Hi
tried that tho I can't change how the app sends the list through which is:
('val1','val2','val3',...)
so I tried:
declare @.myVar varchar(8000)
select @.myvar = "('this is my','list','of choices','that is sent like','this
from the','application','which I have no way','of changing.','this is a very
long list that comes through')"
set @.myvar = replace(@.myvar, '''',''')
which still gives the same error.
Am I missing your point here?
Thanks
--
Chan
Programmer
"SriSamp" wrote:
> You can replace all ' with '' (two single quotes) and then surround the
> whole text with a single quote. For example:
> =====
> CREATE PROCEDURE takeLongList (@.theList VARCHAR(8000)) AS
> BEGIN
> PRINT @.theList
> END
> GO
> EXEC takeLongList '''This is my'', ''Long List'', ''That I cannot change''
,
> ''From what it was'''
> GO
> =====
> --
> HTH,
> SriSamp
> Email: srisamp@.gmail.com
> Blog: http://blogs.sqlxml.org/srinivassampath
> URL: http://www32.brinkster.com/srisamp
> "Chan" <Chan@.discussions.microsoft.com> wrote in message
> news:61815D17-ED68-49D6-8489-BC397B466EC1@.microsoft.com...
>
>|||> Am I missing your point here?
Yes. SQL Server expects ' to be a string delimiter. So, when you pass
'val1','val2'
What I would suggest doing, unless ' appears in the data itself, is
replacing all instances of ' with space(0) (empty space) and surrounding the
whole string with a single set of quotes.
> tried that tho I can't change how the app sends the list
Well, the app is doing it wrong, and it will need to change. How can you
not be in a position to change an app that could never have possibly worked?
A|||What I showed was an example and you can see that I do the '' when I
actually pass the parameter to the SP. This means that your application will
have to change to send it this way.
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
"Chan" <Chan@.discussions.microsoft.com> wrote in message
news:24688FF2-F179-436D-B0A0-0C35AE87D7FE@.microsoft.com...
> Hi
> tried that tho I can't change how the app sends the list through which is:
> ('val1','val2','val3',...)
> so I tried:
> declare @.myVar varchar(8000)
> select @.myvar = "('this is my','list','of choices','that is sent
> like','this
> from the','application','which I have no way','of changing.','this is a
> very
> long list that comes through')"
> set @.myvar = replace(@.myvar, '''',''')
> which still gives the same error.
> Am I missing your point here?
> Thanks
> --
> Chan
> Programmer
>
> "SriSamp" wrote:
>|||Hi
I really have no way of changing the app as it was something we purchased
froom another company and they have the parameters setuyp the way they need
to use them.
--
Chan
Programmer
"SriSamp" wrote:
> What I showed was an example and you can see that I do the '' when I
> actually pass the parameter to the SP. This means that your application wi
ll
> have to change to send it this way.
> --
> HTH,
> SriSamp
> Email: srisamp@.gmail.com
> Blog: http://blogs.sqlxml.org/srinivassampath
> URL: http://www32.brinkster.com/srisamp
> "Chan" <Chan@.discussions.microsoft.com> wrote in message
> news:24688FF2-F179-436D-B0A0-0C35AE87D7FE@.microsoft.com...
>
>|||Then go back to them, because they are wrong.
> I really have no way of changing the app as it was something we purchased
> froom another company and they have the parameters setuyp the way they
> need
> to use them.
Subscribe to:
Posts (Atom)