Tag: ssms

SQL Server 2008R2: Show top 1000 records in DESCENDING order

Is there an option to set for SQLServer 2008R2 that all tables which I open Show the top 1000 records in descending order not in ascending order? Normally I Need to see the latest records. Thanks Michael

SQL Bulk Insert skipping last 849 Lines from Text File

Good day all! For some reason my bulk Insert statement is skipping the last 849 lines from the text file I am reading. I know this because when I manually add my own last line I don’t see it in the table after the insert is done and when debugging I see the message: (133758 […]

SQL Server is timing out on queries, but toggling settings on the database temporarily fixes the issue

In my ASP.NET MVC web app, we are using Entity Framework to connect to a SQL Server database. We have noticed that some queries are timing out, but going into SSMS and changing Auto Shrink Off fixes the issue. After a few minutes, the queries start timing out again. Going back into SSMS and toggling […]

Using recursive sql query not for parent-child

I’m not new in sql and t-sql, but at past I’ve never used recursive query – all problems were solved with WHILE or CURSOR. I just got 1 question – how to organaze recursion query for following problem: I want to manipulate with last row of data in certain partition. Can’t understand how to stop […]

Azure SQL database unavaliable on management portal, but working

I created a db on my server on azure, and it works well, and can be managed with sql server management studio, and the related website also works well, but on the management portal, the database is unavaliable. It appears on the list of databases under the server. I deployed the database from my local […]

Management Studio 2014 doesn't like my Surface Book

It’ll install and run but dialogue boxes get all crazy and distorted as to be unusable. I’m told it’s due to my high definition screen. Any ideas how to fix this?

Cannot connect to my Azure SQL database

I have been using Azure SQL database for the past six month, and it works very well. But today, I cannot connect to it from Microsoft SQL Server Management Studio. I got this error: I checked my Azure account, the database is still alive: Sometimes I get this problem and after 5-10 minutes it is […]

“Column name or number of supplied values does not match table definition” error only when include actual execution plan is set

I have a stored procedure that runs fine in DEV, TEST, and PROD environments. However, only when the include actual execution plan option in SSMS is set and only in PROD, it fails with this error message: Msg 213, Level 16, State 7, Line 1 Column name or number of supplied values does not match […]

How to see the history of executed scripts and their execution time and counts in sql server?

I want to find the execution time and execution count of the script ran in my sql server. I have added, for example, /* searchThisString */ on every executed script. And then I use the following code to find them out. SELECT dest.text, deqs.last_execution_time, deqs.execution_count FROM sys.dm_exec_query_stats AS deqs CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest WHERE […]

SQL Server 2016 Management Studio – Picking wrong source for Generate Scripts

This is a new one for me. I need to generate scripts for a database, and no matter what I do, it always defaults to my local instance of SQL Server, not the one I am actually clicking on / connected to in Management Studio. And I see no way to change it. Here’s an […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.