|
Ah, so the reason for the multitude of cached query plans is that when dealing with variable length text a new plan is created when a parameter's length is different from a previous plan? So basically, if I want the server to not create new plans, I need to define the size of the variable length parameters?
if (Object.DividedByZero == true) { Universe.Implode(); }
|
|
|
|
|
|
That makes sense. Does the Size represent the size of the data or the size of the field in the database? I would assume that's in bytes also.
if (Object.DividedByZero == true) { Universe.Implode(); }
|
|
|
|
|
|
Got it. Now all I have to do is weigh the overhead of calculating sizes (when and where) vs additional query plans in the cache. Thanks for helping to clear this up.
if (Object.DividedByZero == true) { Universe.Implode(); }
|
|
|
|
|
It would be pretty hard to calculate, since the correct size would be what the size of the field in the database table is defined as.
So there are two ways to go if you want to keep generating your DML.
Either you ask the database what the field sizes are, Or you define them in your classes using an Attribute on your properties.
You get the SizeAttribute for a member using ((SizeAttribute)Member.GetCustomAttributes(typeof(SizeAttribute), true)[0]).FieldName;
|
|
|
|
|
Not so much in this instance. For the above example, the IProperty object also includes a definition class which already has a MaxLength field, along with other database specific information, which is the size of the database field. I used that size first on text fields but noticed that some fields were getting extra empty characters appended to the end of the text to fill the size of the field, so I stopped using it. If I understand correctly, I should be passing the length of the data to the SqlParameter. The extra overhead I was referring to was casting the IData object to it's appropriate type (boxing and unboxing overhead) then getting the length from string.Length or byte[].Length. Trying to weigh which overhead has greater impact, code conversion or database query plans.
if (Object.DividedByZero == true) { Universe.Implode(); }
|
|
|
|
|
Foothill wrote: I should be passing the length of the data to the SqlParameter.
Maxlength is what you want to pass[^], that you got empty character appended is something I've never heard of before. You didn't by any chance use Char instead of Varchar? Char gets padded to the size specified.
Foothill wrote: Trying to weigh which overhead has greater impact, code conversion or database query plans.
Database query plans, without any doubts.
|
|
|
|
|
MaxLength it is and all the text fields are NVarchar(N) by default. Since I should use the MaxLength field, it would be trivial to add a couple of lines in the code that executes the INSERT statement to handle the variable length data. Thanks again.
if (Object.DividedByZero == true) { Universe.Implode(); }
|
|
|
|
|
I want to create an ACCESS database of e-learning includes two class and a number of students and 4 tests and find out any test students liked by data mining
|
|
|
|
|
OK. Do you have a question?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
That's not data-mining; you simply need to track how often a student logs in on a test, and select the one with the most visits.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi all.am really new to asp.net,c# as well as sql.i hope you will help me on this.
i want to call my stored procedure from my class file. and later create an instance of the class in the .aspx.cs file.to do this i have to create a connection object and pass in my configuration key from web.config. that is where am stuck because i had used this:
SqlConnection connection = new SqlConnection ( ConfigurationManager.ConnectionStrings [‘’B.F.M.S"].ConnectionString);
B.F.M.S is my sql database.
Now when i run my application its giving a [NullReference Exception: Object reference not set to an instance of an object].
the error is with that line.
Can you please help on how i can rectify that.
|
|
|
|
|
You have already posted this in the ASP.NET forum. Posting the same question in multiple forums duplicates work and annoys people.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
una ayuda por favor , se puede trabajar en una tabla con la llave primaria que tenga letras y números y que esta se generen automáticamente al hacer un mantenimiento desde ASP.NET??
|
|
|
|
|
This is an English-language site. Please edit your question and post it in English.
Este es un sitio en idioma Inglés. Edite su pregunta y que lo ponga en Inglés.
(Google Translate[^])
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I'm looking for a tool that can migrate a MS SQL Server 2014 database to the latest version of MySQL. The migration includes just tables (structure, keys, indexes, etc.) and their data. Then the product needs to sync any data changes made to the SQL Server database with the MySQL database until I'm confident that the changeover of codebases to MySQL are complete...basically inserts, updates, and deletes. There will not be any schema changes allowed during the migration.
Downtime of the database for a migration is not really an option. In addition, I'm not too keen on the idea of modifying the data access layers to work with both databases (there's a lot of customization I would have to work with). So it seems to me the best place to do this is at the database level itself.
I've been researching tools such as SymmetricDS and ConvertDB. Does anyone have experience with these products that they would like to share? Any other suggestions?
-NP
Never underestimate the creativity of the end-user.
modified 22-Jan-16 17:32pm.
|
|
|
|
|
NickPace wrote: Any other suggestions? Yes; change your requirements.
NickPace wrote: Then the product needs to sync any changes made to the SQL Server database with
the MySQL database until I'm confident that the changeover of codebases to MySQL
are complete. That would include changes to structure and relations.
NickPace wrote: Downtime of the database for a migration is not really an option Then don't change your database structure while your database is up.
Take a look into the sync-framework
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
NickPace wrote: until I'm confident that the changeover of codebases to MySQL are complete
I am with the other responder in that the statement of your situation is either unclear or the actual requirements have not been defined.
I spun up a number of possibilities but there are just too many to cover. I would suggest that you start by defining exactly and specifically how you will determine that the new solution is working correctly before doing anything else.
Additionally unless very strict coding practices were followed the chances that no code changes are needed are rather slim.
|
|
|
|
|
You can use an application named sqlyog. You'll have to copy all the queries used in ms sql server and this can be used to create a database that is same , for mysql. I hope my answer is useful.
|
|
|
|
|
I have SQL Developer 4.1.3 on my PC. I am able to access SQL Server 2008 on a remote server, but only if I specify a USERID/PWD combination. Ideally, I would like to let SQL Server interegate our UID/PWD combination from our DOMAIN login. Does anyone have experience with getting SQL Server to allow login by the UID/PWD values obtained from Domain login?
|
|
|
|
|
Google for "How to set up Windows Authentication Mode security" and read this[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
i have a student data base in access i need help to add some question forms and a counter for which form is active ie which form the student like ??
|
|
|
|
|
So, do you want to keep track of which form is used and how often? Do you want to track counts by student?
Mongo: Mongo only pawn... in game of life.
|
|
|
|
|