ssms

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

戏子无情 提交于 2019-11-28 08:10:51
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, @imonth int, @iddepartment int as declare @columnName Nvarchar(max) = '' declare @sql Nvarchar(max) =''

Schema changes not updating in Intellisense in SQL 2008 (SSMS)

帅比萌擦擦* 提交于 2019-11-28 06:58:48
问题 I've notice an issue - it feels like a bug but I suspect a 'feature' - in SSMS in SQL Server 2008. I have various tabs open, for example an alter table script in one table and a SProc that queries that table in another tab, and when I execute my Alter Table script the changes are not reflected in Intellisense in the other tab. I can create new queries and the changes are still not reflected in Intellisense. If I open a new SSMS instance, the changes are reflected, until I make further changes

How do I grant read access for a user to a database in SQL Server?

大憨熊 提交于 2019-11-28 06:46:58
I want to grant access to a user to a specific database with read and write access. The user is already available in the domain but not in the DB. So, how can I give them that access with creating a new user and password? Someone told me that it can be done with only specifying the user, domain & the DB that you want to give the user the access to without needing to create a new user and password. This is the old way that I was implementing. It works but it creates a new login and user rather than using the one that is available in the domain: use DBName; create login a_2 with password='Aa123'

The request failed or the service did not respond in a timely fashion?

被刻印的时光 ゝ 提交于 2019-11-28 05:45:05
I have the following error while I connect to SQL Server 2008 Management Studio with Windows authentication. "The request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details." Is anybody tell me why i am getting this error, whereas my SQL Server is running under network service built in a/c???? I googled it but not getting solution.. Thanks Abhisek Above mentioned issue happened in my local system. Check in sql server configuration manager. Step 1: SQL server Network configuration step 2: Protocols for local server name

How to export all data from table to an insertable sql format?

我怕爱的太早我们不能终老 提交于 2019-11-28 02:42:03
I have a Table (call it A_table ) in a database (call it A_db ) in Microsoft SQL Server Management Studio, and there are 10 rows. I have another database (call it B_db ), and it has a Table (call it B_table ), which has the same column settings as A_table has. But the B_table is empty. What I want: Copy every rows from A_table to B_table . Is there any option in Microsoft SQL Server Management Studio 2012 , to create an insert SQL from a table? Or is there any other option to do that? Quick and Easy way: Right click database Point to tasks In SSMS 2017 you need to ignore step 2 - the generate

SQL Server Management Studio, how to get execution time down to milliseconds

与世无争的帅哥 提交于 2019-11-28 02:39:10
When I submit a batch (e.g., perform a query) in SSMS, I see the time it took to execute in the status bar. Is it possible to configure SSMS to show the query time with millisecond resolution? Here is the bar I am talking about with the section of interest circled in red: Ymagine First I was struggling with that until i found this... http://blog.sqlauthority.com/2009/10/01/sql-server-sql-server-management-studio-and-client-statistics/ Also, if you open the Properties window you may find some magical "Connection elapsed time" that may give you some execution time... Hope it helps... What you

Recover unsaved SQL query scripts

眉间皱痕 提交于 2019-11-28 02:32:38
How to recover the unsaved scripts if the SSMS crashes / unsaved tab gets accidentally closed? Posting this in case if somebody stumbles into same problem. Googled for Retrieve unsaved Scripts and found a solution. Run the following select script. It provides a list of scripts and its time of execution in the last 24 hours. This will be helpful to retrieve the scripts, if we close our query window in SQL Server management studio without saving the script. It works for all executed scripts not only a view or procedure. Use <database> SELECT execquery.last_execution_time AS [Date Time], execsql

SQL Server Error - HRESULT E_FAIL has been returned from a call to a COM component

耗尽温柔 提交于 2019-11-28 02:15:59
问题 I have a huge 200MB .SQL file. When I try to open this in SQL server management studio 2008, I get the error -Error HRESULT E_FAIL has been returned from a call to a COM component. What could the reason be and how to fix it ? Is this caused due to big files ? It does not happen when I open a 2-3 KB file. 回答1: please use sqlcmd -S .\MYSQLSERVER2008 -U MyUsername -P MyPassword -i C:\Database\script.sql http://technet.microsoft.com/en-us/library/ms180944.aspx 来源: https://stackoverflow.com

Incorrect syntax near ''

痞子三分冷 提交于 2019-11-28 00:38:16
I'm trying to run the following fairly simple query in SQL Server Management Studio: SELECT TOP 1000 * FROM master.sys.procedures as procs left join master.sys.parameters as params on procs.object_id = params.object_id This seems totally correct, but I keep getting the following error: Msg 102, Level 15, State 1, Line 6 Incorrect syntax near ''. It works if I take out the join and only do a simple select: SELECT TOP 1000 * FROM master.sys.procedures as procs But I need the join to work. I don't even have the string '' in this query, so I can't figure out what it doesn't like. Panagiotis

How to determine the datatypes of the results of a SQL?

让人想犯罪 __ 提交于 2019-11-28 00:13:19
问题 We have a SQL query that pulls a large number of fields from many tables/views from a database. We need to put a spec together for integration with a 3rd party, what is the quickest way to compile the data types of the result set? Clarifications: There are 25+ tables/views involved, so functions at the table level will still be cumbersome. All work is currently being done in Microsoft SQL Server Management Studio. 回答1: You can run the query with SET FMTONLY ON, but that might not help you to