ssms

Best script to restore multiple databases with SQL Server 2012?

帅比萌擦擦* 提交于 2019-12-09 19:00:24
问题 I have to restore around 60 SQL databases of different sizes. I googled to find a script to restore all databases after each other , just picking it 1 by 1 from my folder. I was not that successful, probably because I am quite new to SQL etc. It can be either done in powershell or sql command line, what I found for now was something like this: RESTORE DATABASE [db1] FROM DISK = N'C:\folder\db1.bak' WITH FILE = 1, NOUNLOAD, STATS = 10 GO RESTORE DATABASE [db2] FROM DISK = N'C:\folder\db2.bak'

IntelliSense is not working in SQL Server Management Studio

早过忘川 提交于 2019-12-09 08:21:48
问题 We use SQL Server Management Studio 2008 R2. IntelliSense works with SA account perfectly. But it is not working with Windows Authentication user. The user has access master db with db_owner role but it's not sysadmin. How do I fix this issue? 回答1: You can try solution from these questions1 or questions2 and questions3. Or please try these steps as below: Enable IntelliSense: For all query windows, please go to Tools >> Options >> Text Editor >> Transact-SQL >> IntelliSense, and select Enable

Are there Free SQL Server Mgmt Studio Autocomplete Add-ins?

核能气质少年 提交于 2019-12-09 05:28:02
问题 I know Red Gate has such a product, but I'd rather not have to pay for something which, in my opinion, should be built into SSMS. Thanks! 回答1: I totally agree with you on this. Sadly I never found any plugins that you are talking about. So, I moved to tools from EMS SQL Server Manager and TOAD for SQL server. I think the SQL Server 2008 Studio has intellisense but in the express edition, i found it to be seriously lacking. 回答2: I’m using ApexSQL Complete. It’s quite good for a free add-in but

Unable to connect SQLEXPRESS with Laravel 5.6

自古美人都是妖i 提交于 2019-12-09 01:50:50
问题 I'm trying to connect Laravel 5.6 to my SQLEXPRESS. When I try to migrate tables from Laravel to SQL, I am getting this error: SQLSTATE[08001]: [Microsoft][ODBC Driver 13 for SQL Server]TCP Provider: No connection could be made because the target machine actively refused it. (SQL: select * from sysobjects where type = 'U' and name = migrations) I have installed the sqlsrv extionsion to php and tested it: <?php $serverName = "MYNAME\\SQLEXPRESS"; $connectionInfo = array( "Database"=>"Portal",

How to connect to a local database in SQL Server Management Studio?

こ雲淡風輕ζ 提交于 2019-12-08 22:48:13
问题 I have downloaded the SQL Server Management Studio (SSMS) 2016 to recover a huge .bak file which is an old backup of a database. But first of all I need to connect to a DB Server. After install, I execute SSMS and it asks me to connect to a DB Server. I don't have any and I saw that it is possible to create a "local" db by typing only a dot '.' for Server Name and use Windows authentication. It is not working; how to do it? 回答1: You need to download and install SQL LocalDB. It is a special

SQL Server: how do I export entire database?

陌路散爱 提交于 2019-12-08 19:57:04
问题 I need to export database from one server and import it into another server. How do I export the entire database to a file, or two files mdf, ldf (either option is fine) How do I import it into a new server using ssms? In the instructinos frmo ponies, it says: In the To a point in time text box, either retain the default (Most recent possible) or select a specific date and time by clicking the browse button, which opens the Point in Time Restore dialog box. For more information, see How to:

SQL Server Management Studio Schema View

自闭症网瘾萝莉.ら 提交于 2019-12-08 17:03:53
问题 I'm working with a SQL server and several databases. Each database may have many schema's, such as dbo., admin., other., and I'm getting tired of scrolling around trying to find things. If I'm working on a schema specific project, I want to filter out everything else from my view except that schema. As dbo, I see everything which means I spend the majority of my day molesting my scroll wheel (that is a joke). Is this possible in SQL Server Management Studio 2008? 回答1: In SSMS 2005 or 2008,

SQL SERVER MANAGEMENT STUDIO: Highlight variables

陌路散爱 提交于 2019-12-08 15:58:43
问题 Is there a way in SQL SERVER MANAGEMENT STUDIO to highlight all usage of variables when we click on a variable name? 回答1: It might not work in all cases, but I find that using the F2 button, which on my machine is mapped to 'View.EditLabel'. It allows me to highlight all of one 'type' things like aliases, variable names and others. Not perfect, but fits my purpose. I still stand by the fact that it might not be perfect, but it does do what the original poster asked. If you want to see what

Restore .bak file to remote database

早过忘川 提交于 2019-12-08 15:48:49
问题 I have a test.bak file in my local machine. I need to restore this file to remote machine's database. How do I do that? When I try this, the remote database throws an error that it is not able to find test.bak on the local filesystem. Query RESTORE DATABASE TESTPROJECT FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ICON3\MSSQL\Backup\test.bak' Error Cannot open backup device 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ICON3\MSSQL\Backup\test.bak'. Operating system error 2

Visual Studio append text to end of lines using find/replace with end line regular expression ($)

谁说我不能喝 提交于 2019-12-08 15:47:05
问题 I am trying to append some text (e.g. "Fish") to the end of every line in a file using Visual Studio or SQL Server Management Studio using the following settings in the find/replace dialog: Find what: $ Replace with: Fish Use Regular expressions: Checked This mostly does the job, but for a handful of lines it not only appends "Fish" to the end of the line it also puts it at the beginning of the line. I can't discern any pattern to this behaviour it seems to be almost random, with the larger