Good Morning Experts,
There are no indexes on a table and I am creating index with ONLINE=ON option. Does this make any sense?
Kiran
Good Morning Experts,
There are no indexes on a table and I am creating index with ONLINE=ON option. Does this make any sense?
Kiran
May I ask if Microsoft Visual C++ 2017 Redistributable (x86) 14.12.25810 is included in downloading package of SQL Server Management Studio18.0 (preview 6)? Thank you
Hi,
I have a date variable 'Date_End' formatted YYYY-MM-DD.
What I need to do is add on 1 day to each record so if I had Date_end 2018-12-31 I want the new_end_date to show 2019-01-01
Thanks
Hi,
How do I wrap a format into this logic please? I want the date to show 'MMM-yyyy'
dateadd(day,1,LD.END_DATE) as new_end_date
Database k1
table 1
column1 | column2 | column3
table 2
column 3
i use sql server 2008, i want query to copy k1.table1.column3 into k1.table2.column3 data only with query
MUHAMMAD ANZAR E-mail : muhammadanzar@hotmail.com Mobile # :0092-3215096959
Can I get some advice on below:
Our's is SQL Server 2014 SP2 GDR
We are with 3 Node AOAG Configuration (2 Primary Sites Synchronized & 1 Secondary BCP)
Now we are enabling TDE in this environment.
My question is about the performance testing and understand and test the behavior (Performance) of SQL Server pre & post TDE Enablement in this AOAG environment.
Please advice what are the basic steps and ways I should be thinking of.
If I need to utilize the SQL Profiler to understand the resource utilization , what are the major counter related to RAM , CPU , IO which I should be considering.
Kindly let me if there are any queries which are already used for this purpose.
Please also advice what are the things I need to keep in mind while enabling TDE on PROD Servers as priority.
Regards
Best Regards,SQLBoy
Hi MSDN,
Apart from total memory of my machine which is 8GB, what is the difference between these two columns(assuming second one is memory used by sqlserver I guess)? Any help is greatly appreciated.
Thanks.
FYI
Greetings to you all
I'm a newbie here and hope I am posting to the correct forum. Please point me in the right direction if not
I have been a Windows server admin for over 25 years, and have had some dabbling's in SQL over the years, but am by no means a SQL admin. I have backed up and restored DB's in the past so my current situation has me somewhat baffled. I had thought that perhaps as a newbie I had done something to lose data through truncated logs or something by making bad decisions on options while performing my back up or the restore.
Here is where I am at. We run Windows based systems and are leveraging Hyper-V for virtualization. We have two physical hosts running which replicate between each other and use VEEAM as our backup technology. We have been experiencing poor performance across the board on applications using SQL and having inherited the entire environment, thought I could do a better job of outfitting a better SQL system. Old system is a Windows 2008R2 server running SQL 2008 of which all installed to the only drive, C:
I spun up a new Windows Server 2012 R2 and installed a number of drives to hopefully increase the performance of the SQL services. I have an OS drive, a TempDB drive, a Logs drive, a SQLDATA drive for the system DB's, a backup drive, an SSD dedicated to page file, and an application drive for the SQL application itself.
I migrated the DB's for all applications over to the new SQL system using the SSMS2008 on the old server to do a FULL backup, copied the .bak file across the network onto the new SQL2012 system, and then ran a restore. This has worked well for all DB's to this point, but I've run into a mystery on this last go around.
In the interest of trying to be thorough, the application backing the issue at hand is Raiser's Edge. It uses an application server in it's architecture which then talks to a SQL backend. Client workstations connect, and get their configuration from the App server. RE states that you need to use their native tools for moving a database, so using the RE management console, you need to "Attach" a database to the RE system. You can't just edit a configuration or "point" the RE application at a SQL instance. This "attach database" process in their management interface is doing a "Restore" in the background, and in the end, at least so I hoped, the application would end up repointed to a freshly restored copy of the DB on this new SQL2012 instance.
Well, it did. It worked wonderfully and seemed quite responsive. Unfortunately I received a call from the end users shortly afterwards telling me I had restored old data and that although it was Jan 18th 2019, the data showing in the application is only up to December 2018. Somehow I'd gone from the RE application in use on the 117th and all days before, to having lost weeks of data.
The database was actively used daily all of this month as it always is, so the transactions must be still on the database on the old SQL2008 system somewhere.
Not sure where to turn while I await a SQL consultant to show up onsite if I can find one on short notice so I'm hopeful some of the kind souls here have a handle on what might be causing such woes
Mystified and exhausted
Hi!
I have some difficulty understanding recursive stored procedures. How does one execute a recursive SP, when it hasn't yet been created? eg. in this : https://www.guru99.com/sql-server-questions.html
Also any practical real value examples will be great.
Thanks
Shav
Hi,
SQL Server 2012
I changed the collation of a database and now I try to manually change the collation of columns to be the same. But the options that I have in the column properties are different than those of the database...
For database I chose Romanian_100_CS_AS
For columns I have 2 options like SQL_Romanian_CP1250_CS_AS.
And even by using this collations, letters ș and ț wonțt work. Only ă, î and â work.
Is this normal?
Thank you, Alexandru
Hi,
I have the following code which outputs the standard table of 5 vertical columns
select
distinct(dbo.pk.job_number)as job_number,
dbo.PK.Code,
dbo.pk.name,
FORMAT(DBO.DAD.INVOICE_DATE,'yyyy-MM')AS INVOICE_DATE,
sum(dbo.DAD.draft_amount)as invoice
from
dbo.pk
leftjoin dbo.dad
on dbo.pk.job_number= dbo.dad.job
groupby
dbo.pk.name,
dbo.PK.Code,
dbo.pk.job_number,
FORMAT(DBO.DAD.INVOICE_DATE,'yyyy-MM')
How can I change the table output so that the Invoice_date variable essentially becomes a column so it's formatted something like this?
Client_Code | client_name | job_number | 2013-06 | 2013-09 | 2013-10 | 2013-11 | 2013-12 | 2014-01 | 2014-02 | 2014-03 |
I'm trying to write a sql view to apply customer payments (oldest payment applied to oldest invoice in sequential order). I'd like to apply the customer payments based on the oldest payment date being applied to the oldest invoice date until the payment no longer has any value remaining, then the next payment for that customer and so on.
I can't change the table structure as it is tied to an ERP, payments and invoices are in the same table, payments are document type = 9 and invoices are document type 1. There will be no negative numbers. I can only apply up to the invoice/current amount (i.e. I cannot apply an amount that would cause a negative amount to be applied).
here is some sample data:
CREATE TABLE [dbo].[_ReceivablesDocuments](
[Customer] [char](15) NOT NULL,
[DocumentNbr] [char](21) NOT NULL,
[PaymentCID] [char](21) NOT NULL,
[DocumentType] [smallint] NOT NULL,
[DocumentDate] [datetime] NOT NULL,
[CurrentAmount] [numeric](19, 5) NOT NULL,
[_ID] [int] IDENTITY(1,1) NOT NULL
) ON [PRIMARY]
INSERT INTO _ReceivablesDocuments VALUES ('130308', 'OCK000000023830', '4328', 9, '12-05-2018', '43.60')
INSERT INTO _ReceivablesDocuments VALUES ('130308', 'OCK000000023B2C', '4328', 9, '12-06-2018', '43.60')
INSERT INTO _ReceivablesDocuments VALUES ('130666', 'OCC0000000295D7', '2232', 9, '12-20-2018', '226.10')
INSERT INTO _ReceivablesDocuments VALUES ('130666', 'RCC00000003C9AD', '2232', 9, '01-18-2019', '103.35')
INSERT INTO _ReceivablesDocuments VALUES ('131802', 'OCC00000002DF3B', '3701', 9, '01-02-2019', '200.00')
INSERT INTO _ReceivablesDocuments VALUES ('131802', 'OCC00000002DF3D', '3701', 9, '01-02-2019', '30.00')
INSERT INTO _ReceivablesDocuments VALUES ('131802', 'RCC00000002F7C3', '3701', 9, '01-02-2019', '17.65')
INSERT INTO _ReceivablesDocuments VALUES ('130308', '0130308M181231', '', 1, '12-31-2018', 16.80000)
INSERT INTO _ReceivablesDocuments VALUES ('130308', '130308-MIG-181031', '', 1, '10-31-2018', 16.80000)
INSERT INTO _ReceivablesDocuments VALUES ('130308', '130308-MIG-181130', '', 1, '11-30-2018', 26.80000)
INSERT INTO _ReceivablesDocuments VALUES ('130666', '0130666M181231', '', 1, '12-31-2018', 24.33000)
INSERT INTO _ReceivablesDocuments VALUES ('131802', '131802-MIG-181130', '', 1, '11-30-2018', 17.65000)
INSERT INTO _ReceivablesDocuments VALUES ('131802', '0131802M181231', '', 1, '12-31-2018', 131.83000)
The results should look like this (based on above):
Customer | PaymentDate | PaymentNbr | PaymentCID | AvailableApplyAmount | ApplyToDocumentNbr | DocumentType | InvoiceBalance | InvoiceDate | ApplyAmount |
130308 | 12/5/2018 | OCK000000023830 | 4328 | $ 43.60 | 130308-MIG-181031 | 1 | $ 16.80 | 10/31/2018 | $ 16.80 |
130308 | 12/5/2018 | OCK000000023830 | 4328 | $ 26.80 | 130308-MIG-181130 | 1 | $ 26.80 | 11/30/2018 | $ 26.80 |
130308 | 12/6/2018 | OCK000000023B2C | 4328 | $ 43.60 | 0130308M181231 | 1 | $ 16.80 | 12/31/2018 | $ 16.80 |
130666 | 12/20/2018 | OCC0000000295D7 | 2232 | $ 226.10 | 0130666M181231 | 1 | $ 24.33 | 12/31/2018 | $ 24.33 |
131802 | 1/2/2019 | OCC00000002DF3B | 3701 | $ 200.00 | 131802-MIG-181130 | 1 | $ 17.65 | 11/30/2018 | $ 117.65 |
131802 | 1/2/2019 | OCC00000002DF3B | 3701 | $ 82.35 | 0131802M181231 | 1 | $ 131.83 | 12/31/2018 | $ 82.35 |
131802 | 1/2/2019 | OCC00000002DF3D | 3701 | $ 30.00 | 0131802M181231 | 1 | $ 49.48 | 12/31/2018 | $ 30.00 |
131802 | 1/2/2019 | RCC00000002F7C3 | 3701 | $ 17.65 | 0131802M181231 | 1 | $ 19.48 | 12/31/2018 | $ 17.65 |
Here is the query I have but it doesn't quite work properly...
WITH CTE AS (Hi,
I have the following code which outputs the standard table of 5 vertical columns
select
distinct(dbo.pk.job_number)as job_number,
dbo.PK.Code,
dbo.pk.name,
FORMAT(DBO.DAD.INVOICE_DATE,'yyyy-MM')AS INVOICE_DATE,
sum(dbo.DAD.draft_amount)as invoice
from
dbo.pk
leftjoin dbo.dad
on dbo.pk.job_number= dbo.dad.job
groupby
dbo.pk.name,
dbo.PK.Code,
dbo.pk.job_number,
FORMAT(DBO.DAD.INVOICE_DATE,'yyyy-MM')
How can I change the table output so that the Invoice_date variable essentially becomes a column so it's formatted something like this?
Client_Code | client_name | job_number | 2013-06 | 2013-09 | 2013-10 | 2013-11 | 2013-12 | 2014-01 | 2014-02 | 2014-03 |
Hello SQL community,
I cannot import my csv data file into the database. Does anyone know whats the issue?
Thank You so much:)
Regards,
Tan
Hi ,
I am migrating to SSIS 2016 version. I am trying to use the Oracle provider for Oledb in connections.
However, this option does not show. I have installed the Oracle client 12.2 and I am able to do UDL file testing, where in I can see the Oracle provider and able to test connection.
But when I try in VS 2015, the option is not shown.
The issue is described here - https://jorgklein.com/2011/06/02/ssis-connect-to-oracle-on-a-64-bit-machine-updated-for-ssis-2008-r2/ and based on this I have installed the 64 bit client . But when trying to use the connection manager, the oracle provider is not shown.
How to fix this?
I know that udl can be used to test connection. But I always get errors when testing the connection to localdb.
Can someone guide me how to test.
Thanks.
Hi guys, I am trying to run a query from PowerShell to get the contents of a column from multiple tables. The columns will not have the same amount of data within it so I don't want to join them. I'm wanting to get it all in one result so that i can dot source the output in PowerShell
SELECT [ImpactDefinition].[NAME] AS Impact, [RequestTypeDefinition].NAME AS RequestType, [UrgencyDefinition].NAME AS Urgency, [CategoryDefinition].CATEGORYNAME AS Category FROM [ImpactDefinition], [RequestTypeDefinition], [UrgencyDefinition], [CategoryDefinition]
This give me the info that I want, but it gives me duplicates for each possible combination.
I tried to google around to see how to join with out matching but i guess i don't know the terminology used in SQL.