Sunday, March 11, 2012
"String constants must end with a double quote" error
I've created a bunch of reports locally on my machine, where they all run
just fine, but when I try to deploy them to a server I run into some
problems.
I only have access to the server through a third party remote desktop
application (NetOp), so I have to do the deployment by manually uploading
the .rdl file in Report Manager. The reports uses MDX queries which I've had
to change into concatenated strings to allow for parameters, but when I try
to upload the files I only get the "BC30648 String constants must end with a
double quote." error.
If I remove the parameters, and the quotes around the whole query the files
upload just fine. Additionally, I've tried uploading the files manually both
on my own machine and a colleague's without getting this error. The reports
also run fine on these two machines after the upload (and configuration of
datasources).
Below is a sample of the query in a report that will throw the error on the
remote machine (for clarity this one doesn't use parameters):
<Query>
<DataSourceName>SullandGruppen</DataSourceName>
<CommandText>="SELECT
{[Measures].[Faktisk denne mnd]} ON COLUMNS,
{[Dato].[All Dato].[2004].[January]} ON ROWS
FROM Finanskube
WHERE
([Avdeling].[Salg],
[Avdelingsstruktur].[All Avdelingsstruktur].[3 Inntekter],
[Firma].[Gjovik Auto])"</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
Does anyone have any idea why this might be happening? This is a fresh
install of Reporting Services, so I haven't tried deploying reports to it
before. It have only got the Server Components and .NET runtime installed.
Many thanks for any input!
-Christian NordbakkWell, my bad this one :o/
I had developed the reports on SP1 but forgotten to upgrade the server. That
caused the report to crash because of the query being split onto multiple
lines, which pre-SP1 doesn't support.
-Christian Nordbakk
"Christian Nordbakk" <cnordbakk@.gmail.com> wrote in message
news:%23hcuOyAwEHA.2172@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I've created a bunch of reports locally on my machine, where they all run
> just fine, but when I try to deploy them to a server I run into some
> problems.
> I only have access to the server through a third party remote desktop
> application (NetOp), so I have to do the deployment by manually uploading
> the .rdl file in Report Manager. The reports uses MDX queries which I've
> had to change into concatenated strings to allow for parameters, but when
> I try to upload the files I only get the "BC30648 String constants must
> end with a double quote." error.
> If I remove the parameters, and the quotes around the whole query the
> files upload just fine. Additionally, I've tried uploading the files
> manually both on my own machine and a colleague's without getting this
> error. The reports also run fine on these two machines after the upload
> (and configuration of datasources).
> Below is a sample of the query in a report that will throw the error on
> the remote machine (for clarity this one doesn't use parameters):
> <Query>
> <DataSourceName>SullandGruppen</DataSourceName>
> <CommandText>="SELECT
> {[Measures].[Faktisk denne mnd]} ON COLUMNS,
> {[Dato].[All Dato].[2004].[January]} ON ROWS
> FROM Finanskube
> WHERE
> ([Avdeling].[Salg],
> [Avdelingsstruktur].[All Avdelingsstruktur].[3 Inntekter],
> [Firma].[Gjovik Auto])"</CommandText>
> <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
> </Query>
>
> Does anyone have any idea why this might be happening? This is a fresh
> install of Reporting Services, so I haven't tried deploying reports to it
> before. It have only got the Server Components and .NET runtime installed.
> Many thanks for any input!
> -Christian Nordbakk
>
"Simple" recovery model?
tables and set the Recovery Model to Simple. The reason being, these tables
are essentially "temp" tables who's data will be constantly deleted and
re-inserted. Since it is all calculated data, I have no need for recovery of
any kind. My problem is this: Even with the Recovery Model set to Simple,
the Transaction Log grows exponentially. This is a real problem for me since
these tables may be emptied and re-populated 1,500 times in one evening.
What recovery model should I use in this situation in order to keep the Log
file size under control? Or should I just run SHRINKDATABASE or some other
utility after each cleaning?
Hi
Keep your transactions short and sweet. If it is all one transaction, and
you update 10 million rows, you will need a lot of space.
Shrink DB will not help unless the transaction is committed or rolled back.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Ron Hinds" <__ron__dontspamme@.wedontlikespam_garageiq.com> wrote in message
news:O5ijLRPAGHA.3136@.TK2MSFTNGP15.phx.gbl...
> SQL 2000 SP3a on W2K SP4 server. I've created a new database with only
> three
> tables and set the Recovery Model to Simple. The reason being, these
> tables
> are essentially "temp" tables who's data will be constantly deleted and
> re-inserted. Since it is all calculated data, I have no need for recovery
> of
> any kind. My problem is this: Even with the Recovery Model set to Simple,
> the Transaction Log grows exponentially. This is a real problem for me
> since
> these tables may be emptied and re-populated 1,500 times in one evening.
> What recovery model should I use in this situation in order to keep the
> Log
> file size under control? Or should I just run SHRINKDATABASE or some other
> utility after each cleaning?
>
"Simple" recovery model?
tables and set the Recovery Model to Simple. The reason being, these tables
are essentially "temp" tables who's data will be constantly deleted and
re-inserted. Since it is all calculated data, I have no need for recovery of
any kind. My problem is this: Even with the Recovery Model set to Simple,
the Transaction Log grows exponentially. This is a real problem for me since
these tables may be emptied and re-populated 1,500 times in one evening.
What recovery model should I use in this situation in order to keep the Log
file size under control? Or should I just run SHRINKDATABASE or some other
utility after each cleaning?Hi
Keep your transactions short and sweet. If it is all one transaction, and
you update 10 million rows, you will need a lot of space.
Shrink DB will not help unless the transaction is committed or rolled back.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Ron Hinds" < __ron__dontspamme@.wedontlikespam_garagei
q.com> wrote in message
news:O5ijLRPAGHA.3136@.TK2MSFTNGP15.phx.gbl...
> SQL 2000 SP3a on W2K SP4 server. I've created a new database with only
> three
> tables and set the Recovery Model to Simple. The reason being, these
> tables
> are essentially "temp" tables who's data will be constantly deleted and
> re-inserted. Since it is all calculated data, I have no need for recovery
> of
> any kind. My problem is this: Even with the Recovery Model set to Simple,
> the Transaction Log grows exponentially. This is a real problem for me
> since
> these tables may be emptied and re-populated 1,500 times in one evening.
> What recovery model should I use in this situation in order to keep the
> Log
> file size under control? Or should I just run SHRINKDATABASE or some other
> utility after each cleaning?
>
"Simple" recovery model?
tables and set the Recovery Model to Simple. The reason being, these tables
are essentially "temp" tables who's data will be constantly deleted and
re-inserted. Since it is all calculated data, I have no need for recovery of
any kind. My problem is this: Even with the Recovery Model set to Simple,
the Transaction Log grows exponentially. This is a real problem for me since
these tables may be emptied and re-populated 1,500 times in one evening.
What recovery model should I use in this situation in order to keep the Log
file size under control? Or should I just run SHRINKDATABASE or some other
utility after each cleaning?Hi
Keep your transactions short and sweet. If it is all one transaction, and
you update 10 million rows, you will need a lot of space.
Shrink DB will not help unless the transaction is committed or rolled back.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Ron Hinds" <__ron__dontspamme@.wedontlikespam_garageiq.com> wrote in message
news:O5ijLRPAGHA.3136@.TK2MSFTNGP15.phx.gbl...
> SQL 2000 SP3a on W2K SP4 server. I've created a new database with only
> three
> tables and set the Recovery Model to Simple. The reason being, these
> tables
> are essentially "temp" tables who's data will be constantly deleted and
> re-inserted. Since it is all calculated data, I have no need for recovery
> of
> any kind. My problem is this: Even with the Recovery Model set to Simple,
> the Transaction Log grows exponentially. This is a real problem for me
> since
> these tables may be emptied and re-populated 1,500 times in one evening.
> What recovery model should I use in this situation in order to keep the
> Log
> file size under control? Or should I just run SHRINKDATABASE or some other
> utility after each cleaning?
>
Thursday, March 8, 2012
"replace value of" and enum
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Order" nillable="true" type="Order" />
<xs:complexType name="Order">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Status"
type="OrderStatus" />
</xs:sequence>
</xs:complexType>
<xs:simpleType name="OrderStatus">
<xs:restriction base="xs:string">
<xs:enumeration value="New" />
<xs:enumeration value="Pending" />
<xs:enumeration value="Complete" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
Now I'd like to update OrderStatus:
UPDATE Orders
SET OrderXml.modify('replace value of (/Order[1]/Status[1]) with "Expired"')
I get:
Msg 2247, Level 16, State 1, Procedure Orders_Select
XQuery [dbo.Orders.OrderXml.modify()]: The value is of type "xs:string",
which is not a subtype of the expected type "OrderStatus".
The below does not work either:
UPDATE Orders
SET OrderXml.modify('replace value of (/Order[1]/Status[1]) with
OrderStatus("Expired")')
How do I make this work?
ThanksNever mind, ("Expired" cast as OrderStatus) does the trick.
"Chris Carter" <anonymous@.discussions.microsoft.com> wrote in message
news:%23AHmjrHKGHA.2392@.TK2MSFTNGP09.phx.gbl...
> I've created XML SCHEMA COLLECTION AS
> <?xml version="1.0" encoding="utf-8"?>
> <xs:schema elementFormDefault="qualified"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="Order" nillable="true" type="Order" />
> <xs:complexType name="Order">
> <xs:sequence>
> <xs:element minOccurs="1" maxOccurs="1" name="Status"
> type="OrderStatus" />
> </xs:sequence>
> </xs:complexType>
> <xs:simpleType name="OrderStatus">
> <xs:restriction base="xs:string">
> <xs:enumeration value="New" />
> <xs:enumeration value="Pending" />
> <xs:enumeration value="Complete" />
> </xs:restriction>
> </xs:simpleType>
> </xs:schema>
>
> Now I'd like to update OrderStatus:
> UPDATE Orders
> SET OrderXml.modify('replace value of (/Order[1]/Status[1]) with
> "Expired"')
> I get:
> Msg 2247, Level 16, State 1, Procedure Orders_Select
> XQuery [dbo.Orders.OrderXml.modify()]: The value is of type "xs:string",
> which is not a subtype of the expected type "OrderStatus".
> The below does not work either:
> UPDATE Orders
> SET OrderXml.modify('replace value of (/Order[1]/Status[1]) with
> OrderStatus("Expired")')
>
> How do I make this work?
>
> Thanks
>
>
>
"replace value of" and enum
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Order" nillable="true" type="Order" />
<xs:complexType name="Order">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Status"
type="OrderStatus" />
</xs:sequence>
</xs:complexType>
<xs:simpleType name="OrderStatus">
<xs:restriction base="xs:string">
<xs:enumeration value="New" />
<xs:enumeration value="Pending" />
<xs:enumeration value="Complete" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
Now I'd like to update OrderStatus:
UPDATE Orders
SET OrderXml.modify('replace value of (/Order[1]/Status[1]) with "Expired"')
I get:
Msg 2247, Level 16, State 1, Procedure Orders_Select
XQuery [dbo.Orders.OrderXml.modify()]: The value is of type "xs:string",
which is not a subtype of the expected type "OrderStatus".
The below does not work either:
UPDATE Orders
SET OrderXml.modify('replace value of (/Order[1]/Status[1]) with
OrderStatus("Expired")')
How do I make this work?
Thanks
Never mind, ("Expired" cast as OrderStatus) does the trick.
"Chris Carter" <anonymous@.discussions.microsoft.com> wrote in message
news:%23AHmjrHKGHA.2392@.TK2MSFTNGP09.phx.gbl...
> I've created XML SCHEMA COLLECTION AS
> <?xml version="1.0" encoding="utf-8"?>
> <xs:schema elementFormDefault="qualified"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="Order" nillable="true" type="Order" />
> <xs:complexType name="Order">
> <xs:sequence>
> <xs:element minOccurs="1" maxOccurs="1" name="Status"
> type="OrderStatus" />
> </xs:sequence>
> </xs:complexType>
> <xs:simpleType name="OrderStatus">
> <xs:restriction base="xs:string">
> <xs:enumeration value="New" />
> <xs:enumeration value="Pending" />
> <xs:enumeration value="Complete" />
> </xs:restriction>
> </xs:simpleType>
> </xs:schema>
>
> Now I'd like to update OrderStatus:
> UPDATE Orders
> SET OrderXml.modify('replace value of (/Order[1]/Status[1]) with
> "Expired"')
> I get:
> Msg 2247, Level 16, State 1, Procedure Orders_Select
> XQuery [dbo.Orders.OrderXml.modify()]: The value is of type "xs:string",
> which is not a subtype of the expected type "OrderStatus".
> The below does not work either:
> UPDATE Orders
> SET OrderXml.modify('replace value of (/Order[1]/Status[1]) with
> OrderStatus("Expired")')
>
> How do I make this work?
>
> Thanks
>
>
>
Saturday, February 25, 2012
"Login failed for user MyPC/ASPNET"
Hi
I created my DB in SQL 2005 Express in VS IDE. I have my app in IIS. When I try to use the DB (e.g. try to login a user in the app) it gives me the following error:
Cannot open database "cvRepository" requested by the login. The login failed.
Login failed for user 'MyPC\ASPNET'.
My guess was that I had to give permissions to ASPNET user so I did in SQL Server Management. Still not working! Checked my Connection string and I think it's fine...
connectionString="Data Source=.\SQLEXPRESS;Database=cvRepository;Integrated Security=True;User Instance=True"Still not working!
Can anyone explain me what's wrong and to solve this?!
Try replacing Database=cvRepository withAttachDBFileName=|DataDirectory|cvRepository.mdfin your connectionString.
Hope this helps.
Mike
|||Do you have a database namedcvRepositoryon your SQL server? Or you're using a database file attached at runtime? Anyways you have to ensure the ASPNET account has login permission to the SQL server, as well as access permissions on the required database.|||Hi
Tried using the AttachDBFileName but nothing:
<
addname="cvRepositoryConnectionString"connectionString="Data Source=.\SQLEXPRESS;AttachDBFileName=|DataDirectory|cvrepository.mdf;Integrated Security=True;User Instance=True"providerName="System.Data.SqlClient" />I don't understand much of this but I'll shoot out something... When running the app in debug mode (http://localhost:2431/cvRepository/Default.aspx) it creates an instance of the SQL Server but when not doing so (http://localhost/cvRepository/Default.aspx) it doesn't, that's why I can't access the DB. Is this correct? If so, how to solve it?Any explanation/article would be helpful!
Thx
|||Try to add the ASPNET login to a member ofsysadminordbcreatorserver role.|||Hi
Instead of using User Instances I defined a particular user to access the DB. Used this:
connectionString
="Server=.\SQLEXPRESS;Database=cvrepository;User ID=user1;Password=user1pass"Thx for your help
Cheers
Friday, February 24, 2012
"Invalid Object.." error when using Copy SQL Server Objects task
make a copy. I created a DTS with the Copy SQL Server Obj Task to copy
all objects from MyDbName to MyDbName_Test (on the same instance of SQL
Server). I've used this method on other databases many times and it
completes just fine. On this db, however, I get "Invalid object name
'dbo.vwWhereUsed'" when trying to complete the task. vwWhereUsed is, of
course, one of my views. This view functions properly when ran. I
later found that the error seemed to be happening when the DTS attempts
to copy another view that calls vwWhereUsed. This other view does not
get copied to MyDbName_Test before the DTS fails, but vwWhereUsed is
copied.
My thought was that the other view is being copied to the new db before
vwWhereUsed and blowing up because vwWhereUsed is not there yet... but
from what I just explained, that doesn't seem to be the case.
On another DTS attempt to move a few tables,that have nothing to do
with vwWhereUsed, into a new clean database (MyDBName_Test) I got the
same error message (Invalid object name 'dbo.vwWhereUsed').
Interestingly enough, if I UNcheck the "Drop Destination Objects First"
option before moving those tables, the error does not occur. This does
not make sense, because it was a NEW db.. there was nothing to DROP.
Is there something I'm not seeing here? or..
Is there techniques to help me discover exactly whats happening.. or
any tips on making copies of databases using the Copy SQL Server Object
Task that may help correct this issue?
TIALindsey,
Seems like a lot of unnecessary work. Why not use a BACKUP/RESTORE
approach? Or if the DB can be offline (say afterhours)
sp_detach_db/sp_attach_db?
HTH
Jerry
"lindseyhansen" <lindsey.hansen@.fmc-na.com> wrote in message
news:1128614409.695658.177570@.o13g2000cwo.googlegroups.com...
> SQL Server 2000. I have a production database, of which, I want to
> make a copy. I created a DTS with the Copy SQL Server Obj Task to copy
> all objects from MyDbName to MyDbName_Test (on the same instance of SQL
> Server). I've used this method on other databases many times and it
> completes just fine. On this db, however, I get "Invalid object name
> 'dbo.vwWhereUsed'" when trying to complete the task. vwWhereUsed is, of
> course, one of my views. This view functions properly when ran. I
> later found that the error seemed to be happening when the DTS attempts
> to copy another view that calls vwWhereUsed. This other view does not
> get copied to MyDbName_Test before the DTS fails, but vwWhereUsed is
> copied.
> My thought was that the other view is being copied to the new db before
> vwWhereUsed and blowing up because vwWhereUsed is not there yet... but
> from what I just explained, that doesn't seem to be the case.
> On another DTS attempt to move a few tables,that have nothing to do
> with vwWhereUsed, into a new clean database (MyDBName_Test) I got the
> same error message (Invalid object name 'dbo.vwWhereUsed').
> Interestingly enough, if I UNcheck the "Drop Destination Objects First"
> option before moving those tables, the error does not occur. This does
> not make sense, because it was a NEW db.. there was nothing to DROP.
>
> Is there something I'm not seeing here? or..
> Is there techniques to help me discover exactly whats happening.. or
> any tips on making copies of databases using the Copy SQL Server Object
> Task that may help correct this issue?
> TIA
>|||Thanks Jerry.. I haven't tried that before.. I'll give it a shot. It
still makes me nervous, however, that I can't get the dts to complete
successfully. I've run the dbcc check on the database and everything
is fine. I'm not sure what else to look at.
Thanks, though.
"Invalid Object.." error when using Copy SQL Server Objects task
make a copy. I created a DTS with the Copy SQL Server Obj Task to copy
all objects from MyDbName to MyDbName_Test (on the same instance of SQL
Server). I've used this method on other databases many times and it
completes just fine. On this db, however, I get "Invalid object name
'dbo.vwWhereUsed'" when trying to complete the task. vwWhereUsed is, of
course, one of my views. This view functions properly when ran. I
later found that the error seemed to be happening when the DTS attempts
to copy another view that calls vwWhereUsed. This other view does not
get copied to MyDbName_Test before the DTS fails, but vwWhereUsed is
copied.
My thought was that the other view is being copied to the new db before
vwWhereUsed and blowing up because vwWhereUsed is not there yet... but
from what I just explained, that doesn't seem to be the case.
On another DTS attempt to move a few tables,that have nothing to do
with vwWhereUsed, into a new clean database (MyDBName_Test) I got the
same error message (Invalid object name 'dbo.vwWhereUsed').
Interestingly enough, if I UNcheck the "Drop Destination Objects First"
option before moving those tables, the error does not occur. This does
not make sense, because it was a NEW db.. there was nothing to DROP.
Is there something I'm not seeing here? or..
Is there techniques to help me discover exactly whats happening.. or
any tips on making copies of databases using the Copy SQL Server Object
Task that may help correct this issue?
TIA
Lindsey,
Seems like a lot of unnecessary work. Why not use a BACKUP/RESTORE
approach? Or if the DB can be offline (say afterhours)
sp_detach_db/sp_attach_db?
HTH
Jerry
"lindseyhansen" <lindsey.hansen@.fmc-na.com> wrote in message
news:1128614409.695658.177570@.o13g2000cwo.googlegr oups.com...
> SQL Server 2000. I have a production database, of which, I want to
> make a copy. I created a DTS with the Copy SQL Server Obj Task to copy
> all objects from MyDbName to MyDbName_Test (on the same instance of SQL
> Server). I've used this method on other databases many times and it
> completes just fine. On this db, however, I get "Invalid object name
> 'dbo.vwWhereUsed'" when trying to complete the task. vwWhereUsed is, of
> course, one of my views. This view functions properly when ran. I
> later found that the error seemed to be happening when the DTS attempts
> to copy another view that calls vwWhereUsed. This other view does not
> get copied to MyDbName_Test before the DTS fails, but vwWhereUsed is
> copied.
> My thought was that the other view is being copied to the new db before
> vwWhereUsed and blowing up because vwWhereUsed is not there yet... but
> from what I just explained, that doesn't seem to be the case.
> On another DTS attempt to move a few tables,that have nothing to do
> with vwWhereUsed, into a new clean database (MyDBName_Test) I got the
> same error message (Invalid object name 'dbo.vwWhereUsed').
> Interestingly enough, if I UNcheck the "Drop Destination Objects First"
> option before moving those tables, the error does not occur. This does
> not make sense, because it was a NEW db.. there was nothing to DROP.
>
> Is there something I'm not seeing here? or..
> Is there techniques to help me discover exactly whats happening.. or
> any tips on making copies of databases using the Copy SQL Server Object
> Task that may help correct this issue?
> TIA
>
|||Thanks Jerry.. I haven't tried that before.. I'll give it a shot. It
still makes me nervous, however, that I can't get the dts to complete
successfully. I've run the dbcc check on the database and everything
is fine. I'm not sure what else to look at.
Thanks, though.
"Invalid Object.." error when using Copy SQL Server Objects task
make a copy. I created a DTS with the Copy SQL Server Obj Task to copy
all objects from MyDbName to MyDbName_Test (on the same instance of SQL
Server). I've used this method on other databases many times and it
completes just fine. On this db, however, I get "Invalid object name
'dbo.vwWhereUsed'" when trying to complete the task. vwWhereUsed is, of
course, one of my views. This view functions properly when ran. I
later found that the error seemed to be happening when the DTS attempts
to copy another view that calls vwWhereUsed. This other view does not
get copied to MyDbName_Test before the DTS fails, but vwWhereUsed is
copied.
My thought was that the other view is being copied to the new db before
vwWhereUsed and blowing up because vwWhereUsed is not there yet... but
from what I just explained, that doesn't seem to be the case.
On another DTS attempt to move a few tables,that have nothing to do
with vwWhereUsed, into a new clean database (MyDBName_Test) I got the
same error message (Invalid object name 'dbo.vwWhereUsed').
Interestingly enough, if I UNcheck the "Drop Destination Objects First"
option before moving those tables, the error does not occur. This does
not make sense, because it was a NEW db.. there was nothing to DROP.
Is there something I'm not seeing here? or..
Is there techniques to help me discover exactly whats happening.. or
any tips on making copies of databases using the Copy SQL Server Object
Task that may help correct this issue?
TIALindsey,
Seems like a lot of unnecessary work. Why not use a BACKUP/RESTORE
approach? Or if the DB can be offline (say afterhours)
sp_detach_db/sp_attach_db?
HTH
Jerry
"lindseyhansen" <lindsey.hansen@.fmc-na.com> wrote in message
news:1128614409.695658.177570@.o13g2000cwo.googlegroups.com...
> SQL Server 2000. I have a production database, of which, I want to
> make a copy. I created a DTS with the Copy SQL Server Obj Task to copy
> all objects from MyDbName to MyDbName_Test (on the same instance of SQL
> Server). I've used this method on other databases many times and it
> completes just fine. On this db, however, I get "Invalid object name
> 'dbo.vwWhereUsed'" when trying to complete the task. vwWhereUsed is, of
> course, one of my views. This view functions properly when ran. I
> later found that the error seemed to be happening when the DTS attempts
> to copy another view that calls vwWhereUsed. This other view does not
> get copied to MyDbName_Test before the DTS fails, but vwWhereUsed is
> copied.
> My thought was that the other view is being copied to the new db before
> vwWhereUsed and blowing up because vwWhereUsed is not there yet... but
> from what I just explained, that doesn't seem to be the case.
> On another DTS attempt to move a few tables,that have nothing to do
> with vwWhereUsed, into a new clean database (MyDBName_Test) I got the
> same error message (Invalid object name 'dbo.vwWhereUsed').
> Interestingly enough, if I UNcheck the "Drop Destination Objects First"
> option before moving those tables, the error does not occur. This does
> not make sense, because it was a NEW db.. there was nothing to DROP.
>
> Is there something I'm not seeing here? or..
> Is there techniques to help me discover exactly whats happening.. or
> any tips on making copies of databases using the Copy SQL Server Object
> Task that may help correct this issue?
> TIA
>|||Thanks Jerry.. I haven't tried that before.. I'll give it a shot. It
still makes me nervous, however, that I can't get the dts to complete
successfully. I've run the dbcc check on the database and everything
is fine. I'm not sure what else to look at.
Thanks, though.
Thursday, February 16, 2012
"File not created" from sp_trace_create
I have checked to ensure that the path is valid. I am using Windows Authentication and the Windows Administrator account.
SQL Server is using the Windows userid that I created for SQL Server. I have verified (at least tried to verify) that the user for SQL Server has access to the folder containing it.
The following is the relevant portion of what I am attempting.
DECLARE @.RC int, @.TraceId int
Exec @.RC = sp_trace_create @.TraceId OUTPUT, 0, N'C:\TraceFile'
I have tried other paths that also do not work.I used a path that was for a FAT partition and that worked, so it was a file permission problem. I don't know how to determine what path would be valid for the SQL Server account but that is a different question.
Thursday, February 9, 2012
"Changed Context to ..." message when editing permissions w/ VBA
I've created a form in the front end that allows a supervisor the ability to perform two very basic security operations. 1) Adding a new user, and 2) granting/removing write privileges. The code behind the form uses VBA to build some T-SQL strings and then executes them via an ADO connection.
The strings are as follows:
1) Add new login to server:
"CREATE LOGIN [NETWORK\UserName] FROM WINDOWS WITH DEFAULT_DATABASE = MyDatabase"
2) Add user to database:
"USE MyDatabase CREATE USER [NETWORK\UserName]"
3) Grant Write Permissions:
" USE MyDatabase EXEC sp_addrolemember 'db_datawriter', 'NETWORK\UserName' "
4) Remove Write Permissions:
" USE MyDatabase EXEC sp_droprolemember 'db_datawriter', 'NETWORK\UserName' "
I have full privileges over the server & database, and everything runs perfectly.
However, when the supervisor - whose login includes security admin privileges - tries this, he gets a message that says "Changed Context to MyDatabase, Error# -2147217900, 80040e14" and the code fails.
If I grant him "db_owner" status, the message does not come up and everything runs perfectly.
I'm not a security guru or anything, but I suspect that it's not the greatest idea to hand out db_owner privileges.
I ran a search, and the best I could come up with were a couple of KB articles:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;197459
http://support.microsoft.com/default.aspx?scid=KB;EN-US;143339
I'm not even sure these articles are talking about what's happening..
Any ideas?When is the last time your boss ran an office update? Or more specifically, which MDAC is he using?|||When is the last time your boss ran an office update? Or more specifically, which MDAC is he using?
I'm not at the client's location right now, so I can't give a firm answer.. but I had someone there gather the following info..
Access is version 11.6566.8132 SP2
They're running XP Pro version 2002 SP2.
Per this page: http://support.microsoft.com/kb/231943/en-us they should be on at least MDAC 2.8 SP1. However based on the release dates shown on that page, I wouldn't be suprised if they were running 2.8 SP2.
Does that help?|||Ok, went by their office yesterday. MDAC is version 2.8.1117.0.
After a little more time spent, it appears as if this is the 'informational' message passed back to ODBC. It appears that I need to figure out how to trap for it in VB. The KB articles I posted got me started, but I need some more work..
I also seem to still have a SQL issue.. In the little bit of troubleshooting I had time for, it also appears that I have a 2nd error coming in behind the "changed context.." message. If the user is not a dbowner, it says that he doesn't have permissions to run these operations.
Is this correct? Is dbowner status required to change permissions of other users?
"Cannot find keycodev2.dll or invalid keycode" for certain user account
I've created program that sits on a server and provides some reporting functionality. The user submits a SQL Server job that calls this program, passing in some command args.
The SQL Server job is submitted by a C# program that is using a non-sysadmin connection account, therefore it is calling SETUSER to change the job mapping to a local user account, called MYSERVER\SQLServerJobs - I've granted it local admin rights.
Whenever SQL Server attempts to run this job, it's failing with the "Cannot find keycodev2.dll or invalid keycode" error. It's definitely not an install problem, I can run the program from command line using a domain account and it's fine. I guess its a permissions problem with the local account, but I can't put my finger on it!
Again, the local account is in the Administrators group & I've even explicitly granted it rights to the two registry keys
HKEY_CLASSES_ROOT\Interface\{4A4D268A-DF9B-4FC1-8301-D9FEEEF69F9C}
- HKEY_CLASSES_ROOT\TypeLib\{8D43D0B9-C14E-4577-9E67-A9A1EEF82302}
as detailed in some Crystal troubleshooting documents.
Anything else I should check for??
ThanksSOLVED:
I went back onto the machine, logging on as the local user account SQLServerJobs. I then reinstalled the 'CrystallInstaller' setup I had created (just all the merge modules that are required) & made sure the 'For everyone' box was checked - Now works fine.
I reckon i flew through the install the first time round and didn't check the 'For Everyone' box - can't remember to be honest, but would make sense!!
"C:\INETPUB\WWWROOT\SLEPCHA\APP_DATA\ASPNETDB.MDF" because the database is read-only.
i have created a appl and deployed it in IIS .
When i login from the login page i get a error :Server Error in '/slepcha' Application.
------------------------
Failed to update database "C:\INETPUB\WWWROOT\SLEPCHA\APP_DATA\ASPNETDB.MDF" because the database is read-only.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Failed to update database "C:\INETPUB\WWWROOT\SLEPCHA\APP_DATA\ASPNETDB.MDF" because the database is read-only.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
Have you checked to see whether that file has the ReadOnly attribute set?