Tableadapter You must have Microsoft SQL 2005 or greater - sql

I just received a project that hasnt been touched in a while. It was written in VS2005 and SQl 2000. I upgraded the project to VS2010 with no problems. However; when I tried to modify the table adapters etc. I get the error "You must have Microsoft SQL 2005 or greater".
This project has 100's of datasets and table adapters all referencing SQL 2000.
I guess I have 2 questions:
Should I takeall these adapters out and make a data layer and connect to the DB that way?
Or can I upgrade the DB to SQL 2008 and it will all work the way it is? Not sure what is the best approach on this one.
And this is a desktop app if it matters.
Any suggestions would be great.
Thanks

I was able to connect VS 2010 to a MSSQL 2000 db by selecting a SQL db and then the OLE option - then said remember password (yes, I know it's not encrypted). That provided a connection string in the projectname.exe.config file that looks like:
<add name="projectname.My.MySettings.dbnameConnectionString"
connectionString="Provider=SQLOLEDB;Data Source=ip.ip.ip.ip; Persist Security Info=TRUE;Password=xxxxxxx;User ID=username; Inital Catalog=dbname"
providerName="System.Data.OleDb" />
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework, Version=4.0,Profile=Client" />
With this I get Messages on the last line here -
Could not find schema information for the attribute 'sku' (and 'version' and element 'supportedRuntime')

Related

SSDT schema comparison error: Value cannot be null. Parameter name: identifierGroup

With SSDT in VS 2017 I cannot do a schema comparison of two databases. Steps to reproduce:
Tools >> SQL Server >> New Schema Comparison
Select a source (a SQL 2017 database)
Select a target (a SQL 2017 database)
Compare
Get error: Value cannot be null.
Parameter name: identifierGroup
I've also tried in VS 2015 which was still installed and it failed there too.
This error starts after the identity Cache is disabled
ALTER DATABASE SCOPED CONFIGURATION SET IDENTITY_CACHE = OFF
After re-enabling it, the error disappears:
ALTER DATABASE SCOPED CONFIGURATION SET IDENTITY_CACHE = ON
Don't forget to restart sql service.
I had the same issue and not yet found a solution, I suppose there are some relation with orphan users.
I did a workaround that worked fine to me.
Create a new empty database
Compare the origin database with this new one.
Update the new database with de resulting script.
Make this new database the new origin and compare with the destination database.
Update de destination database.
Maybe this can helps!
I found a different answer which worked for me several times so far using SSDT / Visual Studio 2019 against SQL server 2019 databases.
https://hendrikbulens.com/2018/10/03/how-to-fix-sql-server-data-tools-error-unexpected-exception-caught-during-population-of-source-model-in-visual-studio-2017/
Hope this helps someone. Ideally Microsoft needs to patch this issue, which looks like a longstanding bug at this point. I looked for such a patch but did not find one. If anyone finds one, please do link it here.

Visual Studio Data Compare Msg 3727

I tried to do data compare with Visual Studio 2012 but got 1 critical error. I was able to to do the comparison between these 2 db before I was forced to update the data compare since I am comparing with another db using SQL 2014. My latest SQL Server Data Tools ver is 11.1.40403.0
Please see below for the screen shot. Has anybody encounter this before and has solution? I am stuck as data compare doesn't has any option to select to bypass constraint check or whatsoever.
Problem is solved automatically after restart PC.

How do i get the names of all the tables inside a database?

EDIT2: Found a fix! I used the number of the desired schema instead of the name. Should've thought of that before, really! And i think the error messages could've been a bit better aswell. Thanks for all your time!
How can i get the names of all tables inside a database through sql inside asp classic?
The server is running windows 2008, iis7.5 and microsoft jet. I've tried all the querys i could find on the internet (and here) but none have worked.
If i add a ; to the query to run a set of querys at the same time it gives me an error because the statement isn't over at the semicolon.
The master.mdf database cannot be accessed because it's of unknown format.
The sysobjects variable apparently doesn't exist.
I am using mssql 2000 format. (.mdf)
The connection is made through classic asp with the Microsoft.Jet.OLEDB.4.0 provider and ADODB connection/recordset.
How do I get list of all tables in a database using TSQL?
Query to get the names of all tables in SQL Server 2008 Database
EDIT:
I've found two folders containing databases. One is in C:\program files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\mssql\binn\templates and contains master.mdf, mastlog.ldf, model.mdf, modellog.ldf, msdbdata.mdf and msdblog.ldf. The other one is also in the \binn\template data directory and contains master.mdf, mastlog.ldf, model.mdf, modellog.ldf, MSDBData.mdf, MSDBLog.ldf, mssqlsystemresource.ldf, mssqlsystemresource.mdf, tempdb.mdf and templog.ldf. Maybe these is of some interest?
How can i tell if i have permission? Does it give a permission denied error?
Please help! No, don't. Read the 2nd edit at the top.
USE YOUR_DATABASE
GO
SELECT *
FROM sys.Tables
GO
Have you tried the example from:
http://www.kamath.com/codelibrary/cl002_listtables.asp
I almost always use the INFORMATION_SCHEMA views:
SELECT * FROM INFORMATION_SCHEMA.TABLES
If this isn't working for you, the SQL user your site is running under may not have access to the system objects. This is actually a good thing, as giving your site access to the underlying database schema can leave you vulnerable to SQL injection.
So if you do go this route, proceed with caution.
The mdf by itself is useless: you need a database engine (a.k.a. a SQL Server instance) to "run" it. As I understand the question, this is your problem.
Then you can use sysobjects in your database: unless you have added your tables to the master database
There is no practical way to use an mdf directly: if nothing else download MSDE

Error with varchar(max) column when using net.sourceforge.jtds.jdbc.Driver

I have a MS SQL database running (MS SQL 2005) and am connecting to it via the net.sourceforge.jtds.jdbc.Driver.
The query works fine for all the columns except one that is a varchar(max). Any ideas how to get around this issues?
I am using the jdbc driver to run a data index into a SOLR implementation.
(I do not control the database, so the first prize solution would be where I can tweak the SQL command to get the desired results)
Thanks
I have found what looks to be a answer. In setting up the driver for the connection to SQL server I did not specify useLobs=false. I am a bit worried about what this will mean for performance, but at least for now it works.
<dataSource
driver="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://server/database;useLOBs=false"
user="user"
password="password" />
I had the same problem with connecting to MS SQL 2K3. The useLOBs=false did not work for me, but changing the SELECT to CAST(Name AS varchar(255))'Name' worked for me.

Multiple Versions of SQL Server using Entity Framework in a single ASP.NET application

I am using the Entity Framework in a web application that utilizes SQL server 2000, 2005, and 2008. When I create a new EDMX file using anything other than 2008 (version of the first edmx created) I receive error 0172: All SSDL artifacts must target the same provider. The Provider 'MyDatabase' is different from ' MyDatabase ' that was encountered earlier. It seems that somewhere in the code the connection is wired to a 2008 datastore and when it checks the SSDL file and sees a different ProviderManifestToken value it throws this error. I am a little more than frustrated. It is hard to imagine that EF will only work with a single version of Sql Server per application. I am fairly sure there must be a setting or workaround. Does anyone have a solution to use different versions of SQL server and the Entity Framework within a single web application?
I was able to accomplish this by putting each edmx in a separate assembly. Then in the connection string, replace all the res://*/... with res://NameOfAssembly/...
I can even perform joins between the two entity models (contrary to claims I found in other sources), e.g.:
var oneDb = new Entities2000();
var otherDb = new Entities2005();
var results = from one in oneDb.SomeSet
join other in otherDb.OtherSet
on one.Property equals other.Property
select new {
SomeProp = one.SomeProp,
OtherProp = other.OtherProp
};
This link helped me to solve the problem when there was a difference in SQL server 2005 and 2008.
http://kkryczka.wordpress.com/2011/01/03/all-ssdl-artifacts-must-target-the-same-provider-the-providermanifesttoken-2008-is-different-from-2005-that-was-encountered-earlier/
Right click on the .edmx file and select Open with XML Editor.
Open Entity Framework .edmx file:
Change the ProviderManifestToken to 2008:
Looks like its a known issue for Microsoft.