ssms

How to group databases in folders in SQL Server Management Studio?

爷,独闯天下 提交于 2019-11-29 06:05:01
问题 My question comest from the frustration that I have every time I launch SSMS. We have few hundred of different databases in one server instance, from different projects and customers, and having them in one long flat tree view just does not feel very ergonomic to me. Is there any smart way to keep them more organized? I thought, that for example being able to group them in custom folders would be a nice solutions, but afaik SSMS does not support it. Being able to group stored procedures in a

Date Range for set of same data

五迷三道 提交于 2019-11-29 05:11:58
I am trying to build a SQL query which will give me the date range for the dates with same prices. If there is a break in the prices, I expect to see it in a new line. Even if sometime during the month there are same prices, if there is change in the prices sometime in between I want to see it as two separate rows with the specific date range. Sample Data: Date Price 1-Jan 3.2 2-Jan 3.2 3-Jan 3.2 4-Jan 3.2 5-Jan 3.2 6-Jan 3.2 7-Jan 3.2 8-Jan 3.2 9-Jan 3.5 10-Jan 3.5 11-Jan 3.5 12-Jan 3.5 13-Jan 3.5 14-Jan 4.2 15-Jan 4.2 16-Jan 4.2 17-Jan 3.2 18-Jan 3.2 19-Jan 3.2 20-Jan 3.2 21-Jan 3.2 22-Jan 3

Update query cancelled by user

故事扮演 提交于 2019-11-29 04:07:06
I have a table that has millions of rows. Accidentally I wrote an update query over a table without where clause and clicked execute. It started executing. After two seconds I realized the query is wrong and I clicked ' Stop ' button in Sql Server Management Studio . The query execution was stopped, this all happened within 7 seconds. Now I am curious to know if there are any rows affected. If any which are they? How to find it? A single update statement will not update some rows. It's all rows or none This is the atomicity in the ACID properties which SQL server respects well. Atomicity

Invalid Object Name sql

北战南征 提交于 2019-11-29 03:45:21
I keep getting an invalid object name error on my sql code. ( member_number, subscriber_policy_number ) is underlined with the error message. The code itself runs fine with no errors, why does this happen? None of the code above this is highlighted update smmdmm.aid_data set Member_Number = Subscriber_Policy_Number where Member_Number in ('000000000','000000001') Make sure you're using the correct database. It may be defaulting to the "Master" database, and it doesn't look like you have the full schema for the referenced table. Ex: [DatabaseName].[Schema].[TableName] or [Database1].[smmdmm].

SQL Server Management Studio 2012 hangs

蓝咒 提交于 2019-11-29 01:49:52
问题 When I click on the "Databases" node in "Object Explorer" it just keeps on "Loading items" until at some point it just hangs. This happens only when connecting to a remote server, not when accessing a database on my PC. It also doesn't happen with any other node. The guys at the web-hosting company didn't have any trouble with it. (But they're running 2008, and so is the SQL server there) I reinstalled the whole SQL server etc. but to no avail. What might be the problem? 回答1: I experienced

How to see progress of running SQL stored procedures?

泪湿孤枕 提交于 2019-11-29 01:18:39
Consider the following stored procedure.. CREATE PROCEDURE SlowCleanUp (@MaxDate DATETIME) AS BEGIN PRINT 'Deleting old data Part 1/3...' DELETE FROM HugeTable1 where SaveDate < @MaxDate PRINT 'Deleting old data Part 2/3...' DELETE FROM HugeTable2 where SaveDate < @MaxDate PRINT 'Deleting old data Part 3/3...' DELETE FROM HugeTable3 where SaveDate < @MaxDate PRINT 'Deleting old data COMPLETED.' END Let's say that each delete statement take a long time to delete, but I like to see the progress of this stored procedure when I'm running it in SQL Management Studio. In other words, I like to see

SQL Server Management Studio 2012 - Export all tables of database as csv

丶灬走出姿态 提交于 2019-11-29 00:10:23
问题 I have a database in SQL Server with a lot of tables and wish to export all tables in csv format. From a very similar question asked previously - Export from SQL Server 2012 to .CSV through Management Studio Right click on your database in management studio and choose Tasks -> Export Data... Follow a wizard, and in destination part choose 'Flat File Destination'. Type your file name and choose your options. What I want is the capability to export all tables at once. The SQL Server Import and

SSMS 2016 Error Importing Azure SQL v12 bacpac: master keys without password not supported

白昼怎懂夜的黑 提交于 2019-11-28 23:49:48
问题 I have done this dozens of times but just recently ran into this error. Here are the steps I have gone through to get here: Create a copy of my Azure SQL v12 database on the same server as the original Export the copy-version (completely inactive from user interaction) to blob storage Download the .bacpac file from blob storage to my local drive In SSMS (October 2016 release) my local sql server instance, right click Databases and choose 'Import Data Tier Application' Choose my recently

How do I generate CRUD stored procedures from a table in SQL Server Management Studio

故事扮演 提交于 2019-11-28 23:31:51
How do I take a table, and auto-gen CRUD stored procs for it in SSMS? SSMS doesn't have the capability to generate CRUD procedures. You can generate INSERT, UPDATE statements etc. by right-clicking, Script Table As > but I think you will have better luck with Mladen Prajdic's SSMS Tools Pack . If you are using Visual Studio you can do it: http://weblogs.asp.net/stevewellens/archive/2009/12/11/automatically-generate-stored-procedures-with-visual-studio.aspx I have a simple TSQL script I use to do mine. It's basic but easily modified to suit your needs. It generates TSQL for an Upsert, Select,

XML Output is Truncated in SQL

蹲街弑〆低调 提交于 2019-11-28 23:08:10
I need to return my result set in XML and this works fine, but if the number of records are increased, my xml output is truncated here is my query select t.id,t.name,t.address from test FOR XML AUTO, ROOT('Response'), ELEMENTS However I have set some option to increase the output result set like.. Tools --> Options --> Query Results --> SQL Server --> Results to Text --> Maximum number of characters displayed in each column Tools --> Options --> Results --> Maximum characters per column but still I am unable to get my desired result. please suggest my solution EDIT: However when I click on the