Alternate option for SQL Server 2008 Management Studio Express - sql-server

I am trying to install SQL Server 2008 Management Studio Express found here, but I am getting a win32 not an application error.
Is there another option for managing Windows SQL Server databases other than Visual Studio? I just have to be able to log in to the server and run some test SQL like:
ALTER TABLE test ADD column VARCHAR(50)
Can you run that query in Visual Studio? If so that would solve the problem too.

There is the command line sqlcmd utility.
The sqlcmd utility lets you enter Transact-SQL statements, system procedures, and script files at the command prompt, in Query Editor in SQLCMD mode, in a Windows script file or in an operating system (Cmd.exe) job step of a SQL Server Agent job.

Yes, you can run ad-hoc queries to a SQL Server database from Visual Studio.
Find/create a Data Connection in Server Explorer, right-click, and choose New Query.

Related

SQL Server : designer incompatible generate script

We have a SQL Server 2012 for our test box, and a SQL Server 2005 for our production box. Recently, we moved to automated deployment scripts which execute SQL scripts as part of our deployment process.
We encountered an issue whereby the script generated by SSMS, using "Generate Script" in the designer, outputs a script that was incompatible with SQL Server 2005. It added statement SET (LOCK_ESCALATION = TABLE) which is SQL Server 2008+
We have tried changing the compatibility of the database to SQL Server 2005 but this did not resolve the issue. Interestingly, when using Script Table As > Create To > New Query Window, this statement is not included.
There is a SSMS setting "Match script settings to source = false", but, this requires you to set a SQL Server Version globally, which is not an option for us as we maintain a variety of SQL Server versions. Is there a way we can downgrade the "Generate Scripts" compatibility?
When running the "Generate Scripts" task in SSMS, you can define what server version to create the script for:
That should ensure no commands or options are used which are not present in SQL Server 2005.
But I second #ADyson's sentiment - SQL Server 2005 is beyond dead and buried and it's a risk to run production code on such an old version of SQL Server ...... you really should upgrade to a more recent version ASAP!

How do I create Stored Procedure in MSSQL without Management Studio?

I have a customer who is not interested in installing MSSQL Management Studio. And I need to add one Stored procedure in the Database for my application to communicate.
Is it possible to create the stored procedure in MSSQL Server without Management Studio?
FYI, I can export the .sql file for Stored procedure from my system.
Solved
Solutions based on the answers:
SQLCMD (installed with SQL Server)
Azure Data Studio
You can use...
SSDT (SQL Server Data Tools)
SQLCMD
PowerShell
You could see if your client would be willing to install Azure Data Studio (formerly SQL Operations Studio). It's a quicker install than SSMS.

HOW to create SQL Server 2017 database scripts using sqlcmd

I have a database schema sitting in SQL Server 2017 running on Ubuntu. I have a separate SQL Server 2008 R2. I need the database structure to migrate from 2017 -> 2008 R2 server and cannot find the right direction to start with. I had created the backup and tried to restore but it seems we cannot restore in that fashion. I think "create scripts" will do the job but I do not have management studio. All I have is sqlcmd running on the instance with 2017 version. So can I run "create scripts" to get the structure of the database and store in a single .sql file.?
Check this answer: How to use sqlcmd to create a database
Here you go:
sqlcmd -i C:\path\to\file.sql
More options can be found in SQL Server books online.

Open SQL Server 2012 From Command Prompt

I have installed SQL Server 2012, SQL Server 2008 R2 and SQL Server 2014.
Now when I run SSMS it always opens SQL Server 2008.
What to do same for SQL Server 2012?
Any shortcut key or command to run from command prompt like SSMS?
Please guide me.
I found the solution. It is so simple.
Just create desktop short cut and copy that file to C:\Windows\
For example:
Create short cut named as on desktop SQL Server Management Studio Now simply copy it to your C:\Windows path and rename it to SSMS12 and now from command prompt simply type SSMS12 -
It will open SQL Server 2012.

SQL Server Questions

How do I rename a database in Server Explorer on Visual Studio 2008? I changed the filename using Rename on the context menu, but that just changed the filename, not the name in SQL Server (2005 Express).
Also, is there an easy-to-use management tool like PHP MyAdmin that I can use? Or is it easier to just use VS 2008 Server Explorer?
Thanks!
Find SQL Management Studio Express 2005 for all your common tasks in dealing with the database. You'll find it more fully-featured than Visual Studio, and provides the functionality you're used to from PhpMyAdmin.
To rename your database, create a new query, either in VS or SSMS:
EXEC sp_renamedb 'oldDB_Name', 'newDB_Name'

Resources