sql-server-2012

How check that how many stored procedure will affect after deleting one table in SQL [duplicate]

感情迁移 提交于 2019-12-08 00:57:21
问题 This question already has answers here : Find all references to an object in an SQL Server database (10 answers) Closed 4 years ago . I am using SQL 2012. I have large Database Structure in my project. I have around 10000 Stored Procedure in my Database. I have to delete one table from the database, Is there any way that I can directly check that by deleteting my table how many stored procedure will affect. Any help Will Be appriciated. 回答1: Using sp_depends: EXEC sp_depends @objname = N

How can I create backup script from diagram in SQL Server?

不想你离开。 提交于 2019-12-07 23:23:36
问题 I use SQL Server 2012 and SQL Server 2008 R2. I create a script from all object (tables / trigger / stored procedure / function ...) in my database. I generated this script from SQL Server Management Studio. I can recreate my database with this scrips on the other server. But I miss all diagrams of my database after run my script for create another database. Therefore, I need create backup script from all diagrams that exist in my database. I need execute this script on the destination

TSQL Sum by group for monthly reports

僤鯓⒐⒋嵵緔 提交于 2019-12-07 23:17:13
问题 I'm in the process of trying to produce a report (monthly, year to date, etc) on a group of shipping entries in our database to show correct sums as well as group them by shipping company. How can I accomplish taking all this information and produce proper reports? One thing to note is that all of the entries in this table are nvarchar(max) due to text importing with odd characters from various sources. The master database list looks something like this: table - shipping_info shipping_company

Searching Multiple Columns with Multiple Values SQL

人走茶凉 提交于 2019-12-07 22:53:35
问题 I know it is posible to serach multiple columns with one value. I would like to serach 3-4 columns for 4 maybe 5 values I want to check if any of my choosen columns have a certain value in them. Example Column 1 | Column 2 | Column 3 | Column 4 | | | Hello | | | = True | | | | Goodbye | | = True | | Hello | Goodbye = True | | | | Hello | | = True | | | | | Goodbye | = True In the example I would like SQL to pull the data from all of the lines that have Hello or Goodbye even both in some cases

Entity Framework 5.0 and FileTable

时光毁灭记忆、已成空白 提交于 2019-12-07 22:34:58
问题 So say I have the following tables in my SQL Server 2012 DB: Person PersonId FirstName LastName Photo PhotoId PersonId (fk) DateTaken PhotoFileTable (all the FileTable columns) And the photos stored on disk are structured like this: \\myserver\filestreamshare\People\PersonId\Photo1.tif And very important: There are a TON of photos ALREADY on disk that need to be added to the database- that's why I thought a FileTable would be cool as it automatically picks them up. So I need to do 2 things-

How to find rows by filtering a specific text using Full text search in MS SQL 2012

倾然丶 夕夏残阳落幕 提交于 2019-12-07 21:42:48
问题 I have a requirements to find rows by filtering a specific text using Full Text Search in MS SQL. The first requirement is to find rows by searching the text within the xml column, and the second requirement, is to find rows by searching the text within the json column(nvarchar data type). The following conditions should return a result. XML Column Criteria 1. Where Contains(XMLData,"1") Criteria 2. Where Contains(XMLData,"/1/") Criteria 3. Where Contains(XMLData,"<field>1</field>") JSONDATA

Mixed queries against full-text index

為{幸葍}努か 提交于 2019-12-07 18:23:18
问题 I am using SQL Server 2012. A table has a text and a date column. The text column has a full-text index. The query issues CONTAINS against the full-text column but it also needs to include a greater-than condition on the date column. I am concerned about performance of SQL Server merging results from b-tree and full-text indices. In Oracle, the performance aspect of this scenario is addressed by including "normal" columns (that are not subject to full-text search) into a full-text index

SQL 2012 bug for the ACOS function

空扰寡人 提交于 2019-12-07 18:06:43
问题 I run into this bug in SQL Server 2012 ACOS function: declare @lat1 decimal(12,10), @lon1 decimal(12,10), @lat2 decimal(12,10), @lon2 decimal(12,10) declare @dist float select @lat1=51.1790825000, @lon1= 4.1590020000, @lat2= 51.1790825000, @lon2= 4.1590020000 set @dist = SIN(RADIANS(@lat1)) * SIN(RADIANS(@lat2)) + COS(RADIANS(@lat1)) * COS(RADIANS(@lat2)) * COS(RADIANS(@lon1 - @lon2)) print @dist print ACOS(1) print ACOS(@dist) The last print function gives an "An invalid floating point

How to insert record into a sql server express database table?

六眼飞鱼酱① 提交于 2019-12-07 17:09:06
问题 I'm trying to insert a textbox value to a database table called site_list . The site_list table contains two columns id and site_name , id set to auto increment This is the code I'm trying and when it execute there is no error, but the data is not showing up in the table SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Data Source=.\\SQLExpress;" + "User Instance=true;" + "Integrated Security=true;" + "AttachDbFilename=|DataDirectory|scraper_db.mdf;"; SqlCommand addSite =

Can databases with different collations get along on one server?

醉酒当歌 提交于 2019-12-07 15:17:14
问题 So I have two SQL Servers at the moment, both 2012 and both running separate systems. One of these servers runs on a collation of latin1_general_bin and the other runs with latin1_general_ci_as , ideally I'd like to shut one of these servers off and move all the systems to one place. I know this can be done technically, however I was wondering if this was a good idea? Will I be causing myself more problems down the line? Both databases are transactional based and are defined by external