Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Wednesday, March 28, 2012

PrecompileScriptIntoBinaryCode errors

Hi,

I have several script tasks. Every now and then I get an error that the task can't precompile the script into binary code, or something to that effect. It's very intermittent, so it doesn't really seem to have any rhyme or reason.

For example, I have a package that has been running perfectly for weeks now, but just TODAY it decided to give me a precompile error. So I changed the "PrecompileScriptIntoBinaryCode" setting to "false", and that solved the problem.

I don't get why this is happening. It seems like a bug. It makes me wonder if I should set all scripts to "false."

Thanks

sadie519590 wrote:

Hi,

I have several script tasks. Every now and then I get an error that the task can't precompile the script into binary code,

Does it give any more info? Like WHY it can't compile it?

-Jamie

|||Not that I remember. I can't reproduce this error at will. I just know that it happens with the script task once in a while, for reasons that aren't clear or logical, and seemingly random. I do think this is a bug.|||

Here is the error:

Error 1 Validation error. myTask : The task is configured to pre-compile the script, but binary code is not found. Please visit the IDE in Script Task Editor by clicking Design Script button to cause binary code to be generated. CashRec - BMO.dtsx 0 0

|||So do that and go in and hit the space bar somewhere in the script. Then close out of it and try again.|||

Tried that. But didn't work.

Why would that fix it? Seems strange to me....

I had this error happen AGAIN. This is what caused it: I went into the script, highlighted some code, then copied it to the clipboard for use in another place. Then I exited the script using the cancel button. NOTHING CHANGED.

Next thing I know, the script task is giving me the recompile error. This does seem buggy, doesn't it?

|||

Ugh - this keeps happening! All I do is go into the script, highlight some rows, then copy the data to the clipboard. Nothing changes in the script itself.

Then, once I'm out of the script, it displays the error. Changing the precompile to "false" gets rid of the problem.

But I don't think this problem should happen to begin with... it seems really flaky.

I had a package hang a job up for over 24 hours (it just ran and ran and never completed) due to a script error of this nature. This is not good because it doesn't even send an error message.

|||Do you have SP2 installed?|||

No.

If this was my server, it would have.

|||

sadie519590 wrote:

No.

If this was my server, it would have.

Then this likely applies to you:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1855810&SiteID=1

PrecompileScriptIntoBinaryCode errors

Hi,

I have several script tasks. Every now and then I get an error that the task can't precompile the script into binary code, or something to that effect. It's very intermittent, so it doesn't really seem to have any rhyme or reason.

For example, I have a package that has been running perfectly for weeks now, but just TODAY it decided to give me a precompile error. So I changed the "PrecompileScriptIntoBinaryCode" setting to "false", and that solved the problem.

I don't get why this is happening. It seems like a bug. It makes me wonder if I should set all scripts to "false."

Thanks

sadie519590 wrote:

Hi,

I have several script tasks. Every now and then I get an error that the task can't precompile the script into binary code,

Does it give any more info? Like WHY it can't compile it?

-Jamie

|||Not that I remember. I can't reproduce this error at will. I just know that it happens with the script task once in a while, for reasons that aren't clear or logical, and seemingly random. I do think this is a bug.|||

Here is the error:

Error 1 Validation error. myTask : The task is configured to pre-compile the script, but binary code is not found. Please visit the IDE in Script Task Editor by clicking Design Script button to cause binary code to be generated. CashRec - BMO.dtsx 0 0

|||So do that and go in and hit the space bar somewhere in the script. Then close out of it and try again.|||

Tried that. But didn't work.

Why would that fix it? Seems strange to me....

I had this error happen AGAIN. This is what caused it: I went into the script, highlighted some code, then copied it to the clipboard for use in another place. Then I exited the script using the cancel button. NOTHING CHANGED.

Next thing I know, the script task is giving me the recompile error. This does seem buggy, doesn't it?

|||

Ugh - this keeps happening! All I do is go into the script, highlight some rows, then copy the data to the clipboard. Nothing changes in the script itself.

Then, once I'm out of the script, it displays the error. Changing the precompile to "false" gets rid of the problem.

But I don't think this problem should happen to begin with... it seems really flaky.

I had a package hang a job up for over 24 hours (it just ran and ran and never completed) due to a script error of this nature. This is not good because it doesn't even send an error message.

|||Do you have SP2 installed?|||

No.

If this was my server, it would have.

|||

sadie519590 wrote:

No.

If this was my server, it would have.

Then this likely applies to you:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1855810&SiteID=1

Precompile Script task programatically

I have code which generates packages programatically, and script task is a part of the control flow. I've succeded to set source code programatically, but I do not know how to put binary code, because I need to have my script task precompiled.

Just setting PreCompile = true does not solve this problem

Thanks in advance.

Borko

Unfortunately, due to interactions with VSA (the script editing environment) this is not possible in this version.

Monday, March 26, 2012

Pre snapshot to apply permissions

Hi.
I would like to apply the objects' permissions after to apply an snapshot.
To do it, I need a script file, with the grant commands to apply that
permissions.
Could I get that script just before applying the snapshot with any t-sql
command to generate and save the script file with these permissions?.
So if the objects' permissions have change from the last time I applied the
snapshot or i have created new objects, I can be sure that the permissions
transfered are accurate.
Thank you
Jorge,
here is a script I use which can be adapted for your needs. srvname is the
subscriber and delivery is the name of my database. I already have the
logins and users, and if you don't have them, then I'll leave you to create
that script
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
SELECT 'Grant ' +
case
when action = 193 then 'SELECT'
when action = 195 then 'INSERT'
when action = 196 then 'DELETE'
when action = 197 then 'UPDATE'
when action = 224 then 'EXECUTE'
end as Grant1,
' ON [' + delivery.dbo.sysobjects.name + '] TO ' +
delivery.dbo.sysusers.name as Grant2
--,ss.srvname
--,delivery.dbo.syspublications.name AS Publication
FROM delivery.dbo.syssubscriptions
INNER JOIN delivery.dbo.sysextendedarticlesview ON
delivery.dbo.syssubscriptions.artid =
delivery.dbo.sysextendedarticlesview.artid
INNER JOIN delivery.dbo.sysobjects ON
delivery.dbo.sysextendedarticlesview.objid =
delivery.dbo.sysobjects.id
INNER JOIN delivery.dbo.syspublications ON
delivery.dbo.sysextendedarticlesview.pubid =
delivery.dbo.syspublications.pubid
INNER JOIN master..sysservers ss on ss.srvid =
delivery.dbo.syssubscriptions.srvid
left outer JOIN delivery.dbo.sysprotects on
delivery.dbo.sysprotects.id = delivery.dbo.sysobjects.id
left outer JOIN delivery.dbo.sysusers on
delivery.dbo.sysprotects.uid = delivery.dbo.sysusers.uid
where action in (193,195,196,197,224)
--and srvname = 'xxx\PDSCOPY'
and srvname = 'yyy\PDSCOPY'
order by ss.srvname, delivery.dbo.syspublications.name,
delivery.dbo.sysobjects.name, delivery.dbo.sysusers.name
"Jorge" <Jorge@.discussions.microsoft.com> wrote in message
news:18488D2B-1F12-4D30-91C7-894EDE31D557@.microsoft.com...
> Hi.
> I would like to apply the objects' permissions after to apply an snapshot.
> To do it, I need a script file, with the grant commands to apply that
> permissions.
> Could I get that script just before applying the snapshot with any t-sql
> command to generate and save the script file with these permissions?.
> So if the objects' permissions have change from the last time I applied
the
> snapshot or i have created new objects, I can be sure that the permissions
> transfered are accurate.
> Thank you
|||Very good, Paul.
It's exactly what I was looking for
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> escribi en el mensaje
news:eXmbfaX2EHA.2192@.TK2MSFTNGP14.phx.gbl...
> Jorge,
> here is a script I use which can be adapted for your needs. srvname is the
> subscriber and delivery is the name of my database. I already have the
> logins and users, and if you don't have them, then I'll leave you to
> create
> that script
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
> SELECT 'Grant ' +
> case
> when action = 193 then 'SELECT'
> when action = 195 then 'INSERT'
> when action = 196 then 'DELETE'
> when action = 197 then 'UPDATE'
> when action = 224 then 'EXECUTE'
> end as Grant1,
> ' ON [' + delivery.dbo.sysobjects.name + '] TO ' +
> delivery.dbo.sysusers.name as Grant2
> --,ss.srvname
> --,delivery.dbo.syspublications.name AS Publication
> FROM delivery.dbo.syssubscriptions
> INNER JOIN delivery.dbo.sysextendedarticlesview ON
> delivery.dbo.syssubscriptions.artid =
> delivery.dbo.sysextendedarticlesview.artid
> INNER JOIN delivery.dbo.sysobjects ON
> delivery.dbo.sysextendedarticlesview.objid =
> delivery.dbo.sysobjects.id
> INNER JOIN delivery.dbo.syspublications ON
> delivery.dbo.sysextendedarticlesview.pubid =
> delivery.dbo.syspublications.pubid
> INNER JOIN master..sysservers ss on ss.srvid =
> delivery.dbo.syssubscriptions.srvid
> left outer JOIN delivery.dbo.sysprotects on
> delivery.dbo.sysprotects.id = delivery.dbo.sysobjects.id
> left outer JOIN delivery.dbo.sysusers on
> delivery.dbo.sysprotects.uid = delivery.dbo.sysusers.uid
> where action in (193,195,196,197,224)
> --and srvname = 'xxx\PDSCOPY'
> and srvname = 'yyy\PDSCOPY'
> order by ss.srvname, delivery.dbo.syspublications.name,
> delivery.dbo.sysobjects.name, delivery.dbo.sysusers.name
>
> "Jorge" <Jorge@.discussions.microsoft.com> wrote in message
> news:18488D2B-1F12-4D30-91C7-894EDE31D557@.microsoft.com...
> the
>

Tuesday, March 20, 2012

Post 2005 SP2 install, no script component can be edited.

Anyone starting to see "Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)" after installing SQL Server 2005 SP2 on x86 machines? Second, how can it be fixed?

After installing SP2, the script component editor will not edit script components created in pre SP2 releases. (I also have Visual Studio 2005 SP1 installed). The script TASK editor will start, but when attempting to open a script COMPONENT in the VSA editor, a script component created for pre-SP2 packages, the following error dialog occurs.

Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)

This same error dialog has occurred on multiple computers, none of them are running Vista (rather Windows XP SP2). All of the pre-existent pre-SP2 script components have Precompile set to true as well, since they are intended for 64 bit machines.

Now, certain posts say, register DLLs in the following directories via:
for %i in (*.dll) do RegSvr32 -s %i.

C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\common\
C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\vsa

One problem with these instruction is that the second directory doesn't even exist, however, a directory called "C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\VsaEnv" does exist, which is perhaps what was meant. Even after registering the DLLs there, the script component editor will not open (erroring out after clicking the "Design Script..." button).

Yes I have similar issue. I cant edit my script component. I am getting an following error message when I click on "Design Script".

Cannot Show Visual Studio for Applications Editor. Engine Returned Unknown Error

Anyone else?

Thanks

Sutha

|||

I haven’t seen anything like this. From the look of it the VSA is installed properly (you mentioned that you can start designer for the script task but not for the script component). Can you design new script components on that machine?

Thanks

|||New SP2 script components and tasks can be created and edited.

Script components created prior to SP2 (at least those created on 2153 and perhaps earlier) cannot be opened, at least on Windows XP. On Windows 2003 Server (32 or 64 bit) I have not observed any issue (the editor open's fine on the same .dtsx that fails to open on an XP machine).|||

I have the exact same issue and here is an interesting addition:

If I add a new script component (without attaching it to anything) and attempt to view the script it actually brings up the script editor with the code of the old script component that I was trying to open in the first place.

I guess I'll have to uninstall SP2 at this point.

Daryl

|||If you're on Vista, try the hotfix:
http://support.microsoft.com/default.aspx/kb/931846|||

This uneditable script component problem is specifically noticed on Windows XP and is unsolved and without reasonable workaround(e.g. total replacement of OS with Win2k3).

The Vista script component create/edit issue is indeed solved with that 931846 hotfix (the receipt of which requires a call to Microsoft PSS as it is not regression tested).

|||I can definitely confirm this exact problem after an install of SS2005 SP2a. Exactly
as described. A little confused, the problem says it is with WinXP Pro - which I have -
but patch is for Vista? Anybody install the patch on XP or found another workaround.|||OK, there are 2 different patches for this. One for WinXP, one for Vista - they have
different patching systems. So if you call MS, make sure they know which one you want.

The patch number and KB article are the same. Welcome to Microsoft....|||Are you saying this is resolved? I don't believe it for one second, and I'll happily admit to being wrong. What is the URL, if you would be so kind?|||I'm having the same problem. Where can I find the XP patch?|||Yes, resolved to my satisfaction. I got the WinXP patch and it fixed the problem
and I working fine now. 2 iterations with MS to get the right one. Vista has
a totally new and different patching mechanism, but the patch underneath is the same.

KB928208|||Yes, resolved to my satisfaction. I got the WinXP patch and it fixed the problem
and I am working fine now. 2 iterations with MS to get the right one. Vista has
a totally new and different patching mechanism, but the patch underneath is the same.

http://support.microsoft.com/default.aspx/kb/928208

You have to call MS to get this.
|||After two disconnects without being able to talk to anybody, a 90 minute wait time on the third try, and two more hours trying get this error solved, we got it to work. At least, some sort of temp solution until a KB / hotfix is available.
Keep in mind this is for a Win Server 2k3 environment and not exactly the most recommended solution.
Anyways, this was my fix.
Go to your pacakge code ( right click the package in the solution explorer and select view code ). Search for every "ReferencePath" and pretty much replace
""C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.DTSRuntimeWrap\" with "C:\WINDOWS\assembly\GAC_32\Microsoft.SqlServer.DTSRuntimeWrap\". (the rightmost reference)
Viola! That's it!

For now, I'll only do this for the packages I need to edit.

I hope this helps.

Thanks,
Alonso|||That's what I sent to Microsoft last night ( swap GAC_MSIL to GAC_32 on the reference path) and the 2153 script component starts working. Didn't post that advice on the forum because I wanted to hear back from Microsoft as to whether that was a legitimate solution, indicative of an underlying issue (perhaps with ngen.exe's queue), or both or neither. I understand that its not the most recommended solution, but its the only solution right now.

Post 2005 SP2 install, no script component can be edited.

Anyone starting to see "Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)" after installing SQL Server 2005 SP2 on x86 machines? Second, how can it be fixed?

After installing SP2, the script component editor will not edit script components created in pre SP2 releases. (I also have Visual Studio 2005 SP1 installed). The script TASK editor will start, but when attempting to open a script COMPONENT in the VSA editor, a script component created for pre-SP2 packages, the following error dialog occurs.

Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)

This same error dialog has occurred on multiple computers, none of them are running Vista (rather Windows XP SP2). All of the pre-existent pre-SP2 script components have Precompile set to true as well, since they are intended for 64 bit machines.

Now, certain posts say, register DLLs in the following directories via:
for %i in (*.dll) do RegSvr32 -s %i.

C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\common\
C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\vsa

One problem with these instruction is that the second directory doesn't even exist, however, a directory called "C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\VsaEnv" does exist, which is perhaps what was meant. Even after registering the DLLs there, the script component editor will not open (erroring out after clicking the "Design Script..." button).

Yes I have similar issue. I cant edit my script component. I am getting an following error message when I click on "Design Script".

Cannot Show Visual Studio for Applications Editor. Engine Returned Unknown Error

Anyone else?

Thanks

Sutha

|||

I haven’t seen anything like this. From the look of it the VSA is installed properly (you mentioned that you can start designer for the script task but not for the script component). Can you design new script components on that machine?

Thanks

|||New SP2 script components and tasks can be created and edited.

Script components created prior to SP2 (at least those created on 2153 and perhaps earlier) cannot be opened, at least on Windows XP. On Windows 2003 Server (32 or 64 bit) I have not observed any issue (the editor open's fine on the same .dtsx that fails to open on an XP machine).
|||

I have the exact same issue and here is an interesting addition:

If I add a new script component (without attaching it to anything) and attempt to view the script it actually brings up the script editor with the code of the old script component that I was trying to open in the first place.

I guess I'll have to uninstall SP2 at this point.

Daryl

|||If you're on Vista, try the hotfix:
http://support.microsoft.com/default.aspx/kb/931846|||

This uneditable script component problem is specifically noticed on Windows XP and is unsolved and without reasonable workaround(e.g. total replacement of OS with Win2k3).

The Vista script component create/edit issue is indeed solved with that 931846 hotfix (the receipt of which requires a call to Microsoft PSS as it is not regression tested).

|||I can definitely confirm this exact problem after an install of SS2005 SP2a. Exactly
as described. A little confused, the problem says it is with WinXP Pro - which I have -
but patch is for Vista? Anybody install the patch on XP or found another workaround.

|||OK, there are 2 different patches for this. One for WinXP, one for Vista - they have
different patching systems. So if you call MS, make sure they know which one you want.

The patch number and KB article are the same. Welcome to Microsoft....

|||Are you saying this is resolved? I don't believe it for one second, and I'll happily admit to being wrong. What is the URL, if you would be so kind?
|||I'm having the same problem. Where can I find the XP patch?|||Yes, resolved to my satisfaction. I got the WinXP patch and it fixed the problem
and I working fine now. 2 iterations with MS to get the right one. Vista has
a totally new and different patching mechanism, but the patch underneath is the same.

KB928208

|||Yes, resolved to my satisfaction. I got the WinXP patch and it fixed the problem
and I am working fine now. 2 iterations with MS to get the right one. Vista has
a totally new and different patching mechanism, but the patch underneath is the same.

http://support.microsoft.com/default.aspx/kb/928208

You have to call MS to get this.
|||After two disconnects without being able to talk to anybody, a 90 minute wait time on the third try, and two more hours trying get this error solved, we got it to work. At least, some sort of temp solution until a KB / hotfix is available.
Keep in mind this is for a Win Server 2k3 environment and not exactly the most recommended solution.
Anyways, this was my fix.
Go to your pacakge code ( right click the package in the solution explorer and select view code ). Search for every "ReferencePath" and pretty much replace
""C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.DTSRuntimeWrap\" with "C:\WINDOWS\assembly\GAC_32\Microsoft.SqlServer.DTSRuntimeWrap\". (the rightmost reference)
Viola! That's it!

For now, I'll only do this for the packages I need to edit.

I hope this helps.

Thanks,
Alonso
|||That's what I sent to Microsoft last night ( swap GAC_MSIL to GAC_32 on the reference path) and the 2153 script component starts working. Didn't post that advice on the forum because I wanted to hear back from Microsoft as to whether that was a legitimate solution, indicative of an underlying issue (perhaps with ngen.exe's queue), or both or neither. I understand that its not the most recommended solution, but its the only solution right now.

Post 2005 SP2 install, no script component can be edited.

Anyone starting to see "Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)" after installing SQL Server 2005 SP2 on x86 machines? Second, how can it be fixed?

After installing SP2, the script component editor will not edit script components created in pre SP2 releases. (I also have Visual Studio 2005 SP1 installed). The script TASK editor will start, but when attempting to open a script COMPONENT in the VSA editor, a script component created for pre-SP2 packages, the following error dialog occurs.

Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)

This same error dialog has occurred on multiple computers, none of them are running Vista (rather Windows XP SP2). All of the pre-existent pre-SP2 script components have Precompile set to true as well, since they are intended for 64 bit machines.

Now, certain posts say, register DLLs in the following directories via:
for %i in (*.dll) do RegSvr32 -s %i.

C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\common\
C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\vsa

One problem with these instruction is that the second directory doesn't even exist, however, a directory called "C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\VsaEnv" does exist, which is perhaps what was meant. Even after registering the DLLs there, the script component editor will not open (erroring out after clicking the "Design Script..." button).

Yes I have similar issue. I cant edit my script component. I am getting an following error message when I click on "Design Script".

Cannot Show Visual Studio for Applications Editor. Engine Returned Unknown Error

Anyone else?

Thanks

Sutha

|||

I haven’t seen anything like this. From the look of it the VSA is installed properly (you mentioned that you can start designer for the script task but not for the script component). Can you design new script components on that machine?

Thanks

|||New SP2 script components and tasks can be created and edited.

Script components created prior to SP2 (at least those created on 2153 and perhaps earlier) cannot be opened, at least on Windows XP. On Windows 2003 Server (32 or 64 bit) I have not observed any issue (the editor open's fine on the same .dtsx that fails to open on an XP machine).
|||

I have the exact same issue and here is an interesting addition:

If I add a new script component (without attaching it to anything) and attempt to view the script it actually brings up the script editor with the code of the old script component that I was trying to open in the first place.

I guess I'll have to uninstall SP2 at this point.

Daryl

|||If you're on Vista, try the hotfix:
http://support.microsoft.com/default.aspx/kb/931846|||

This uneditable script component problem is specifically noticed on Windows XP and is unsolved and without reasonable workaround(e.g. total replacement of OS with Win2k3).

The Vista script component create/edit issue is indeed solved with that 931846 hotfix (the receipt of which requires a call to Microsoft PSS as it is not regression tested).

|||I can definitely confirm this exact problem after an install of SS2005 SP2a. Exactly
as described. A little confused, the problem says it is with WinXP Pro - which I have -
but patch is for Vista? Anybody install the patch on XP or found another workaround.

|||OK, there are 2 different patches for this. One for WinXP, one for Vista - they have
different patching systems. So if you call MS, make sure they know which one you want.

The patch number and KB article are the same. Welcome to Microsoft....

|||Are you saying this is resolved? I don't believe it for one second, and I'll happily admit to being wrong. What is the URL, if you would be so kind?
|||I'm having the same problem. Where can I find the XP patch?|||Yes, resolved to my satisfaction. I got the WinXP patch and it fixed the problem
and I working fine now. 2 iterations with MS to get the right one. Vista has
a totally new and different patching mechanism, but the patch underneath is the same.

KB928208

|||Yes, resolved to my satisfaction. I got the WinXP patch and it fixed the problem
and I am working fine now. 2 iterations with MS to get the right one. Vista has
a totally new and different patching mechanism, but the patch underneath is the same.

http://support.microsoft.com/default.aspx/kb/928208

You have to call MS to get this.
|||After two disconnects without being able to talk to anybody, a 90 minute wait time on the third try, and two more hours trying get this error solved, we got it to work. At least, some sort of temp solution until a KB / hotfix is available.
Keep in mind this is for a Win Server 2k3 environment and not exactly the most recommended solution.
Anyways, this was my fix.
Go to your pacakge code ( right click the package in the solution explorer and select view code ). Search for every "ReferencePath" and pretty much replace
""C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.DTSRuntimeWrap\" with "C:\WINDOWS\assembly\GAC_32\Microsoft.SqlServer.DTSRuntimeWrap\". (the rightmost reference)
Viola! That's it!

For now, I'll only do this for the packages I need to edit.

I hope this helps.

Thanks,
Alonso
|||That's what I sent to Microsoft last night ( swap GAC_MSIL to GAC_32 on the reference path) and the 2153 script component starts working. Didn't post that advice on the forum because I wanted to hear back from Microsoft as to whether that was a legitimate solution, indicative of an underlying issue (perhaps with ngen.exe's queue), or both or neither. I understand that its not the most recommended solution, but its the only solution right now.

Post 2005 SP2 install, no script component can be edited.

Anyone starting to see "Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)" after installing SQL Server 2005 SP2 on x86 machines? Second, how can it be fixed?

After installing SP2, the script component editor will not edit script components created in pre SP2 releases. (I also have Visual Studio 2005 SP1 installed). The script TASK editor will start, but when attempting to open a script COMPONENT in the VSA editor, a script component created for pre-SP2 packages, the following error dialog occurs.

Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)

This same error dialog has occurred on multiple computers, none of them are running Vista (rather Windows XP SP2). All of the pre-existent pre-SP2 script components have Precompile set to true as well, since they are intended for 64 bit machines.

Now, certain posts say, register DLLs in the following directories via:
for %i in (*.dll) do RegSvr32 -s %i.

C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\common\
C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\vsa

One problem with these instruction is that the second directory doesn't even exist, however, a directory called "C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\VsaEnv" does exist, which is perhaps what was meant. Even after registering the DLLs there, the script component editor will not open (erroring out after clicking the "Design Script..." button).

Yes I have similar issue. I cant edit my script component. I am getting an following error message when I click on "Design Script".

Cannot Show Visual Studio for Applications Editor. Engine Returned Unknown Error

Anyone else?

Thanks

Sutha

|||

I haven’t seen anything like this. From the look of it the VSA is installed properly (you mentioned that you can start designer for the script task but not for the script component). Can you design new script components on that machine?

Thanks

|||New SP2 script components and tasks can be created and edited.

Script components created prior to SP2 (at least those created on 2153 and perhaps earlier) cannot be opened, at least on Windows XP. On Windows 2003 Server (32 or 64 bit) I have not observed any issue (the editor open's fine on the same .dtsx that fails to open on an XP machine).|||

I have the exact same issue and here is an interesting addition:

If I add a new script component (without attaching it to anything) and attempt to view the script it actually brings up the script editor with the code of the old script component that I was trying to open in the first place.

I guess I'll have to uninstall SP2 at this point.

Daryl

|||If you're on Vista, try the hotfix:
http://support.microsoft.com/default.aspx/kb/931846|||

This uneditable script component problem is specifically noticed on Windows XP and is unsolved and without reasonable workaround(e.g. total replacement of OS with Win2k3).

The Vista script component create/edit issue is indeed solved with that 931846 hotfix (the receipt of which requires a call to Microsoft PSS as it is not regression tested).

|||I can definitely confirm this exact problem after an install of SS2005 SP2a. Exactly
as described. A little confused, the problem says it is with WinXP Pro - which I have -
but patch is for Vista? Anybody install the patch on XP or found another workaround.|||OK, there are 2 different patches for this. One for WinXP, one for Vista - they have
different patching systems. So if you call MS, make sure they know which one you want.

The patch number and KB article are the same. Welcome to Microsoft....|||Are you saying this is resolved? I don't believe it for one second, and I'll happily admit to being wrong. What is the URL, if you would be so kind?|||I'm having the same problem. Where can I find the XP patch?|||Yes, resolved to my satisfaction. I got the WinXP patch and it fixed the problem
and I working fine now. 2 iterations with MS to get the right one. Vista has
a totally new and different patching mechanism, but the patch underneath is the same.

KB928208|||Yes, resolved to my satisfaction. I got the WinXP patch and it fixed the problem
and I am working fine now. 2 iterations with MS to get the right one. Vista has
a totally new and different patching mechanism, but the patch underneath is the same.

http://support.microsoft.com/default.aspx/kb/928208

You have to call MS to get this.
|||After two disconnects without being able to talk to anybody, a 90 minute wait time on the third try, and two more hours trying get this error solved, we got it to work. At least, some sort of temp solution until a KB / hotfix is available.
Keep in mind this is for a Win Server 2k3 environment and not exactly the most recommended solution.
Anyways, this was my fix.
Go to your pacakge code ( right click the package in the solution explorer and select view code ). Search for every "ReferencePath" and pretty much replace
""C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.DTSRuntimeWrap\" with "C:\WINDOWS\assembly\GAC_32\Microsoft.SqlServer.DTSRuntimeWrap\". (the rightmost reference)
Viola! That's it!

For now, I'll only do this for the packages I need to edit.

I hope this helps.

Thanks,
Alonso|||That's what I sent to Microsoft last night ( swap GAC_MSIL to GAC_32 on the reference path) and the 2153 script component starts working. Didn't post that advice on the forum because I wanted to hear back from Microsoft as to whether that was a legitimate solution, indicative of an underlying issue (perhaps with ngen.exe's queue), or both or neither. I understand that its not the most recommended solution, but its the only solution right now.

Post 2005 SP2 install, no script component can be edited.

Anyone starting to see "Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)" after installing SQL Server 2005 SP2 on x86 machines? Second, how can it be fixed?

After installing SP2, the script component editor will not edit script components created in pre SP2 releases. (I also have Visual Studio 2005 SP1 installed). The script TASK editor will start, but when attempting to open a script COMPONENT in the VSA editor, a script component created for pre-SP2 packages, the following error dialog occurs.

Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)

This same error dialog has occurred on multiple computers, none of them are running Vista (rather Windows XP SP2). All of the pre-existent pre-SP2 script components have Precompile set to true as well, since they are intended for 64 bit machines.

Now, certain posts say, register DLLs in the following directories via:
for %i in (*.dll) do RegSvr32 -s %i.

C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\common\
C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\vsa

One problem with these instruction is that the second directory doesn't even exist, however, a directory called "C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\VsaEnv" does exist, which is perhaps what was meant. Even after registering the DLLs there, the script component editor will not open (erroring out after clicking the "Design Script..." button).

Yes I have similar issue. I cant edit my script component. I am getting an following error message when I click on "Design Script".

Cannot Show Visual Studio for Applications Editor. Engine Returned Unknown Error

Anyone else?

Thanks

Sutha

|||

I haven’t seen anything like this. From the look of it the VSA is installed properly (you mentioned that you can start designer for the script task but not for the script component). Can you design new script components on that machine?

Thanks

|||New SP2 script components and tasks can be created and edited.

Script components created prior to SP2 (at least those created on 2153 and perhaps earlier) cannot be opened, at least on Windows XP. On Windows 2003 Server (32 or 64 bit) I have not observed any issue (the editor open's fine on the same .dtsx that fails to open on an XP machine).
|||

I have the exact same issue and here is an interesting addition:

If I add a new script component (without attaching it to anything) and attempt to view the script it actually brings up the script editor with the code of the old script component that I was trying to open in the first place.

I guess I'll have to uninstall SP2 at this point.

Daryl

|||If you're on Vista, try the hotfix:
http://support.microsoft.com/default.aspx/kb/931846|||

This uneditable script component problem is specifically noticed on Windows XP and is unsolved and without reasonable workaround(e.g. total replacement of OS with Win2k3).

The Vista script component create/edit issue is indeed solved with that 931846 hotfix (the receipt of which requires a call to Microsoft PSS as it is not regression tested).

|||I can definitely confirm this exact problem after an install of SS2005 SP2a. Exactly
as described. A little confused, the problem says it is with WinXP Pro - which I have -
but patch is for Vista? Anybody install the patch on XP or found another workaround.

|||OK, there are 2 different patches for this. One for WinXP, one for Vista - they have
different patching systems. So if you call MS, make sure they know which one you want.

The patch number and KB article are the same. Welcome to Microsoft....

|||Are you saying this is resolved? I don't believe it for one second, and I'll happily admit to being wrong. What is the URL, if you would be so kind?
|||I'm having the same problem. Where can I find the XP patch?|||Yes, resolved to my satisfaction. I got the WinXP patch and it fixed the problem
and I working fine now. 2 iterations with MS to get the right one. Vista has
a totally new and different patching mechanism, but the patch underneath is the same.

KB928208

|||Yes, resolved to my satisfaction. I got the WinXP patch and it fixed the problem
and I am working fine now. 2 iterations with MS to get the right one. Vista has
a totally new and different patching mechanism, but the patch underneath is the same.

http://support.microsoft.com/default.aspx/kb/928208

You have to call MS to get this.
|||After two disconnects without being able to talk to anybody, a 90 minute wait time on the third try, and two more hours trying get this error solved, we got it to work. At least, some sort of temp solution until a KB / hotfix is available.
Keep in mind this is for a Win Server 2k3 environment and not exactly the most recommended solution.
Anyways, this was my fix.
Go to your pacakge code ( right click the package in the solution explorer and select view code ). Search for every "ReferencePath" and pretty much replace
""C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.DTSRuntimeWrap\" with "C:\WINDOWS\assembly\GAC_32\Microsoft.SqlServer.DTSRuntimeWrap\". (the rightmost reference)
Viola! That's it!

For now, I'll only do this for the packages I need to edit.

I hope this helps.

Thanks,
Alonso
|||That's what I sent to Microsoft last night ( swap GAC_MSIL to GAC_32 on the reference path) and the 2153 script component starts working. Didn't post that advice on the forum because I wanted to hear back from Microsoft as to whether that was a legitimate solution, indicative of an underlying issue (perhaps with ngen.exe's queue), or both or neither. I understand that its not the most recommended solution, but its the only solution right now.

Post 2005 SP2 install, no script component can be edited.

Anyone starting to see "Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)" after installing SQL Server 2005 SP2 on x86 machines? Second, how can it be fixed?

After installing SP2, the script component editor will not edit script components created in pre SP2 releases. (I also have Visual Studio 2005 SP1 installed). The script TASK editor will start, but when attempting to open a script COMPONENT in the VSA editor, a script component created for pre-SP2 packages, the following error dialog occurs.

Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)

This same error dialog has occurred on multiple computers, none of them are running Vista (rather Windows XP SP2). All of the pre-existent pre-SP2 script components have Precompile set to true as well, since they are intended for 64 bit machines.

Now, certain posts say, register DLLs in the following directories via:
for %i in (*.dll) do RegSvr32 -s %i.

C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\common\
C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\vsa

One problem with these instruction is that the second directory doesn't even exist, however, a directory called "C:\Program Files\Common Files\Microsoft Shared\VSA\8.0\VsaEnv" does exist, which is perhaps what was meant. Even after registering the DLLs there, the script component editor will not open (erroring out after clicking the "Design Script..." button).

Yes I have similar issue. I cant edit my script component. I am getting an following error message when I click on "Design Script".

Cannot Show Visual Studio for Applications Editor. Engine Returned Unknown Error

Anyone else?

Thanks

Sutha

|||

I haven’t seen anything like this. From the look of it the VSA is installed properly (you mentioned that you can start designer for the script task but not for the script component). Can you design new script components on that machine?

Thanks

|||New SP2 script components and tasks can be created and edited.

Script components created prior to SP2 (at least those created on 2153 and perhaps earlier) cannot be opened, at least on Windows XP. On Windows 2003 Server (32 or 64 bit) I have not observed any issue (the editor open's fine on the same .dtsx that fails to open on an XP machine).
|||

I have the exact same issue and here is an interesting addition:

If I add a new script component (without attaching it to anything) and attempt to view the script it actually brings up the script editor with the code of the old script component that I was trying to open in the first place.

I guess I'll have to uninstall SP2 at this point.

Daryl

|||If you're on Vista, try the hotfix:
http://support.microsoft.com/default.aspx/kb/931846|||

This uneditable script component problem is specifically noticed on Windows XP and is unsolved and without reasonable workaround(e.g. total replacement of OS with Win2k3).

The Vista script component create/edit issue is indeed solved with that 931846 hotfix (the receipt of which requires a call to Microsoft PSS as it is not regression tested).

|||I can definitely confirm this exact problem after an install of SS2005 SP2a. Exactly
as described. A little confused, the problem says it is with WinXP Pro - which I have -
but patch is for Vista? Anybody install the patch on XP or found another workaround.

|||OK, there are 2 different patches for this. One for WinXP, one for Vista - they have
different patching systems. So if you call MS, make sure they know which one you want.

The patch number and KB article are the same. Welcome to Microsoft....

|||Are you saying this is resolved? I don't believe it for one second, and I'll happily admit to being wrong. What is the URL, if you would be so kind?
|||I'm having the same problem. Where can I find the XP patch?|||Yes, resolved to my satisfaction. I got the WinXP patch and it fixed the problem
and I working fine now. 2 iterations with MS to get the right one. Vista has
a totally new and different patching mechanism, but the patch underneath is the same.

KB928208

|||Yes, resolved to my satisfaction. I got the WinXP patch and it fixed the problem
and I am working fine now. 2 iterations with MS to get the right one. Vista has
a totally new and different patching mechanism, but the patch underneath is the same.

http://support.microsoft.com/default.aspx/kb/928208

You have to call MS to get this.
|||After two disconnects without being able to talk to anybody, a 90 minute wait time on the third try, and two more hours trying get this error solved, we got it to work. At least, some sort of temp solution until a KB / hotfix is available.
Keep in mind this is for a Win Server 2k3 environment and not exactly the most recommended solution.
Anyways, this was my fix.
Go to your pacakge code ( right click the package in the solution explorer and select view code ). Search for every "ReferencePath" and pretty much replace
""C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.DTSRuntimeWrap\" with "C:\WINDOWS\assembly\GAC_32\Microsoft.SqlServer.DTSRuntimeWrap\". (the rightmost reference)
Viola! That's it!

For now, I'll only do this for the packages I need to edit.

I hope this helps.

Thanks,
Alonso
|||That's what I sent to Microsoft last night ( swap GAC_MSIL to GAC_32 on the reference path) and the 2153 script component starts working. Didn't post that advice on the forum because I wanted to hear back from Microsoft as to whether that was a legitimate solution, indicative of an underlying issue (perhaps with ngen.exe's queue), or both or neither. I understand that its not the most recommended solution, but its the only solution right now.

Saturday, February 25, 2012

Possible Bug in sp_repladdcolumn? (SQL 2000, SP4)

Had something interesting happen yesterday.
Was given an alter table script to add two columns to a table we have. As
we use replication and I needed these two columns to replicate, I couldn't
simply use the alter table script but had to translate it into using
sp_repladdcolumn.
No, in the original script, it was: (and forgive typos, going on memory
here)
alter table table_foo
add column [target_object_cache_time] int not null default(0);
Now, if I create the column that way, it adds the column
target_object_cache_time.
However, when I used sp_repladdcolumn 'table_foo',
'[target_object_cache_time]', 'int not null deafult(0)';
it creates the columns with the [] around the name. i.e.
[target_object_cache_time] Moreover, it appeared to create it as
[target_object_cache_time]] on the subscribers.
Needless to say, when I tried to update the stored proc, which uses the new
column, it failed since it was looking for target_object_cache_time not
[target_object_cache_time].
Ok, not a big deal, I figure I'd issue a sp_repldropcolumn and recreate the
columns.
Here's the error message I recieved:
Category:COMMAND
Source: Failed Command
Number:
Message: if exists (select * from syscolumns where
name='[target_object_cache_time]'
and id = object_id('table_foo'))
begin if exists (select * from sysobjects where name='syspublications')
if exists (select * from sysarticles where objid=object_id('table_foo'))
and @.@.microsoftversion >= 0x07320000
exec sp_repldropcolumn
@.source_object=N'[table_foo]',@.column=N'[target_object_cache_time]'
else alter table [table_foo] drop column [[target_object_cache_t
ime]]] else
alter table [table_foo] drop column [[t
(it got cut off).
As you can see, sometimes it's treating it with an extra set of [] and
sometimes not.
It seems to me that sp_repladdcolumn should treat [] the same way as alt
er
table does. But even if it doesn't, it seems to me that you should be able
to drop the columns cleanly at least.
Thoughts? (I didn't really test too much reproduction since I was trying to
get the root problem fixed on our prod boxes at the time. :-)
If I get a chance, I may try to reproduce this again later if no one else
can.
--
Greg D. Moore
President Green Mountain Software
Personal: http://stratton.greenms.com
SQL Server Consulting sql at greenms.comGo to the Product Feedback Center and file it as a bug. It is using
brackets to ensure that there aren't any issues with spaces in the names.
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
news:eHQ78PxYGHA.5012@.TK2MSFTNGP04.phx.gbl...
> Had something interesting happen yesterday.
> Was given an alter table script to add two columns to a table we have. As
> we use replication and I needed these two columns to replicate, I couldn't
> simply use the alter table script but had to translate it into using
> sp_repladdcolumn.
> No, in the original script, it was: (and forgive typos, going on memory
> here)
> alter table table_foo
> add column [target_object_cache_time] int not null default(0);
> Now, if I create the column that way, it adds the column
> target_object_cache_time.
> However, when I used sp_repladdcolumn 'table_foo',
> '[target_object_cache_time]', 'int not null deafult(0)';
> it creates the columns with the [] around the name. i.e.
> [target_object_cache_time] Moreover, it appeared to create it as
> [target_object_cache_time]] on the subscribers.
> Needless to say, when I tried to update the stored proc, which uses the
> new
> column, it failed since it was looking for target_object_cache_time not
> [target_object_cache_time].
> Ok, not a big deal, I figure I'd issue a sp_repldropcolumn and recreate
> the
> columns.
> Here's the error message I recieved:
> Category:COMMAND
> Source: Failed Command
> Number:
> Message: if exists (select * from syscolumns where
> name='[target_object_cache_time]'
> and id = object_id('table_foo'))
> begin if exists (select * from sysobjects where name='syspublications')
> if exists (select * from sysarticles where objid=object_id('table_foo'))
> and @.@.microsoftversion >= 0x07320000
> exec sp_repldropcolumn
> @.source_object=N'[table_foo]',@.column=N'[target_object_cache_time]
'
> else alter table [table_foo] drop column [[target_object_cache
_time]]]
> else
> alter table [table_foo] drop column [[t
> (it got cut off).
> As you can see, sometimes it's treating it with an extra set of [] and
> sometimes not.
> It seems to me that sp_repladdcolumn should treat [] the same way as a
lter
> table does. But even if it doesn't, it seems to me that you should be
> able
> to drop the columns cleanly at least.
> Thoughts? (I didn't really test too much reproduction since I was trying
> to
> get the root problem fixed on our prod boxes at the time. :-)
> If I get a chance, I may try to reproduce this again later if no one else
> can.
>
>
>
> --
> --
> Greg D. Moore
> President Green Mountain Software
> Personal: http://stratton.greenms.com
> SQL Server Consulting sql at greenms.com
>|||"Michael Hotek" <mike@.solidqualitylearning.com> wrote in message
news:%23D%23lFF8YGHA.500@.TK2MSFTNGP03.phx.gbl...
> Go to the Product Feedback Center and file it as a bug.
What's the specific URL?

> It is using
> brackets to ensure that there aren't any issues with spaces in the names.
Right, but besides using them wrongly, it's inconsistent in its use of them.
:-)

> --
> Mike
> http://www.solidqualitylearning.com
> Disclaimer: This communication is an original work and represents my sole
> views on the subject. It does not represent the views of any other person
> or entity either by inference or direct reference.
>
> "Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in
message
> news:eHQ78PxYGHA.5012@.TK2MSFTNGP04.phx.gbl...
As[vbcol=seagreen]
couldn't[vbcol=seagreen]
alter[vbcol=seagreen]
trying[vbcol=seagreen]
else[vbcol=seagreen]
>|||Greg D. Moore (Strider) wrote:

>"Michael Hotek" <mike@.solidqualitylearning.com> wrote in message
>news:%23D%23lFF8YGHA.500@.TK2MSFTNGP03.phx.gbl...
>
>What's the specific URL?
>
http://lab.msdn.microsoft.com/produ...ck/default.aspx
*mike hodgson*
http://sqlnerd.blogspot.com

Possible Bug in sp_repladdcolumn? (SQL 2000, SP4)

Had something interesting happen yesterday.
Was given an alter table script to add two columns to a table we have. As
we use replication and I needed these two columns to replicate, I couldn't
simply use the alter table script but had to translate it into using
sp_repladdcolumn.
No, in the original script, it was: (and forgive typos, going on memory
here)
alter table table_foo
add column [target_object_cache_time] int not null default(0);
Now, if I create the column that way, it adds the column
target_object_cache_time.
However, when I used sp_repladdcolumn 'table_foo',
'[target_object_cache_time]', 'int not null deafult(0)';
it creates the columns with the [] around the name. i.e.
[target_object_cache_time] Moreover, it appeared to create it as
[target_object_cache_time]] on the subscribers.
Needless to say, when I tried to update the stored proc, which uses the new
column, it failed since it was looking for target_object_cache_time not
[target_object_cache_time].
Ok, not a big deal, I figure I'd issue a sp_repldropcolumn and recreate the
columns.
Here's the error message I recieved:
Category:COMMAND
Source: Failed Command
Number:
Message: if exists (select * from syscolumns where
name='[target_object_cache_time]'
and id = object_id('table_foo'))
begin if exists (select * from sysobjects where name='syspublications')
if exists (select * from sysarticles where objid=object_id('table_foo'))
and @.@.microsoftversion >= 0x07320000
exec sp_repldropcolumn
@.source_object=N'[table_foo]',@.column=N'[target_object_cache_time]'
else alter table [table_foo] drop column [[target_object_cache_time]]] else
alter table [table_foo] drop column [[t
(it got cut off).
As you can see, sometimes it's treating it with an extra set of [] and
sometimes not.
It seems to me that sp_repladdcolumn should treat [] the same way as alter
table does. But even if it doesn't, it seems to me that you should be able
to drop the columns cleanly at least.
Thoughts? (I didn't really test too much reproduction since I was trying to
get the root problem fixed on our prod boxes at the time. :-)
If I get a chance, I may try to reproduce this again later if no one else
can.
--
--
Greg D. Moore
President Green Mountain Software
Personal: http://stratton.greenms.com
SQL Server Consulting sql at greenms.comGo to the Product Feedback Center and file it as a bug. It is using
brackets to ensure that there aren't any issues with spaces in the names.
--
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
news:eHQ78PxYGHA.5012@.TK2MSFTNGP04.phx.gbl...
> Had something interesting happen yesterday.
> Was given an alter table script to add two columns to a table we have. As
> we use replication and I needed these two columns to replicate, I couldn't
> simply use the alter table script but had to translate it into using
> sp_repladdcolumn.
> No, in the original script, it was: (and forgive typos, going on memory
> here)
> alter table table_foo
> add column [target_object_cache_time] int not null default(0);
> Now, if I create the column that way, it adds the column
> target_object_cache_time.
> However, when I used sp_repladdcolumn 'table_foo',
> '[target_object_cache_time]', 'int not null deafult(0)';
> it creates the columns with the [] around the name. i.e.
> [target_object_cache_time] Moreover, it appeared to create it as
> [target_object_cache_time]] on the subscribers.
> Needless to say, when I tried to update the stored proc, which uses the
> new
> column, it failed since it was looking for target_object_cache_time not
> [target_object_cache_time].
> Ok, not a big deal, I figure I'd issue a sp_repldropcolumn and recreate
> the
> columns.
> Here's the error message I recieved:
> Category:COMMAND
> Source: Failed Command
> Number:
> Message: if exists (select * from syscolumns where
> name='[target_object_cache_time]'
> and id = object_id('table_foo'))
> begin if exists (select * from sysobjects where name='syspublications')
> if exists (select * from sysarticles where objid=object_id('table_foo'))
> and @.@.microsoftversion >= 0x07320000
> exec sp_repldropcolumn
> @.source_object=N'[table_foo]',@.column=N'[target_object_cache_time]'
> else alter table [table_foo] drop column [[target_object_cache_time]]]
> else
> alter table [table_foo] drop column [[t
> (it got cut off).
> As you can see, sometimes it's treating it with an extra set of [] and
> sometimes not.
> It seems to me that sp_repladdcolumn should treat [] the same way as alter
> table does. But even if it doesn't, it seems to me that you should be
> able
> to drop the columns cleanly at least.
> Thoughts? (I didn't really test too much reproduction since I was trying
> to
> get the root problem fixed on our prod boxes at the time. :-)
> If I get a chance, I may try to reproduce this again later if no one else
> can.
>
>
>
> --
> --
> Greg D. Moore
> President Green Mountain Software
> Personal: http://stratton.greenms.com
> SQL Server Consulting sql at greenms.com
>|||"Michael Hotek" <mike@.solidqualitylearning.com> wrote in message
news:%23D%23lFF8YGHA.500@.TK2MSFTNGP03.phx.gbl...
> Go to the Product Feedback Center and file it as a bug.
What's the specific URL?
> It is using
> brackets to ensure that there aren't any issues with spaces in the names.
Right, but besides using them wrongly, it's inconsistent in its use of them.
:-)
> --
> Mike
> http://www.solidqualitylearning.com
> Disclaimer: This communication is an original work and represents my sole
> views on the subject. It does not represent the views of any other person
> or entity either by inference or direct reference.
>
> "Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in
message
> news:eHQ78PxYGHA.5012@.TK2MSFTNGP04.phx.gbl...
> >
> > Had something interesting happen yesterday.
> >
> > Was given an alter table script to add two columns to a table we have.
As
> > we use replication and I needed these two columns to replicate, I
couldn't
> > simply use the alter table script but had to translate it into using
> > sp_repladdcolumn.
> >
> > No, in the original script, it was: (and forgive typos, going on memory
> > here)
> >
> > alter table table_foo
> > add column [target_object_cache_time] int not null default(0);
> >
> > Now, if I create the column that way, it adds the column
> > target_object_cache_time.
> >
> > However, when I used sp_repladdcolumn 'table_foo',
> > '[target_object_cache_time]', 'int not null deafult(0)';
> >
> > it creates the columns with the [] around the name. i.e.
> > [target_object_cache_time] Moreover, it appeared to create it as
> > [target_object_cache_time]] on the subscribers.
> >
> > Needless to say, when I tried to update the stored proc, which uses the
> > new
> > column, it failed since it was looking for target_object_cache_time not
> > [target_object_cache_time].
> >
> > Ok, not a big deal, I figure I'd issue a sp_repldropcolumn and recreate
> > the
> > columns.
> >
> > Here's the error message I recieved:
> >
> > Category:COMMAND
> > Source: Failed Command
> > Number:
> > Message: if exists (select * from syscolumns where
> > name='[target_object_cache_time]'
> > and id = object_id('table_foo'))
> > begin if exists (select * from sysobjects where name='syspublications')
> > if exists (select * from sysarticles where objid=object_id('table_foo'))
> > and @.@.microsoftversion >= 0x07320000
> >
> > exec sp_repldropcolumn
> > @.source_object=N'[table_foo]',@.column=N'[target_object_cache_time]'
> > else alter table [table_foo] drop column [[target_object_cache_time]]]
> > else
> > alter table [table_foo] drop column [[t
> >
> > (it got cut off).
> >
> > As you can see, sometimes it's treating it with an extra set of [] and
> > sometimes not.
> >
> > It seems to me that sp_repladdcolumn should treat [] the same way as
alter
> > table does. But even if it doesn't, it seems to me that you should be
> > able
> > to drop the columns cleanly at least.
> >
> > Thoughts? (I didn't really test too much reproduction since I was
trying
> > to
> > get the root problem fixed on our prod boxes at the time. :-)
> >
> > If I get a chance, I may try to reproduce this again later if no one
else
> > can.
> >
> >
> >
> >
> >
> >
> > --
> > --
> > Greg D. Moore
> > President Green Mountain Software
> > Personal: http://stratton.greenms.com
> > SQL Server Consulting sql at greenms.com
> >
> >
>|||This is a multi-part message in MIME format.
--040005020201060803030401
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Greg D. Moore (Strider) wrote:
>"Michael Hotek" <mike@.solidqualitylearning.com> wrote in message
>news:%23D%23lFF8YGHA.500@.TK2MSFTNGP03.phx.gbl...
>
>>Go to the Product Feedback Center and file it as a bug.
>>
>What's the specific URL?
>
http://lab.msdn.microsoft.com/productfeedback/default.aspx
--
*mike hodgson*
http://sqlnerd.blogspot.com
--040005020201060803030401
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
Greg D. Moore (Strider) wrote:
<blockquote cite="mideCI2gnPZGHA.4752@.TK2MSFTNGP02.phx.gbl" type="cite">
<pre wrap="">"Michael Hotek" <a class="moz-txt-link-rfc2396E" href="http://links.10026.com/?link=mailto:mike@.solidqualitylearning.com"><mike@.solidqualitylearning.com></a> wrote in message
<a class="moz-txt-link-freetext" href="http://links.10026.com/?link=news:%23D%23lFF8YGHA.500@.TK2MSFTNGP03.phx.gbl">news:%23D%23lFF8YGHA.500@.TK2MSFTNGP03.phx.gbl</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Go to the Product Feedback Center and file it as a bug.
</pre>
</blockquote>
<pre wrap=""><!-->
What's the specific URL?
</pre>
</blockquote>
<tt><a class="moz-txt-link-freetext" href="http://links.10026.com/?link=http://lab.msdn.microsoft.com/productfeedback/default.aspx</a></tt><br>">http://lab.msdn.microsoft.com/productfeedback/default.aspx">http://lab.msdn.microsoft.com/productfeedback/default.aspx</a></tt><br>
<br>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font></span> <b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"><br>
<font face="Tahoma" size="2"><a href="http://links.10026.com/?link=http://sqlnerd.blogspot.com</a></font></span>">http://sqlnerd.blogspot.com">http://sqlnerd.blogspot.com</a></font></span>
</p>
</div>
<br>
</body>
</html>
--040005020201060803030401--