ssms

T-SQL Insert into table without having to specify every column

断了今生、忘了曾经 提交于 2019-12-05 09:27:21
问题 In our db there is a table that has a little over 80 columns. It has a primary key and Identity insert is turned on. I'm looking for a way to insert into this table every column EXCEPT the primary key column from an identical table in a different DB. Is this possible? 回答1: You can do this quite easily actually: -- Select everything into temp table Select * Into #tmpBigTable From [YourBigTable] -- Drop the Primary Key Column from the temp table Alter Table #tmpBigTable Drop Column

Generate changes script

不羁的心 提交于 2019-12-05 09:19:35
Let's imagine I added new column for some table in SQL Server Management Studio. Is there any way to get change script which is executed when I press save? What I want to achieve is to apply the same change to other databases (we have a separate database for each developer for debuggin purposes). I assume you are using table designer in MS SSMS. Do the changes in the designer and just before hitting Save , go to the Table Designer menu and select Generate Change Script... . 来源: https://stackoverflow.com/questions/6247556/generate-changes-script

How to get “admin rights” in SQL Server Management Studio?

梦想的初衷 提交于 2019-12-05 09:13:21
I'm using SQL Management Studio 2008 Express as a graphic interface to my local SQL Server 2008 Express instance, both of which I have locally only as a test and developement interface for my web projects. I have recently grown more confident in SQL coding, and started to use some more complicated sql stuff - my latest field of exploration being triggers. However, to my great surprise I don't seem to have admin rights on my server instance, which means I can't do simple things like debugging or changing access rights. When I try to start debugging I get a permission denied message, and I have

Mac alternative to SQL server management studio? [closed]

百般思念 提交于 2019-12-05 08:49:53
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am on Windows so SQL server management studio works fine for me. However, my application is hosted and my client needs to make some entries in DB and he has Mac. How can we get over this issue? Is there any MAC option for SSMS? Thanks! 回答1: DbVisualizer is OS independent using java. http://www.dbvis.com

How do I find {min,max} repeats with regular expression patterns in Visual Studio or SSMS “Find and Replace”?

放肆的年华 提交于 2019-12-05 08:08:38
I knew that we have something like this in the regular expression syntax world. *The syntax is {min,max}, where min is a positive integer number indicating the minimum number of matches, and max is an integer equal to or greater than min indicating the maximum number of matches. So {0,} is the same as * , and {1,} is the same as +* . http://www.regular-expressions.info/repeat.html But how can I use it in SQL Server Management Studio or Visual Studio's "Find and Replace" window. I only find related Microsoft syntax in MSDN . Like: [0-9]^4 matches any 4-digit sequence. Tim Pietzcker The Visual

Group tables by schema in SSMS

拟墨画扇 提交于 2019-12-05 07:40:30
In Visual Studio's Server Explorer window there's a very nice feature that lets you see the DB objects grouped by schema: It turns this object tree: Data Connections -> MyServer -> Tables -> MyTable ( MySchema ) Into this one: Data Connections -> MyServer -> Schemas -> MySchema -> MyTable I've been looking for this particular feature in SSMS but was unable to find it. Does it exist? If not, is there a plugin which would provide this feature? Or perhaps is there a plugin which would help ease navigation in DBs which have lots of objects? Please note I'm aware of SSMS object filters. It's better

SQL Server Management Studio: Open table for Editing through keyboard shortcut

醉酒当歌 提交于 2019-12-05 05:40:21
While using SQL Server Management Studio (2008), is it possible to open a table in Edit mode through keyboard shortcut or even some special keyword I type while in "New Query" window? No this can't be done. You can open a table by right clicking on the table you want to edit and selecting "edit all rows" - before doing this make sure your options are set tools/options/ Sql server object explorer/commands. Dont know if that helps but maybe. 来源: https://stackoverflow.com/questions/2764587/sql-server-management-studio-open-table-for-editing-through-keyboard-shortcut

Update sql bit field in database

岁酱吖の 提交于 2019-12-05 05:40:11
In a sql table I have a bit field and the value is displayed as True, when I update in code Update table1 set Active='True' it makes the update but the value is now displayed as 1 instead of True . How do I make it put the value 'True' instead of the integer in the table? Thanks. Bits in SQL Server are always stored as 1 or 0 in a bitmap. The "Edit Table" option in SSMS just translates this to True or False for presentation purposes, this is nothing to do with how it is actually stored. 来源: https://stackoverflow.com/questions/6879999/update-sql-bit-field-in-database

SQL Server 2008 management studio drop tables warning?

家住魔仙堡 提交于 2019-12-05 05:26:03
Why does SQL server 2008 always warn about needing to drop tables to rename columns? I was under impression this was not required unless it was a key. If I change a column from null to not null even if is not a key field it wants to drop table and all relations. If you're editing the table in the designer then it's the designer that is being pedantic. Try changing (unchecking) these options: Tools > Designers > Prevent saving changes that require table re-creation The designer still throws an warning dialog after unchecking that but there is also this option to uncheck: Tools > Designers >

Create a new menu item in SQL Server Management Studio

≡放荡痞女 提交于 2019-12-05 04:55:58
Is it possible to create a new menu item in SQL Server 2008 Management Studio? For example when you right-click the a database a list of options appears (New Database, New Query ... ). Is it possible to add a new item in that list and implement some C# functionality when clicking that button? From MSDN . Adding a New Item to the Menu To add a new item to the menu On the Tools menu, click Options. In the Customize dialog box, on the Commands tab, click New Menu. On the Commands box, drag New Menu to the menu bar and drop it where you want the new menu to appear. On the menu, right-click New