ssms

Export stored procedure result set to Excel in SSMS

时间秒杀一切 提交于 2019-11-27 09:36:19
i'm using SSMS and attempting to export the results of a stored procedure to a new excel file. The SP accepts an int parameter but I cannot find a way to call it in the query. Latest effort- EXEC sp_makewebtask @outputfile = 'C:\Users\me\Documents\testing.xls', @query = **ExportAsExcel** N'@id' = 123 @colheaders =1, @FixedFont=0,@lastupdated=0,@resultstitle='Testing details' Running the stored procedure results in two tables of data, which I need on separate sheets. Can any of you advise a better way to go about this? It doesn't even need to be automated, I just need to get the correct data.

Where is SQL Server Management Studio 2012?

时间秒杀一切 提交于 2019-11-27 09:08:32
问题 I had SQL Server 2008 R2 and Visual Studio 2008 and 2010 on my laptop. I've installed SQL Server 2012 and have finally got SQL Server Data Tools to show up, so that I can create SSRS reports in Visual Studio 2010. Although I've installed Management tools - many times - on two separate instances of SQL Server 2012, I can't find them in Programs and can't run them. The only SSMS program I can find runs SSMS 2008 R2. I realise that common advice is to install SQL Server before Visual Studio, but

ALTER DATABASE failed because a lock could not be placed on database

两盒软妹~` 提交于 2019-11-27 09:00:57
问题 I need to restart a database because some processes are not working. My plan is to take it offline and back online again. I am trying to do this in Sql Server Management Studio 2008: use master; go alter database qcvalues set single_user with rollback immediate; alter database qcvalues set multi_user; go I am getting these errors: Msg 5061, Level 16, State 1, Line 1 ALTER DATABASE failed because a lock could not be placed on database 'qcvalues'. Try again later. Msg 5069, Level 16, State 1,

Changing the CommandTimeout in SQL Management studio

老子叫甜甜 提交于 2019-11-27 08:48:26
How can I change the CommandTimeout in SQL Management Studio? TheVillageIdiot Changing Command Execute Timeout in Management Studio : Click on Tools -> Options Select Query Execution from tree on left side and enter command timeout in " Execute Timeout " control. Changing Command Timeout in Server : In the object browser tree right click on the server which give you timeout and select " Properties " from context menu. Now in " Server Properties -..... " dialog click on " Connections " page in "Select a Page" list (on left side). On the right side you will get property Remote query timeout (in

Procedure times out from ADO.NET but not in SSMS

旧街凉风 提交于 2019-11-27 08:16:49
问题 I've got a stored procedure that is giving me a SqlException because of a timeout when I run it from code (with timeout set to 30). When I run the procedure directly in Management Studio, it executes in under 1 second. I also only get the timeout when running it against a specific database. When I use other databases it finishes quickly without an error. Here is the full error message: System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to

SQL Server 2016 Express Management Studio cannot design a new or existing table

依然范特西╮ 提交于 2019-11-27 08:11:26
问题 In Microsoft SQL Server 2016 Express Management Studio (July 2016) cannot design a new or existing table. Image 1: click on the tables node. Where is the menu option to add a new table? Image 2: Click on existing table. Where is the menu option to edit an existing table? Version: SQL Server 2016 Management Studio (July 2016) Thanks! 回答1: This has been reported as a bug: Microsoft Connect social.msdn 回答2: Microsoft released a hotfix for this issue already. You can download it here: https:/

sql server management console doesn't work with multi-byte characters

柔情痞子 提交于 2019-11-27 07:07:30
问题 I'm trying to work out how to use SQL server management studio properly with multi-byte unicode characters. even something as simple as: select N'动漫' just returns square boxes in the result pane. I know the underlying database is set up correctly to handle unicode and other apps on the PC work fine with chinese characters any clues very much appreciated 回答1: Changing the font to Arial Unicode MS did the trick for me. I don't understand why Text Results displays fine with Fonts where Grid

Full precision output of floating point types in SQL Server Management Studio

这一生的挚爱 提交于 2019-11-27 06:48:48
问题 I have the value 1555.4899999999998 stored in a float column with default precision (53). When I do a simple select , SSMS rounds the output instead of printing it with all available precision. It's caused some gotchas for me recently since the value printed doesn't work as a float literal to match the actual stored value. For example (note that both of these numbers have an exact representation in the default float ), declare @f1 float declare @f2 float set @f1 = 1555.49 set @f2 = 1555

SQL Server (localdb)\\v11.0 explained

点点圈 提交于 2019-11-27 06:13:42
I'm following Code First to an Existing Database tutorial and noticed that it suggested to connect to (localdb)\v11.0 in learning purposes. I've tried to connect to it using my SQL Management Studio and it worked. But when I've restored a DB backup it created an [DatabaseName].mdf file in my user's directory. I'm quite surprised and have following questions: What is a (localdb)\v11.0 ? Does it uses my SQL Express or SQL Compact? Does it support only databases stored in .mdf files? How can I specify path for my restore other than my user's folder? What general purposes does it serve (is it for

Import / Export database with SQL Server Server Management Studio

主宰稳场 提交于 2019-11-27 06:03:19
I thought this would be trivial, but it isn't... I'm sure there is a simple way to do it but I can't manage to find it. Shame on me. I want to import/export the database itself, the tables, the constraints (foreign keys and so on). I'd rather not get the data with it, but I can get rid of it after if there's no other way. So... how do you export a database using MS SQL Server Management Studio ? How do you import it? The only solution I found was right click on the tables and "script to Create", but I have something like 100 tables, so I'd rather avoid this. Thanks! Brandon Right click the