ssms

Why is running a query on SQL Azure so much slower?

不问归期 提交于 2019-11-26 22:57:50
问题 I created a trial account on Azure, and I deployed my database from SmarterAsp . When I run a pivot query on SmarterAsp\MyDatabase , the results appeared in 2 seconds . However, running the same query on Azure\MyDatabase took 94 seconds . I use the SQL Server 2014 Management Studio (trial) to connect to the servers and run query. Is this difference of speed because my account is a trial account? Some related info to my question the query is: ALTER procedure [dbo].[Pivot_Per_Day] @iyear int,

How do I grant myself admin access to a local SQL Server instance?

杀马特。学长 韩版系。学妹 提交于 2019-11-26 22:30:41
问题 I installed SQL Server 2008 R2 to my local machine. But, I can't create a new database because of rights (or lack of). "CREATE DATABASE PERMISSION DENIED" So, I tried to assign the admin privileges to my current login "User does not have permission to perform this action." I also tried to create a new login that would have admin privileges but with no luck. How do I grant myself admin rights so that I can create a database? I can re-install, but I prefer not to. 回答1: Yes - it appears you

How to generate an INSERT script for an existing SQL Server table that includes all stored rows?

时光怂恿深爱的人放手 提交于 2019-11-26 22:28:38
问题 I'm looking for a way to generate a "Create and insert all rows" script with SQL Management Studio 2008 R2. I know that I can create a "create table" script. I can also create an "insert in" script, but that will only generate a single row with placeholders. Is there a way to generate an insert script that contains all currently stored rows? 回答1: Yes, but you'll need to run it at the database level. Right-click the database in SSMS, select "Tasks", "Generate Scripts...". As you work through,

SSMS version 18 – no Database Diagrams

早过忘川 提交于 2019-11-26 22:22:26
I notice that Database Diagrams are not supported in SSMS version 18, any idea why, and is there a way to get the same functionality? And why is the T-SQL debugger gone now? Sami As it was posted at June 11, 2019, to announce that SQL Server Management Studio (SSMS) 18.1 is now generally available , the Database diagrams is back in SSMS 18.1 along side SSBDIAGNOSE.EXE and Integration Services (SSIS) Original Answer: The feature is deprecated, you can visit SQL Server Management Studio - Changelog (SSMS) page and read the Deprecated Features in SSMS 18.0. Deprecated Features The following

Query times out when executed from web, but super-fast when executed from SSMS

心已入冬 提交于 2019-11-26 21:55:42
I'm trying to debug the source of a SQL timeout in a web application that I maintain. I have the source code of the C# code behind, so I know exactly what code is running. I have debugged the application right down to the line that executes the SQL code that times out, and I watch the query running in SQL profiler. When this query executes from the web, it times out after 30 seconds. However, when I cut/paste the query exactly as presented in Profiler, and I put it into SSMS and run it, it returns almost instantly. I have traced the problem to ARITHABORT being set to OFF in the connection that

how do I make a composite key with SQL Server Management Studio?

╄→гoц情女王★ 提交于 2019-11-26 21:52:08
how do I make a composite key with SQL Server Management Studio? I want two INT columns to form the identity (unique) for a table Open the design table tab Highlight your two INT fields (Ctrl/Shift+click on the grey blocks in the very first column) Right click -> Set primary key here is some code to do it: -- Sample Table create table myTable ( Column1 int not null, Column2 int not null ) GO -- Add Constraint ALTER TABLE myTable ADD CONSTRAINT pk_myConstraint PRIMARY KEY (Column1,Column2) GO I added the constraint as a separate statement because I presume your table has already been created.

Query runs fast in Query Analyzer but slow in C# application [duplicate]

时间秒杀一切 提交于 2019-11-26 21:44:18
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: sql runs fast in ssms slow in asp.net Using SQL Server 2005, there is a sql query on a few big tables and it times out in the program. However, when I run it in Query Analyzer, it finishes in about 30 seconds. Why the difference? 回答1: Usually these are SET setting differences, leading to different plans. In Management Studio the procedure is probably running with the same settings as were in place when it was

“Create new table” is not visible on SSMS 2016 for SQL Server 2008

℡╲_俬逩灬. 提交于 2019-11-26 21:25:13
问题 I have a shared hosting. I was happy with it. I was creating new databases on its panel and then I was managing my databases with SQL Server Management Studio. I could add new table by right clicking the database with designer. Database is: SQL Server 10.0.2531 (SQL Server 2008 SP1 I think) My SSMS details Microsoft SQL Server Management Studio 13.0.15500.91 Microsoft Analysis Services Client Tools 13.0.1605.86 Microsoft Data Access Components (MDAC) 10.0.10586.0 Microsoft MSXML 3.0 6.0

Saving changes after table edit in SQL Server Management Studio

我的梦境 提交于 2019-11-26 21:20:45
If I want to save any changes in a table, previously saved in SQL Server Management Studio (no data in table present) I get an error message: Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created. What can prevent the table to be easily edited? Or, is it the usual way for SQL Server Management Studio to require re-creating table for editing? What is it - this "option Prevent saving

Lost the IntelliSense in SQL Server Management Studio

丶灬走出姿态 提交于 2019-11-26 21:15:57
问题 I am running SQL-2008 R2 Server. Usually when I write a query, I get a full-versed IntelliSense displaying all the objects in my Database. But now when I was onto a task, it showed no IntelliSense. Instead, when I wrote the object names, it showed that object is invalid! However, running the Query gives correct results. I shut-down the Management studio and restarted it. Now all works fine. I wanna know what was actually wrong. Any ideas? 回答1: You probably needed to refresh it. Either Go to