ssms

Sql Exception: No Process Is on the Other End of the Pipe

徘徊边缘 提交于 2019-12-05 17:13:44
问题 I can not access my sql server connection from c# code. I get this error: Sql Exception: No Process Is on the Other End of the Pipe thats the connection string in my app.config: <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=BELLA\SQLEXPRESS;Initial Catalog=TLP;User Id=pascal;Password=test;Pooling=False"/> When I use windows authentication: Integrated Security=True; Then I can connect to the database. BUT I can NOT use windows authentication

Can't add System.IO.Compression to trusted assemblies in SQL Server

♀尐吖头ヾ 提交于 2019-12-05 15:07:00
I am trying to create a SQLCLR stored procedure in NET 4.5 that fiddles with ZIP files. Obviously System.IO.Compression is not on SQL Server's approved list but this is what I get when I try to add it manually via SQL Server Management Studio. The same happens if I try to execute CREATE ASSEMBLY via a query. Any ideas? Why is this a no-no? I have also tried running this command in SSMS: CREATE ASSEMBLY SystemIOCOMPRESSION FROM 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.IO.Compression.dll' WITH PERMISSION_SET = EXTERNAL_ACCESS ... and the result

How to edit SSMS Script Table As templates?

痴心易碎 提交于 2019-12-05 13:48:13
In the context menu of a table in SQL Server Management Studio there are several items under the common item Script Table as : SELECT to INSERT to UPDATE to DELETE to .. and the same for all objects, e.g. stored procedures, functions, etc. How can I edit the templates used by that menus? You cannot edit the templates used by SQL Server Management Studio (which would be a nice feature). You can create your own (parameterised templates) in C:\Users\Username\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell\Templates\Sql (for SQL Server 2008) What do you want to do with this? Have

Stop SSMS from scripting SPs using sp_executesql?

不打扰是莪最后的温柔 提交于 2019-12-05 13:28:43
问题 When I use SSMS to script a stored procedure, it wraps the script in a sp_executesql statement which bugs me. Is there a way to stop SSMS from doing this and use a straight CREATE PROCEDURE...? EDIT : I meant SSMS not SSIS 回答1: Turn off the "Include IF NOT EXISTS" option. It's at Tools..Options, then click "Scripting" on the explorer pane of the dialog that pops-up. the "IF NOT EXISTS" option is in the second group from the top (Object Scripting options). 回答2: Execute SQL Task Editor (General

Copying a large field (varbinary(max)) to file / clipboard

一个人想着一个人 提交于 2019-12-05 12:52:10
问题 I have a VARBINARY(MAX) field in a database table which contains ~35k characters. This field is a converted word document which unfortunately no longer have access to. This field is present in my dev database and I'm looking to port this value to a live database. However, if I purely select the contents out of the grid results in SQL I seem only to get ~28k of the available characters. So my question is this, what's the best way to migrate a field which has contents too large to simple copy

Convert GUID to varchar(32)

孤街醉人 提交于 2019-12-05 12:37:17
问题 How can I convert a GUID which is 36 characters to a VARCHAR(32)? I'm trying to copy data from one table to another. There are two similar columns from these two tables. Table1.colx is a GUID so it is 36 characters in length in total due to the hyphens The corresponding column is table2.colx but it is a VARCHAR(32) I am looking for a way to convert a GUID to VARCHAR, but I've got to remove the hyphens. So far I have been unsuccessful in my attempts to find a way to do this. 回答1: I assume this

How to Stop SSMS 2012 from scripting SPs using sp_executesql

三世轮回 提交于 2019-12-05 12:25:54
问题 I realise this is a very similar question to Stop SSMS from scripting SPs using sp_executesql? However, they seem to have changed the behaviour with SSMS 2012. If you have the 'Check for existence' option selected, as in: ... it now generates an IF NOT EXISTS for the proc about to be created, as well as an IF EXISTS for the previous drop proc, if, as I usually do, I select the DROP and CREATE option: This forces it to script the CREATE using sp_executesql. It's pointless, since you don't need

What is the purpose of .edmx files?

不羁的心 提交于 2019-12-05 11:57:35
问题 What is the purpose of .edmx files? Reading the CSDL, SSDL, and MSL specifications, it looks to me like .edmx files are used only at design time. Are we meant to distribute it with the other edmx? It seems like we need to distribute the .ssdl and/or .csdl files instead. 回答1: EDMX is Visual Studio's "container" for all things about your Entity Data Model. It contains all the information that is in the CSDL, SSDL, MSL, plus information about the visual layout of the tables in your Visual Studio

How to set default value while insert null value into not null column SQL Server?

给你一囗甜甜゛ 提交于 2019-12-05 11:45:58
I have two tables t1 and t2 . Both have id and name columns. The name column of t1 is defined as not null and it has the default value of 'Peter'. I want to insert all the values from t2 into my t1 table. But I have some null values in t2 table. When I try to insert the values: Insert into t1 select * from t2; It throws this error: Msg 515, Level 16, State 2, Line 1 Cannot insert the value NULL into column 'Name', table 'T1'; column does not allow nulls. Is there any possibilities to set the default value to the column when we try to insert the null value. First Solution, insert into t1 select

In SSMS, how do I change a SQL query window's tab name?

霸气de小男生 提交于 2019-12-05 10:17:21
问题 I want to know how to change the tab name of a SQL query window: Instead of SQLQuery8.sql…Registry(sa(51)) , I would like to have a custom caption. If the query window has a very title, I can only open 3 windows at a time. I want to open more than 10 windows. So I need to change the query window's name to something very short, something like Q1 , Q2 , etc. How can I change this? 回答1: In SSMS, go to Tools > Options > Text Editor > Editor Tab and Status Bar . You can manage some options of tab