ssms

Update sql bit field in database

纵然是瞬间 提交于 2019-12-07 01:40:36
问题 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. 回答1: 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.

Create a new menu item in SQL Server Management Studio

江枫思渺然 提交于 2019-12-07 01:33:14
问题 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? 回答1: 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

You do not have permission to use the bulk load statement error

岁酱吖の 提交于 2019-12-07 00:40:08
问题 I am trying to insert an image into a VARBINARY(MAX) column. I get this error: You do not have permission to use the bulk load statement. Here is my code: INSERT INTO Stickers (Name, Category, Gender, ImageData) SELECT 'Red Dress', 'Dress', 'F', BulkColumn FROM OPENROWSET(Bulk '\\Mac\Home\Documents\MMImages\reddress.png', SINGLE_BLOB) AS BLOB I realise there are a lot of answers on this topic but none of them have worked for me. This answer would be the easiest one for me to follow, however

SQL Server 2008 management studio drop tables warning?

天涯浪子 提交于 2019-12-06 23:47:24
问题 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. 回答1: 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

Why is my new schema not showing in the table properites pane?

孤人 提交于 2019-12-06 22:49:54
问题 I am using SQL Server 2008 Express and Sql Server Management Studio 2008. I am trying to associate a database table with a new schema. I have created a new Schema by navigating to Security->Schemas in object explorer. I right clicked on the folder and created a new schema called 'People' and set the owner as db_owner. This new Schema now appears in object explorer. I would now like to associate a table with this schema. I open the table in design view and click on the drop down list in the

SQL Server 2008 management studio intellisense auto refresh (not manually through menu or Keyboard shortcut)

拟墨画扇 提交于 2019-12-06 21:39:41
问题 The intellisense feature in SQL server management studio was long overdue (it was difficult especially for those used to Visual studio intellisense) and great to see that it is added in SQL Server 2008, but I think it still lacks in one feature. if I make some changes to the schema or add or drop objects, I will have to refresh the intellisense manually (Edit --> intellisense --> refresh local cache). Is there any way to refresh this automatically (may be through some external add-ins or any

SSMS: When selecting a string in script highlight same literals

六月ゝ 毕业季﹏ 提交于 2019-12-06 18:29:34
问题 In Visual Studio when I select any literal it will highlight all the occurrences of the same literal. Is there a similar functionality in SQL Server Management Studio. Say I have My_Temp_Table in my script. When selecting the literal "My_Temp_Table" I would like SSMS to highlight every instance of the "My_Temp_Table" string in my script. 回答1: No, there's no such feature on SSMS. I tried to look for the same feature as well. CTRL + F is our only good options to look for the same name literals.

System.OutOfMemoryException occurs frequently after Upgrading SQL Server 2016 to version 13.0.15700.28

回眸只為那壹抹淺笑 提交于 2019-12-06 17:25:42
问题 I am running Windows 10 Pro 64 bit on a dev box that has multiple monitors, 16 gigs DDR4 RAM, 4 Ghz I7, GTX 970. I run SQL Management Studio with SQL Server 2016 Developer Edition along with VS 2015 Enterprise Update 3. Yesterday I upgraded Sql Management Studio 2016 to 13.0.15700.28 and it was like a poison pill for my machine. Now after an hour or two it will throw an out of memory except: An error occurred while executing batch. Error message is: Exception of type 'System

Marking persisted computed columns NOT NULL in SQL Server Management Studio

两盒软妹~` 提交于 2019-12-06 17:16:01
问题 It is possible in SQL Server 2005 to create a computed column that is both persisted and is defined as NOT NULL (cannot contain a null value). The 2nd attribute is of importance when using libraries like Linq2Sql if we want to avoid a lot of manual work to assure our code that the column 'always' has a value. With straight SQL this is very simple: ALTER TABLE Sales ADD Total AS (Price + Taxes) PERSISTED NOT NULL When viewed in the design window of SQL Server Management studio this column is

SQL Server Management Studio: prompt for user input

泄露秘密 提交于 2019-12-06 15:06:05
Is it possible in SQL Server Management Studio to ask the user for input and based on that input proceed? I have a stored procedure which inserts some data into tables. When ever a user executes the stored procedure, I want a message to come up asking if he is sure he wants the stored procedure to execute. If the response is Yes, then continue if No then terminate. I recommend writing a small application to handle this. I am not aware of any way to prompt the user for input when running sql. IMO Sql Management studio is not an environment for running scripts that require user input 来源: https:/