Questions tagged [sql-server-2016]

SQL Server 2016 (major build version 13.00.xxxx). Please also tag sql-server.

Filter by
Sorted by
Tagged with
-2
votes
2answers
391 views

Size of an empty database too large

Related to SQL Server 2016. I have a database with five empty tables, let's say db1. I have another database with almost 100 tables and with a data in it, db2. I observed that the size of db1 ...
-2
votes
1answer
665 views

Is there any Performance Issue joining Row based Table to Clustered Columnstore Index Table [closed]

Is there any Performance Degradation joining Row based Table to Clustered Columnstore Index Table? Does SQL Server have any guidance for or against this? We have a table that is 2 million rows, and ...
-2
votes
1answer
401 views

Working with NULL Date Fields [closed]

I have a derived VARCHAR date field that I need to use for deriving another field, based off of whether or not the date field has a value. The derived date field is called "AmortDate" and I'm ...
-2
votes
1answer
67 views

How to optimize below update query in SQL Server

I have the below update query, its taking around 3 minutes to execute, I have around 1.5 million records present in "Data" table and 100000 records present in "Report" table, can someone help me in ...
-2
votes
1answer
2k views

how to resolve The data types nvarchar(max) and uniqueidentifier are incompatible in the add operator

how to resolve The data types nvarchar(max) and uniqueidentifier are incompatible in the add operator.
-2
votes
1answer
331 views

Signing a User-Defined Function with a certificate in SQL Server

I'm trying to use a certificate to sign a user-defined function in SQL server (2016). My code is as follows: CREATE FUNCTION myfunction() RETURNS TABLE AS RETURN SELECT col1, col2 FROM ...
-2
votes
1answer
53 views

Multiple condition case when query

Edit: I figured out the code. I decided to go a totaly different way with it. IF the software is comptible I make the background green, if not compatible I made the background red. Here is a sample ...
-2
votes
1answer
325 views

Database Backup to URL fails with Device I/O Error [closed]

I'm using Ola's Maintenance Solution to backup my databases to a URL. Most of my databases backup just fine but I have one 2 TB database that continues to fail with a device I/O error. Has anyone ...
-2
votes
1answer
2k views

SQL Order by particular letters [closed]

@BarId AS INTEGER AS BEGIN SET NOCOUNT ON BEGIN SELECT [BarDetailId] ,[BarId] ,[Member] ,[MemberNo] ,[BarMark] ,[TypeSize] ,[BarLength] ,[BarNo] ,[BarTotal] ,[ShapeCode] ,[...
-2
votes
1answer
59 views

Is Buffer Pool Extension (BPE) needed if my database is already on SSD?

Here is my simplified scenario, let's say I have one (and only one) database of 500GB on SQL Server 2016 EE, this database is on SSD drives already (both data and log files), and my server has 64GB ...
-2
votes
1answer
24 views

Have a Start Date and End Date, want to add all dates except Weekend Dates

So I have a Stored Procedure I am working on that has a User input a Start Date and End Date. I want to be able to insert all dates into a Table except for Weekend Dates. It will add the records to ...
-2
votes
1answer
802 views

Can I use log shipping between different editions of SQL Server 2016?

Will log shipping work between different editions? Primary is SQL Server 2016 SE and Secondary is SQL Server 2016 EE. If not, how else can I set up high availability for this combination of servers?
-2
votes
1answer
197 views

Why do i need ILB for a Azure SQL AlwaysOn setup in a Vnet

We are trying to setup SQL server alwayson for an application, but as per the documentation we need the ILB to map the listener. Just want to understand why do i need the ILB in the VNet if there is ...
-3
votes
2answers
396 views

Why does IO Statistics show a lot of LOB Logical Reads on the Worktable when none of the tables in my query use any LOB datatype fields?

I have a procedure that runs a query dynamically across a few hundred databases that all have the same exact schema and aggregates the results to a temp table. The query only involves 3 tables (each ...
-3
votes
2answers
308 views

Get the summary from more than two tables (stock movement report)

I have a 2 tables, 1- Inward Table CREATE TABLE Inward ( GoodsInwardId BIGINT DEFAULT NEXT VALUE FOR SEQ_GoodsInwardId NOT NULL UNIQUE, GoodsInwardDate DATE NOT NULL, InventoryId BIGINT ...
-3
votes
2answers
89 views

Did SQL Server delete rows by itself? [closed]

It is possible for SQL Server to auto delete certain rows from a table? I believe it's happened to me twice. Already checked for stored procedures and DELETE FROM... queries in my code. I have my ...
-3
votes
1answer
303 views

PRODUCTION DATABASE RUNNING OUT OF SPACE [closed]

My database has 9556.97MB of space left. I do have about 2TB free disk space. The database is in full recovery mode and doing full backup everyday, also TLOG backup every 24 minutes. I used to just ...
-3
votes
1answer
754 views

Script to setup MAXDOP [duplicate]

I need to script toi set MAXDOP. ----I have this script---- select cpu_count, case when cpu_count/hyperthread_ratio >8 then 8 else cpu_count/hyperthread_ratio end as optimal_maxdop_setting from ...
-3
votes
1answer
43 views

Expose SQL server externally [closed]

I currently have a sql server database and I want to be able to expose this over the internet so that someone external to my network can access the tables/data. How best can I achieve this and what ...
-3
votes
1answer
68 views

SQL Server 2012/2016 Limitations and Alternatives [closed]

I'm working on a project right now, which I need to ask about limitations of SQL Server. There is an expectancy that we could have some tables with a serious amount of rows, perhaps close to a billion ...
-3
votes
1answer
29 views

Reformatting Date with Pivot or Unpivot [closed]

I'm struggling trying to covert the format of a table with the following fields: Customer|Fiscal Year| September Amount| October Amount|November Amount|... to: Customer|Fiscal Year|Month|Amount I'...
-3
votes
3answers
441 views

Excluding Dates Using BETWEEN

I'm trying to use the BETWEEN function to exclude dates that fall between two parameter dates, but my current code is also excluding NULL occurrences. I have a query that includes account records ...
-4
votes
2answers
6k views

What will happen if I drop an existing partition scheme/function from a table with (huge volume of records)?

I have a few questions regarding Partitioning. I'm planning to drop the existing partition scheme/function in table1 and then point the new partition scheme/function to table1 . I know how to go ahead ...
-4
votes
1answer
37 views

Check If Today Is First Of Month [closed]

On my search engine I have seen multiple results to get the first day of a month, but I want to do something slightly different. In SQL 2016, I want to check if Today GetDate() is the first day of ...
-4
votes
1answer
146 views

Is SQL Server 2016 already in a good shape to be used? [closed]

So it's time to upgrade out servers. I'm new in this company and we have SQL Servers from 2008 to 2014. I really don't see a problem upgrading all of them to 2014 because it's really wel documented ...
-4
votes
1answer
29 views

Append String To Int [closed]

I need to add a % sign to a calculation I'm doing in MS SQL Server. This is the syntax I am using Cast(Round(Coalesce(totalsaleamt,0) * 100,0) As Int) + '%' but I get the error Conversion failed ...
-4
votes
1answer
84 views

template for creating functions in the master database

I need to create functions in the master database, and I am developing a template for that, I want first to check if the function already exists, if not create a dummy function. then grant all the ...
-6
votes
1answer
1k views

MS SQL SERVER 2016 Constant CPU usage of 10% ALL DB Offline [closed]

MS SQL Server 2016 takes 10% constant CPU usage, the usage is even if I take all the databases offline. This was never the behavior of MS SQL Server in past.CPU fan starts running in high speed. If ...
-7
votes
3answers
283 views

Create an index without redundant code [closed]

I need a simple index creation script in a stored procedure as part of my database project. If the index in question already exists, I want to recreate it, to ensure that no other process has changed ...

1
46 47 48 49
50