Showing posts with label existing. Show all posts
Showing posts with label existing. Show all posts

Friday, March 9, 2012

Problems with express

I recently downloaded 2005 express. I am able to create a new database fine. But how do I take an existing database (created elsewhere) and make changes to it? For example, I want to make a copy of my mdf on my website and manipulate the data and design on express, then copy it back to the ftp server. What is the easiest way?

If this is a limitation of 'Express', can I do this with 2005 'developers' editon that costs $49??

Help please.You can backup a database from SQL 2000, then restore the database onto SQL 2005, but I don't know of any way to go back reliably. The SQL 2005 database engine supports (in many cases demands) structure changes that SQL 2000 can't support.

-PatP|||Easiest way is to make changes to a database where it sits, without moving it all about. What sort of changes are you talking about? Is this in order to create a development environment of some sort?

Problems with error logging

I've added a new application to an existing instance of NS allready running another application.
The new application has a single event in it, but when I added the application yesterday it didn't submit anything to the EventBatches table. The event query interval was set to 30 seconds. There was no error logs written at all.
This morning, there was still nothing in the EventBatches table, but there was 6 simoultaneous errors thrown with a time difference of 1-4 hours between them.
(The error message was insufficent rights on the queried table in the event query - no problem, I fixed the rights)
But still, theres nothing in the EventBatches table. Now how long do I have to wait before NS throws an error log I can use for debugging? I would expect NS to throw errors everytime the events query fails - that would be every 30 seconds. But insted it seems to throw error messages rarely at random times.
Now I'm quite sure the problem isn't my interval settings, as I use the exact same settings as the existing application. And this application throws errors every 30 seconds if problems with the event query.
Can anyone figure out why the error logging behaves this way?
/Henrik

Hello,
It isn't clear from your post, but I assume you're using the built-in SQLProvider event provider. Is that correct?

Can you post the event class definition and the event provider configuration elements from your ADF?

Thanks
-shyam|||Yes it's a built-in provider.
I'm not able to post the sections from my definition file right now, as I'm not connected to the Internet in my development environment and more important - strict company rules forbids my to do so.
So I understand helping me out gets a bit difficult... :-(
/Henrik
|||Hmm... clearing all the application logs in the logviewer, fixed the problem.
Now error logs are thrown as I would expect them to be, and I can bedug from there.
I'm embarressed I didn't think of this before - sorry for waisting your time.
/Henrik

Problems With DTS Migration of Database

I am trying to migrate a database from one server to another. The existing database is running under MS SQL Server 7.0, and the new one is running under MS SQL Server 2000.

I'm using SQL Server 7.0's Enterprise manager to transfer the database using DTS.

Both databases are on large SQL servers, shared by many users at the ISP, meaning that my SQL login is not the dbo, and has full permissions to the specific database, but not the the SQL server itself ( ie. I can't add logins, databases, etc. )

When I try to copy the tables from the existing database, to the new one running 2000 I get the following error:

::Error::
In file in statement on line 0
Transfer Status: Beginning Transfer of Data
[Microsoft][ODBC SQL Server Driver][SQL Server]Only members of the sysadmin role or the database owner may set database options.


I've told DTS to "transfer objects and data between sql server 7.0 databases". Further, under "options" I deselected "Transfer database users and database roles", "Transfer SQL Server Logins", and "Transfer object-level permissions"

I get the same error to matter what tables/views/stored procedures I try to transfer, and no matter which options I seem to have selected..

What is causing this error? Is it simply that I'm using SQL 7.0 DTS ( w/ SP4 ) to do the transfering from a SQL 7.0 to a SQL 2000 database?

Thanks!

BriceBriceB,

You can`t transfer objects, because your are not a member of sysadmins.

The DTS try to keep some properties, that only this members can create!

------------------------

You may try this too:

Generate all Scripts (tables, SP, triggers, Contraints, etc) and execute then in your new SQL Server.

Then, use DTS only to transfer DATA to the new server.|||Diogo,
Thanks for the response. As you probably know, I am a complete newbie to MS SQL & DTS alltogether.

I don't understand the difference between "objects" and tables/sps/etc..

Also, how do you have DTS only transfer "data" to the tables/sps/etc. I've created using scripts? Under my understanding, DTS offers 3 options:

1) Copy Table(s) from source database
2) Use Query
3) Copy Objects and Data

I guess under #3 I should deselect create destination objects, and transfer all objects, then go into options and deselect all the security options??

Thanks,

Brice|||Make this:
In the SQL 7.0
- Right-Click on the Database, "All Tasks", "Generate SQL Script"
- Then, click on the button "SHOW ALL"
- Select "Script All Objects"
- Then, go to the OPTIONS TAB
- Mark, "Script Indexes", "Script full-text indexes", "Script Triggers", "Script PRIMARY, keys, FOREIGN keys..."
- Now, click OK
- Save this file.

Now, open SQL Query Analyzer and connect to your new Database in SQL Server 2000
- Open the saved File (script from database objects above)
- execute it! (Is should create all tables, SP, etc.;)

ufa!

Now,
Go to DTS, and when he ask for you:
1) Copy Table(s) from source database <--
2) Use Query
3) Copy Objects and Data

Your answer will be 1)!!!!

He will copy all the data from the source tables to the destination tables.

------------------------

You can do this choosing 3) too! But you shouldn`t execute the created script;

Your answer should work too! But I like to create the scripts and execute them. Therefore, bring Data!

Wednesday, March 7, 2012

Problems with Data Sets in SQL Server 2005

Hello,

I am using existing code, which I am trying to convert from using MS Access to SQL Server 2005...

The data set works fine with MS Access database, however when executing with SQL Server 2005 as data source, it generates the following error:

"..The data types ntext and nvarchar are incompatible in the equal to operator..."

in this line:

count = adapter.Update(dataset);

Not sure what should I look for since data sets are new to me.. Where should I check to fix this problem? I have noticed that the table has two columns with nvarchar...

Please show the SQL string associated with the UpdateCommand in the data adapter.

In general, this means there is Text column you are comparing to an nvarchar column, and you cannot do that. Look at all tables, see what column is of type text, and see where that is used in the UpdateCommand. Perhaps the column is of type Text and it does not need to be a Text column.

|||

Hi,

Those data sets were generated by the designer in VS 2003. I do not even see any option to modify it. There are the following files:

DataSeteBayUser.xsd

DataSeteBayUser.Designer.cs

DataSeteBayUser.xsc

DataSeteBayUser.xss

I am not sure where to look for the SQL... I have opened DataSeteBayUser.xsd and it shows a diagram with all fields. But I do not even see option to configure it... I have noticed that all text fields are defined as System.Text. I have VS 2005 Professional Version...

I wonder if this dataset needs to be recreated in the designer, because it was converted from VS version 2003...

|||It shows as generated by MSDataSetGenerator... No idea what thsi tool is and where to download it...|||

rfurdzik:

It shows as generated by MSDataSetGenerator... No idea what thsi tool is and where to download it...

can you open the database look at the table. there must be at least one column 's type is ntext, and in the query's "WHERE" clause(either a stored procedure or dynamic sql), this columns must be used.

The solution is change the column type to nvarchar(n), make sure n is large enough.

Hope this help

|||

The problem is there is no query... The dataset was generated as a file using Visal Studio Table adapter wizard. It shows as data source in Visual Studio.

Also there is no field of type ntext in the database..

|||

This is the relevant code, which access the .xsd data source:

...

OleDbDataAdapter adapterTemplate = m_DataStore.DataAccessKits.DataAdapterUserAccountByID;OleDbConnection connection = m_DataStore.GetDbConnection();OleDbDataAdapter adapter =DBUtils.CloneOleDbAdapter(adapterTemplate, connection);

...

count = adapter.Update(dataset); --> THIS GENRATES ERROR

All other .xsd files (data source) were generated by wizard...

|||

OK, I have opened the xsd file in notepad and it is xml!

<?

xmlversion="1.0"standalone="yes"?>

<

xs:schemaid="DataSetUserAccount"targetNamespace="http://www.tempuri.org/DataSetUserAccount.xsd"xmlns:mstns="http://www.tempuri.org/DataSetUserAccount.xsd"xmlns="http://www.tempuri.org/DataSetUserAccount.xsd"xmlns:xs="http://www.w3.org/2001/XMLSchema"xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"attributeFormDefault="qualified"elementFormDefault="qualified">

<

xs:elementname="DataSetUserAccount"msdata:IsDataSet="true">

<

xs:complexType>

<

xs:choicemaxOccurs="unbounded">

<

xs:elementname="sdk_dbuser">

<

xs:complexType>

<

xs:sequence>

<

xs:elementname="ID"msdata:AutoIncrement="true"type="xs:int" />

<

xs:elementname="eBayUser"type="xs:string"minOccurs="0" />

<

xs:elementname="EnvironmentID"type="xs:int"minOccurs="0" />

<

xs:elementname="ApiToken"type="xs:string"minOccurs="0" />

<

xs:elementname="AuthType"type="xs:int"minOccurs="0" />

<

xs:elementname="Description"type="xs:string"minOccurs="0" />

<

xs:elementname="eBayPassword"type="xs:string"minOccurs="0" />

<

xs:elementname="eBayUserDBID"type="xs:int"minOccurs="0" />

<

xs:elementname="TokenCreateDate"type="xs:dateTime"minOccurs="0" />

<

xs:elementname="TokenExpirationDate"type="xs:dateTime"minOccurs="0" />

<

xs:elementname="TokenSecret"type="xs:string"minOccurs="0" />

<

xs:elementname="TokenSecretCreateDate"type="xs:dateTime"minOccurs="0" />

</

xs:sequence>

</

xs:complexType>

</

xs:element>

</

xs:choice>

</

xs:complexType>

<

xs:uniquename="Constraint1"msdata:PrimaryKey="true">

<

xs:selectorxpath=".//mstns:sdk_dbuser" />

<

xs:fieldxpath="mstns:ID" />

</

xs:unique>

</

xs:element>

</

xs:schema>|||It seems to me like the "xs:string" is translated by wizard generated code to ntext instead of nvarchar. In the table there is nvarchar, so maybe taht is why it does not work...|||

I have found there si a property called Adapter.UpdateCommand.Text:

"UPDATE sdk_dbuser SET EnvironmentID = ?, Description = ?, eBayUser = ?, eBayPassword = ?, eBayUserDBID = ?, ApiToken = ?, TokenCreateDate = ?, TokenExpirationDate = ?, TokenSecret = ?, TokenSecretCreateDate = ?, AuthType = ? WHERE (ID = ?) AND (ApiToken = ? OR ? IS NULL AND ApiToken IS NULL) AND (Description = ? OR ? IS NULL AND Description IS NULL) AND (TokenCreateDate = ? OR ? IS NULL AND TokenCreateDate IS NULL) AND (TokenExpirationDate = ? OR ? IS NULL AND TokenExpirationDate IS NULL) AND (TokenSecret = ? OR ? IS NULL AND TokenSecret IS NULL) AND (TokenSecretCreateDate = ? OR ? IS NULL AND TokenSecretCreateDate IS NULL) AND (eBayPassword = ? OR ? IS NULL AND eBayPassword IS NULL) AND (eBayUser = ?)"

The actual update is done here:

count = adapter.Update(dataset);

|||Hi, I changed all ntext to nvarchar(MAX), not sure what MAX is, hopefully it is large enough..|||Seems to be working, but got other problems now..