sql-server's questions - English 1answer

21.771 sql-server questions.

I have setup a merge replication. Server DUCKDUCK1-1 is distributor and publisher. Server DUCKDUCK-2 is subscriber. I have only one small table replicated (this is a test). The table is being ...

I need to create an automatically generated locked field (that can't be a free entry). This field looks like this (this is an example): 2-0103-1/2017. In this example, number 2 represents the number ...

Create Table Script create table temp ( id int identity(1,1), a decimal(6,2), b decimal(6,2), c decimal(6,2), d decimal(6,2), e decimal(6,2), f decimal(6,2), g ...

In SQL Server, I have a table, let's call it Source. The structure is ID | SourceValue ----------------- 1 | 'value1' 2 | 'value1' 3 | 'value2' and so on. ID is a primary key and ...

I have been dealing with this query: SELECT @amount = sum(accountAmount) FROM dbo.accountTransaction WHERE invoiceID = @invoiceID AND (notCountedInTotal = 0 OR notCountedInTotal IS NULL) ...

I am running Availability Groups on SQL Server 2014 with one database in the group. Today, the server was responding very slowly and when I got on the server I found that the Availability Groups ...

Some facts: 1. The outdated statistics cause generating an inaccurate estimated plan. The estimated execution plan is created by Query Optimizer which uses both statistics and the query ...

I have two columns named date and time respectively. Both of them have datatype nvarchar as they were imported from ms excel. I want to combine the column into a new column named datetime. I managed ...

I tried to read all the questions here that has been asked before, but could not find any clue on my problem. I'm trying to setup a linked server to connect on INFORMIX server, I installed the driver,...

I have several objects in my systems that need to go through approvals. Users can create these objects, such as uploading a jpg to the server as a new Media object, and they need to be in a pending ...

Does anyone have code; looking for a random number function generator. I would just supply with a variable length @NumberLength = 50, etc. It can create numbers up to 50 digits, and store in varchar. (...

My understanding: In Sql Server, Buffer Pool is where all the Data/Proc/Log Cache, etc are located. Virtual Address Space is a logical location that refers to physical locations (either in RAM or ...

All the online resources say to use a Windows account for Agent accounts, i.e. Snapshot, Distributor and Log Reader to set up Replication. My question is: What is the problem with using domain ...

I am looking for an option to avoid Sch-S locks when running a Select query. I have a database which is controlled by an application written by others as well as my own application. One of the tables ...

I have a database DB in simple recovery mode with filegroups PRIMARY, A, B, and C. Each filegroup has a single file, PRIMARY.MDF, A.NDF, B.NDF, and C.NDF, respectively. First, I run: ALTER DATABASE [...

I have the following update: UPDATE dbo.fees SET amount = @amount, currencyCode = @currencyCode, feeType = @feeType, countryCode = @countryCode, gatewayCode = @gatewayCode, ...

I am connecting to SQL Server (2008 R2) over open Internet and properly encrypting the connection is essential. I have COMODO certificate with two intermediate certificates between root CA and server ...

I have setup a server that runs Windows Server 2008, and has SQL Server 2008 Express installed. I can connect to the machine's SQL Server Express database via the MACHINENAME/SQLEXPRESS. However ...

Our monitoring tools are showing SQLVDI errors, I think they're coming from the Event Viewer only. But the backups are showing successful in the SQL Server log files and we've successfully restored ...

I have a many-to-many table that contains id's from 2 related tables. For creating a primary key on this table, is it better to create another integer column and have that as a surrogate PK? Or ...

I've recently been doing a SQL course and I’m finding it incredibly easy to read. If I can read SQL and write in it, could it be possible that it’s almost the same to MySQL and Mongol SQL? Just some ...

I have to find reports that have not been executed once in past 60 days. how to get a list of the same. I tried following 2 queries but they are not returning the data I desire. SELECT COUNT(Name) ...

I have a mirrored database that was using a service broker to push notifications to a client. The broker creation framework started making duplicates and this caused serious problems so i rolled back ...

Looking for the fastest way of restoring multiple SQL Server standby databases that got out of sync. Server A is a production server, has 50 databases configured with LSBACKUP jobs. Server B is a ...

We have a very large staging table (> 80 GB). From our source system we load invoice data in the staging table. From the staging we transform the data and load into DWH/Fact. Every day we delete the ...

https://www.brentozar.com/pastetheplan/?id=HyUBphZy7 So the developer of this app should really be figuring this out, but it's taking too long and we are suffering from performance issues. I'm ...

I'm fighting against NOLOCK in my current environment. One argument I've heard is that the overhead of locking slows down a query. So, I devised a test to see just how much this overhead might be. I ...

I am trying to ignore duplicate rows from a CTE but I am not able to do that, it seems like a CTE does not allow to use ROWNUM() variable to WHERE clause as it is showing “Invalid column name 'numrows'...

We have one particular SQL Server which is intermittently timing out when accepting connections. The issue is consistent throughout the day, but occurs at a very low incidence. How can I continue to ...

Create table Script: create table temp ( id int identity(1,1), a decimal(6,2), b decimal(6,2), c decimal(6,2), d decimal(6,2), e decimal(6,2), f decimal(6,2), g ...

Here is a simplified version of the database I am attempting to create: create table Worker ( ID int, constraint PKW primary key (ID) ) create table Business ( ID int, W int, ...

I'm working on an SSIS package that will refresh dev databases from production backups. The package has been in place for years, but we're deploying Availability Groups on the dev instance, so the ...

I want to give everyone access to a very limited portion of the dynamic management views. That is, I want everyone in my database to be able to select from this view: create view dbo.KnowYourself as ...

I have a SQL Server Express 2014 named instance containing 3 databases (One for each office). connected to a WinForms application. Each database is uniquely named after the respective office although ...

I have created a Heterogeneous connection between SQL Server and Oracle and tried to call a oracle procedure from SQL Server.I got below error when i tried to execute the procedure. OLE DB provider ...

We setup ALTER Index job with Ola's maintenance solution, the job is failing with below error, seems the job is failing with locking, can someone help me how do we fix it, very much appreciate your ...

According to the book Microsoft Sql server 2012, Chapter 13 (Transactions and concurrency): If an exclusive page lock is held in one page of a table, another process can not get even a shared ...

SQL Server 2008r2 I'm trying to drop a certificate I've created but i get the following error The certificate cannot be dropped because one or more entities are either signed or encrypted using ...

In this code I am converting the subjects(columns) English , Hindi , Sanskrith , into rows DECLARE @colsUnpivot AS NVARCHAR(MAX), @query AS NVARCHAR(MAX) select @colsUnpivot =...

In a previous question of mine, Is it a good idea to disable lock escalation while adding new calculated columns to a table?, I am creating a computed column: ALTER TABLE dbo.tblBGiftVoucherItem ADD ...

I have two servers, SQL Server 2012. I have snapshot replication set up. Pull subscription. Publisher, distributor, same box, subscription is a different box. Lately, I have been running into some ...

I have four tables Product, Packaging, LabelsForPackaging and Label I need to query all Products with their Packaging and Labels (should result in multiple rows) Product has Packaging1Id and ...

Does anyone have a TSQL script that can automatically generate the code necessary to attach ALL existing user databases using the CREATE DATABASE FOR ATTACH syntax? example: CREATE DATABASE [...

For SQL Server 2008 and above, should (NOLOCK) be used on each table of a SELECT statement even if the connection is configured as READONLY?

I would like to limit the duration of the index maintenance procedure of Ola Hallengren to be 7200 seconds (2 Hours) I found parameter TimeLimit defined as: Set the time, in seconds, after which no ...

Our DBA team doesn't verify the backups using the below TSQL (which can easily be done post-backup and takes almost no time, so I don't get why not): RESTORE VERIFYONLY FROM DISK = 'D:\Backups\...

I am doing research into how to have both a readable secondary database that we can use for offloading heavy queries (such a reports) and also (ideally) use as highly available backup. We are a VERY ...

We have recently migrated our SQL Server distribution database to a multi subnet failover cluster, and have found that occasionally when adding articles/viewing replication status from the publisher ...

When I setup one of our SQLServer 2012 instances a while back, I didn't realize that I have checked "Data Quality Services" feature. Looking at my installation notes, I find that I didn't end up ...

I have a table as As it is seen, there is may and july ( 2017-05-01,2017-07-01) not in the table. I want to insert the previous non null ( in this case April's data for may and june's data for July) ...

Related tags

Hot questions

Language

Popular Tags