sqlcmd for SQL Servers - sql-server

Faced the problem of using sqlcmd in sqlserver, but I do not know for which server versions it fits, I could not find it. this console does not depend on the version of sql server?
So, if I want to install sqlcmd on sqlserver 2003, it will work or need a version of the server> 2008 ???

Good day,
sqlcmd is not part of SQL Server but external utilities.If you want to use it then you need to install it (together with other tools like SSMS or separately). You can download the last version (at this time) from Microsoft directly from this link.
You should use the latest version even if you use older version of SQL Server (from 2008 and above) since the new version include support for new features. Do not use old version of sqlcmd to connect newer version of SQL Server even so it should work for basic tasks
--- update: adding some more information ---
Here you can find more information regarding how to use the tool:
https://learn.microsoft.com/en-us/sql/tools/sqlcmd-utility

Related

The proper type library could not be found in the system registry SQL Server 2008 R2 Management Studio error

I get this error in Management Studio. I don't know what the reason is. I tried repairing SQL Server, but still the issue is not resolved. I read a lot of articles about this, but I don't know how to do this with registry keys.
How to solve permissions issue?
As James suggested, it's time to use a later version of SQL Server Management Studio.
If you can run the latest (version 18.4), that would be good. It still has support for SQL Server 2008.
However, it has more recent dependencies. If you look at the list of dependencies, you might decide that an earlier version would be better on the older system. SSMS 18.4 was based on a more recent Visual Studio shell. SSMS v17.9.1 is also available for download still, works fine with SQL Server 2008, and uses the older shell, so you might have less friction when trying to install it.

What versions of PowerShell, SqlCmlet, and SQL database engines are compatible?

I need to work with numerous versions of SQL Server 2008R2 to current. I'm trying to learn and do more with PowerShell. So far, I have determined the following based on research. Can anyone please verify these and also add any specific details about backwards compatibility? Any additional help is appreciated.
SQL Server 2008R2 - PowerShell V2 (?) - SQLServerCmdletSnapin and SQLServerProviderSnapin
SQL Server 2012 and 2014 (?) - PowerShell v3 - SQLPS (load with Import-Module)
SQL Server 2016 and later - PowerShell v5 and later - SqlServer (load with Install-Module)
**New information below this point
I guess what I am asking is can I use the SQLServer with PowerShell versions prior to v5 and SQL versions prior to SQL 2016, or am I stuck with the commands that were included in SQLPS?
Or, if I am on Powershell v5 and SQL 2016, and write a script to manage SQL instances and databases, can I give it to people running SQL 2012 and have it work?
Can I use cmdlets like Add-RoleMember found in the SqlServer module, but not the SQLPS module be used, as long as I have them load the new module first, or does the new module only work on the newer SQL versions?
Also, is there a minimum version of PowerShell that supports the SqlServer module?

SQL Server SSRS ReportServer Database Version Error

This is probably a trendy question, But I promise you my problem is different.
Lately my server windows crashed and I was forced to install new windows.
I took a backup of the database "ReportServer" and "ReportServerTempDB".
Until then I didn't remember the SQL Server version was installed before the windows crashed.
Now when I try to attach these databases and run the report server, it tells me the following message
"The version of the report server database is either in a format that is not valid, or it cannot be read. The found version is '163'. The expected version is '162'. (rsInvalidReportServerDatabase)"
I've made some research, and understood that my current installed SQL Server version is higher than the database, I tried installing some cumulative updates but when I run the updates it seems not to be recognizing the SQL Server version installed.
Current installed version: Microsoft SQL Server Enterprise: Core-based Licensing (64-bit) 2014 v12.0.2000.8
Previously installed version: Microsoft SQL Server 2012 Enterprise Not sure though.
My problem is that I can't open the ReportServer database because it's version is older and I can't install the right cumulative update to fix this issue. Can anyone point me to the right direction?
Much appreciated Thanksss!!.

Migrate a SQL Server database to a lower version

I am trying to downgrade a SQL Server 2014 database to a lower version (SQL Server 2012) by using the task Generating scripts found when right clicked on the database.
After I make the settings in order to generate the script, the server does that but when I'm trying to open the file (the script made) on a lower version instance of SQL Server, I get the following error.
System out of memory exception thrown
Could anyone provide some help? Thanks!
As suggested by #usr you can run the script from the command line using sqlcmd:
sqlcmd -S myServer\instanceName -i C:\myScript.sql
Alternatively you can download a trial edition of ApexSQL or Redgate SQL Compare (assuming you have not tried them already) and script over the changes using these tools.
The script is too big for SSMS (a shame!). Run it using SQL Server command line tools.
I find it easier to do this by using Redgate SQL Packager or the two compare tools. They can execute enormous scripts.

How do I fix a Cross language installation problem in SQL Server 2008?

I'm trying to do a SQL Server 2008 setup and I've been given a Cross Language Installation failure. More specifically:
Rule "cross language installation: failed.
the Setup language is different than the language of existing SQL Server features. To continue, use SQL Server Setup installation media of the same language as the installed SQL Server features.
I do not have SQL Server Express installed and I browsed through "Add or Remove Programs" and was unable to find anything that looked like it was a previous version of SQL.
Any tips?
I restarted the setup after facing the same problem, and I realized that man should not close the installation center till the setup process is completed. If you leave it open it will work.
Ensure that you have uninstalled all of your old SQL Server versions. Also you must restart the installer if you have not done that when you began installation.
All I had to do was exit the installer and start the process again. For some reason it worked the second time around.
I had the same problem today when installing SQL Server 2008 Express on a computer that has never had an instance of SQL Server installed.
I found that "Microsoft SQL Server 2005 Backward compatibility" was installed. I removed this via Add/Remove Programs and was able to successfully install SQL Server 2008 Express afterwards.
Change the Current Windows Language interface for the needed language you want to install.
That will make it possible for the Installer to launch the Localized version.
If you've previously installed SQL on the machine (or apparently some RedGate tools) have you checked for any SQL detritus in the registry?
If not then the MS forums have details of some reg keys to look out for, and some of the links are worth following for advice on what to delete from the registry.
On my installation of Sql Server 2008 Express, this was caused by having Sql Server 2005 Express Tools installed while trying to install 2008. Uninstalling 2005 Tools fixed the problem. I was able to keep Sql Server 2005 Express, including Sql Server 2005 Backward compatability; only had to nuke tools.

Resources