Cannot find sequences in Microsoft SQL Server Management Studio 19 - sql

I have tried creating a sequence for my table in Microsoft SQL Server Management Studio 18. I have a syntax error for some reason (although I have checked multiple times the syntax), but I cannot even find the sequences folder for my database. I have also tried not writing the schema name, but the same error appears. What might be the problem? Where do I go wrong?
Here is a screenshot of the problem

First note that SSMS (SQL Server Management Studio) is just a client application that talks to a connected SQL Server instance in the background. So SSMS only passes your SQL statements to the connected SQL Server and shows you the results that SQL Server returns. Nothing more.
What is the version of the SQL Server instance to which your SSMS is connected? (You can check it quickly by executing the SQL statement PRINT ##VERSION.)
You should be aware that the CREATE SEQUENCE statement is only supported by SQL Server 2012 and higher.

Related

Issues with Access 2003 project in using SQL Server 2005

Our company has a Access 2003 project that runs on a SQL Server 2000 database. We installed SQL Server 2005 on a new box and migrated the database from SQL 2000 to SQL 2005. The Access 2003 project is now pointing to the new database. After the upgrade the Access 2003 project fails when trying to execute a stored procedure. Upon investigation an error message is presented saying that the stored procedure does not exist. When I view the available stored procedures the names appear but with a ;1 a the end.
Is this an issue of incompatibility between Access 2003 and SQL Server 2005 or could I have done something incorrectly during the migration?
I saw another post which mentioned upgrading to Access 2007. Is this a possible solution?
The postfix number is an arcane feature of SQL Server going back years - it allows you to create multiple procedures with the same name (yeah, like that's not going to confuse anyone ever).
It's deprecated so it's hardly ever seen but whatever process your migration did seems to have caused it.

SQL Server table in Oracle SQL Developer

I connected SQL server database with Oracle SQL Developer 3.2.10.09, everything looks good except i can only browse data, i cannot change data in tables cannot insert new or delete rows. Query is also disabled (i got message: Query Builder is not supported for this connection type.) I used Third Party JDBC Drivers - jtds-1.2.6.jar as my connection to SQL server. Is there a way to change data in tables?
It helped me to rollback to Oracle SQL Developer v.3.1.06.82
That Query Builder supports MS SQL Server tables
I just use SQL Server Management Studio. You see.. when you buy a complete STACK of software, it comes with tools for writing SQL. Don't worry, if you're too cheap to buy $49/developer's edition of SQL Server, you can still get SSMS for free.

How can I restore a database backup file (.bak) from SQL Server 2012 into SQL Server 2008 Express?

A database that was originally from SQL Server 2008, was restored into SQL Server 2012. A backup from SQL Server 2012 was made and I am trying to restore it on my local SQL Server 2008 Express. However I get an error 'Specified cast is not valid' (SQLManagerUI).
I have generated an SQL Script from 2012 and set it so that it will generate with compatibility to SQL Server 2008. However it is a large sql file, around 700mb.
I recall before that I had tried to run a script of that size before on my local SQLExpress and also got an error.
Is there a way I can get a "large" database from SQL Server 2012 into SQL Server 2008 Express?
Thanks to Marc and Aaron for providing the answers.
The quick answer is no, it's not possible to restore a backup file from a higher version to a lower version of SQL Server.
A work around would be to generate the scripts to create the database.
You can target the script generation to a lower version.
Please see comments above for more information.
Links:
Why an SQL Server Database from a higher version cannot be restored onto a lower version of SQL Server?
Create Database in SQL Server 2012, Script and Use in 2008?
Couple things to add that might be helpful to folks
When scripting large databases using scripting wizard in SSMS it’s really important to check the execution order and be willing to re arrange it manually. Older versions of SSMS had this problem because they (probably) relied on sp_depends that has a bug.
What I’ve found really useful in such cases are tools like ApexSQL Diff that you can use to read database backups and generate scripts that are in correct execution order.
SQL Server database backup restore on lower version
One thing that none of the methods will catch is the thing Aaron mentioned about using functions specific to higher version.
A better option than using the SSMS scripting wizard is to use a similar tool available on Codeplex called SQL Database Migration Wizard - http://sqlazuremw.codeplex.com/releases/view/32334. You want the latest version v4.x to work with SQL Server 2012.
The tool is originally intended to be used for migrating databases between SQL Server and Azure. However the tool works just as well as between SQL Server and SQL Server. The trick is to set SQL Server rather than Azure as the target in the advanced options.
The reason this is a better option than the SSMS scripting wizard is that it uses BCP for the data transfer rather than TSQL and so is much more efficient.

Moving data between oracle and sql server using Linked server

I have set up Oracle Linked server on Sql Server 2005 box using Oracle provider oledb and its working fine from sql server 2005 to oracle 9i, i.e. When i run distributed query from sql server i get data from oracle server to sql server. Now I don't have any clue how do i run distributed query from Oracle server and get data from sql server repeatedly. Do i have to set up Dsn ? What other things i have to set up before i run query from oracle server?
FYI : Oracle server is Sun solaris server and SQL server is x64 Windows Server 2003. Sql server has oracle client installed on it with odac drivers for ORACLE Provider for OLEDB.
I am going to use loadjava to load java into oracle and than move data between both repeatedly. (Java, Stored procedures & Triggers from oracle to get data from sql server)
Here is one way. DG4ODBC setup guide here.
This might help, too.
linking databases is the first phase. After that you may face the problems we faced, like not being able to delete fetched rows from Sql Server to Oracle Server remotely.
I will post a question about that, it is odd that our procedures used for data synching do not respons the same.

Restore SQL Server 2008 DB *to* SQL Server 2005

Got myself in a bit of a pickle here ... working on a CMS project, under the assumption that sql server 2008 was greenlighted as the db of choice. Well it wasn't, we now have to backport all of our content out SQL Server 2008 and into SQL Server 2005.
A simple backup/restore procedure yields: "RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241)".
Unfortunately, exporting the data to an excel spreadsheet yields multiple OLE errors which I believe is actually a problem in the db of the cms.
Does anyone out there have other approaches they would like to recommend for this task? Thanks in advance
Use RedGate:
tool for comparing and deploying SQL Server database contents.
You can work with live databases, backups, or SQL scripts in source control. Damaged or missing data can be restored to a single row, without the need for a full database recovery.
SQL Data Compare helps you compare and deploy changes quickly, simply, and with zero errors...
There is no way to do this by default. You can generate scripts for 2008 database on 2008 server and then execute these scripts on 2005 version. Note that you’ll have to manually review scripts and remove all parts that are unique to 2008 version.
Another way is to use third party tools such as Red Gate or ApexSQL Diff (move schema) and ApexSQL Data Diff (move data).
Use the Generate SCripts to create the database and schema and ensure you target SQL Server 2005 and script data.
Rather than do a backup and restore you might try using SQL 2005's Import/Export Data wizard.
http://support.microsoft.com/default.aspx?scid=kb;en-us;314546
http://msdn.microsoft.com/en-us/library/ms140052(SQL.90).aspx
I've just hit the same problem and here is how I worked around it.
The problem was to copy a database from an operational SQL Server 2008 database to a new SQL Server 2005 database.
I scripted the database using Management Studio on the 2008 server. I only scripted the database design, not the data. I should add also that the DB only has tables and indexes, so I haven't tried this with any cleverer objects although I can't think why they wouldn't work.
On the 2005 server I created a new database by hand and then ran the script to set up all the tables and indexes.
The in Management Studio back on the 2008 server I used the Export Data wizard to export the data from the 2008 server to the 2005 server. It's currently running and seems quite happy moving the data.
Once all the data is across I'll have a couple of small things left to do - create the users and set-up the security in the 2005 DB, but all-in-all it doesn't look like a bad way of doing it. It's not quite point-and-click but it's not too strenuous.
So it seems that the Copy Database wizard won't work (I think because the package ultimately runs on the 2005 server and 2005 Management Studio can't talk to 2008) but the Export Data wizard is quite happy moving data ... as long as the DB already exists on the target server.
Hope that's useful.
It's not possible to restore to previous versions in SQL Server
Is there no SQL 2005 backup around? Otherwise you really are limited to export the entire database in 2008, and re-import back into 2005, or the Import/Export wizard in 2008
Or rely on 3rd party tools. e.g. Red Gate Data Compare is able to sync. the DATA between 2 servers/databases
I only use mysql but can you export your data into sql statments, and then import then into sql2005? Just a thought..
I faced a similar problem (sql 2005 to sql 2000), and found that I happened to have a blank database at the older version. I used bcp.exe to copy all the data.
check this link click here
You can create the database script in sql server 2008 and you can use it sql server 2005 and lower version....