sql-server-2014

Using SQLBulkCopy - Significantly larger tables in SQL Server 2016 than in SQL Server 2014

*爱你&永不变心* 提交于 2019-12-22 18:24:57
问题 I have an application that uses SqlBulkCopy to move data into a set of tables. It has transpired recently that users that are using SQL2016 are reporting problems with their harddrives being filled with very large databases (that should not be that large). This problem does not occur in SQL2014. Upon inspection it appears that running TableDataSizes.sql (script attached) showed large amounts of space in UnusedSpaceKB. I would like to know if a) There is some bug in SQLServer 2016 or if our

Installing SQL Server 2014 Express package as ClickOnce prerequisite

倾然丶 夕夏残阳落幕 提交于 2019-12-22 11:37:34
问题 I'm using clickOnce and deploying an installer with it. I have tried various settings. Using SQL Server 2008 Express and SQL Server 2012 Express as prerequisite is all ok (I've dowloaded them and set the option of clickonce "download prerequisites from the same path of app"). Now I'm trying to do the same thing with SQL Server 2014 Express. Since the SQL Server 2014 Express package isn't alredy done line 2008 and 2012 versiones, I'm trying to create it. I have done and it seems to work, but

SQL Server Integration Services are missing in SQL Server 2014 installation

a 夏天 提交于 2019-12-22 10:38:20
问题 I am trying to install SQL Server 2014 with Integration Services. Here is the download link I used to download with tools. File Name : SQLEXPRWT_x64_ENU But when I proceed to feature selection Integration Services is missing ? What am i doing wrong ? Any help would be great. Update For future readers, Actually Integration Services is not available on sql azure as said by @Nick.McDermaid , and i was trying to export sql query results to excel. I have to try some other options for sql azure.

SQL Server: change first day of week to Sunday using DATEPART with ISOWK parameter

筅森魡賤 提交于 2019-12-22 09:48:14
问题 I need to get week numbers for some set of dates. For example, for Jan 2016 it should be something like: [Week Number] 53 <--- for dates from Jan 1 to Jan 2 1 <--- for dates from Jan 3 to Jan 9 2 <--- for dates from Jan 10 to Jan 16 ... <--- etc. As you see, week should start from Sunday. I've used following function to set start day: SET DATEFIRST 7 And this one to get week number: DATEPART(ISOWK, SOME_DATE) But I've noticed that DATEFIRST doesn't affect results when ISOWK being used - week

Can I make SQL Server FORMAT deterministic?

六眼飞鱼酱① 提交于 2019-12-22 09:47:51
问题 I want to make a UDF which returns an integer form of YYYYMM so that I can easily partition some things on month. I am trying to assign this function to the value of a PERSISTED computed column. I currently have the following, which works fine: CREATE FUNCTION dbo.GetYearMonth(@pDate DATETIME2) RETURNS INT WITH SCHEMABINDING AS BEGIN DECLARE @fYear VARCHAR(4) = RIGHT('0000' + CAST(YEAR(@pDate) AS VARCHAR),4) DECLARE @fMonth VARCHAR(2) = RIGHT('00' + CAST(MONTH(@pDate) AS VARCHAR),2) RETURN

SQL Server 2014 execution plan creation takes a long time (fast in older versions)

别等时光非礼了梦想. 提交于 2019-12-21 17:47:49
问题 I've encountered a problem with a query in SQL Server 2014. The first time this query is run, it takes ages for the execution plan to be generated. The strange thing is that it has worked just fine in all previous versions of SQL Server (2012, 2008 R2, 2008, etc.). It seems to be related to a unique index on one of the involved tables, combined with a certain amount of subqueries in the main query. Here are the involved tables in the query. I've simplified the tables a lot compared to the

Sql Server 2014 - Update to windows 10 and can't connect to the Local Server

允我心安 提交于 2019-12-21 03:31:26
问题 Recently I updated my Windows from 8 to 10 and suddenly my SQL Server 2014 stopped working. When I open the Management Studio and try to connect to the Server (local) i obtain the following error: Does any of you had similar problems? Before updating the Windows everything was running just fine. 回答1: I had the same problem after upgrading from Windows 8.1 Pro to Windows 10 Pro. I was able to resolve it as follow: Control Panel Administrative Tools Services The SQL Service Browser was Disabled

New cardinality estimator (SQL Server 2014) is way off

二次信任 提交于 2019-12-20 11:35:31
问题 I have a data warehouse database and I'm facing problems with the new cardinality estimator of SQL Server 2014. After upgrading the database server to SQL Server 2014 I have observed a big difference in query performance. Some queries are executing much slower (30 sec in SQL 2012 vs. 5 minutes in SQL 2014). After researching execution plans I've seen that the cardinality estimates on the SQL Server 2014 are way off and I can't find a reason for it. Here's an example of a query execution plan

Running Multiplication in T-SQL

大城市里の小女人 提交于 2019-12-20 10:10:32
问题 GTS Table CCP months QUART YEARS GTS ---- ------ ----- ----- --- CCP1 1 1 2015 5 CCP1 2 1 2015 6 CCP1 3 1 2015 7 CCP1 4 2 2015 4 CCP1 5 2 2015 2 CCP1 6 2 2015 2 CCP1 7 3 2015 3 CCP1 8 3 2015 2 CCP1 9 3 2015 1 CCP1 10 4 2015 2 CCP1 11 4 2015 3 CCP1 12 4 2015 4 CCP1 1 1 2016 8 CCP1 2 1 2016 1 CCP1 3 1 2016 3 Baseline table CCP BASELINE YEARS QUART ---- -------- ----- ----- CCP1 5 2015 1 Expected result CCP months QUART YEARS GTS result ---- ------ ----- ----- --- ------ CCP1 1 1 2015 5 25 -- 5

dynamic item counter from SQLServer 2014 in web form for Visual Studio 2015?

对着背影说爱祢 提交于 2019-12-20 05:15:41
问题 I'm new to this type of programming (management figures programming is programming... ugh), apologies in advance if my question seems convoluted or basic. I'm creating a Windows Form App in Visual Studio 2015. I have it communicating and sharing with our SQL Server perfectly for every function but one. I'd like to place a "live" counter on the form, that updates a value every 3(or something) seconds. The counter's job would be to keep track of inventory being shipped out of our warehouse