Quantcast
Channel: Getting started with SQL Server forum
Viewing all 9243 articles
Browse latest View live

issues with validate-ad-config on Centos 8

$
0
0

Hi

I have 2019 installed on centos 8 , MS AD auth is working for centos and from sql studio to sql ... but  /opt/mssql/bin/mssql-conf validate-ad-config is failing !

env LC_ALL=C /opt/mssql/bin/mssql-conf  validate-ad-config
Warning: RDNS could not resolve this host. This is not a fatal error, but should be fixed by updating your RDNS records
Warning: Some but not all SPNs are present
Error: svcXXXXXdb entries are not present in /var/opt/mssql/secrets/mssql.keytab or have the wrong KVNO

i have checked DNS and RDNS all there also the KVNO is there to


Not able to start SQL services from domain user

$
0
0

Hi ,

Could you help me please to figure out why I'm not able to start SQL server from domain user, before it's working properly , since today I'm able start only from Local System, see below error when I try to log on domain  user

Windows could not start the SQL server (MSSQLSERVER)on Local Computer.For more information,

review the System Event Log, ..error code -2146885628

also I saw next error 

7024

The MSSQLSERVER service terminated with the following service-specific error: 
Cannot find object or property.

thank you

Where to download SQL Server Standard 2008 for TFS 2010?

$
0
0

We will acquire a license of TFS2010 and I need to install SQL Standard in order to use TFS and its reports and analysis services. But I just can't find the download link for standard distribution.

Found the link here, but I'm not a MSDN subscriber, and as said here and here(licensing whitepaper Pg7), it is allowed to install SQL Standard to support TFS. Also, could not contact MS support.

I'm now restoring a backup that comes from a Enterprise distribution(downloaded from msdn and installed to solve compatibility issues with my current backup file), so if it is possible to activate this instance as standard please let me know.

Thanks


+.+


Merge update, insert, delete assistance?

$
0
0

Hello,

I am new to Sql and attempting to perform something that is considerably over my head.

I have created an inventory system for our webservers that gathers information then inputs into sql tables.

For instance table dbo.Disk has server disk specific information such as deviceid, total size, and volume name.

I gather information save a local csv copy to the servers, then execute a powershell script to create a staging table on the sql server, upload the data then merge the rows into a master table.

Server1 will create a table called dbo.Server1Disk then merge information from there to dbo.Disk

I am able to insert and update however i had difficulty that when i attempted to delete it removed all rows not specific to that server.

I think i have it working but every time i run the query it says the number of rows in the source table affected but the outcome looks correct in the dbo.Disk

For instance Server1 has 5 disks, everytime i run the below query it states 5 rows affected.

Please help me ensure this is done correct or how i can make it best practice.

Thank you

Merge into dbo.Disk as tab1 
using(select * from dbo.Server1Disk) as tab2 
   on tab1.UniqueServerID=tab2.UniqueServerID 
   and tab1.DeviceID=tab2.DeviceID
when matched then 
update set 
    tab1.DeviceID=tab2.DeviceID,
tab1.DriveType=tab2.DriveType,
tab1.VolumeName=tab2.VolumeName,
tab1.TotalSize=tab2.TotalSize,
tab1.InventoryDate=tab2.InventoryDate 
when not matched by TARGET
then insert 
values(tab2.UniqueServerID,tab2.DeviceID,tab2.DriveType,tab2.VolumeName,tab2.TotalSize,tab2.InventoryDate)
WHEN NOT MATCHED BY SOURCE 
AND tab1.UniqueServerID IN(SELECT UniqueServerID FROM dbo.Server1Disk) THEN
DELETE;

third party tool backup

$
0
0

Good Morning Experts,

Someone sent me a third party tool backup file. Is there any way to know what is the third party tool.


Kiran

Updating using a case statement that uses 2 sets of joins (updating the same column for both sets)

$
0
0

Hello,

In one sql statement, I'm trying to do an update based using 2 different set of joins.  For an example, if the account number=abc123, I would find those records with 1 set of joins.  For all other accounts, the records would be found using a different set of joins.  However, in both cases the update is the same.  How would I achieve this? 


AS

Truncate SQL Database Logs.

$
0
0

A backup software generally first take FULL backup and then INCREMENTAL backup where log file is truncated with the completion of INCREMENTAL backup. 

I want to truncate a large log file manually so want to check what should be on step 2, also want to confirm is below approach is correct for manual task ?- 

1. Take FULL backup of database. 

2. ___________________ Differential or Transnational Backup ?

3. Shrink Log file. 

Thanks

Vijay 

Basic Availability Groups with standard AOAG

$
0
0
Is it possible to have 2 nodes installed, one with standard and other with enterprise sql edition and then add them to the same availability group so long it does not exceed 2 replicas as per restriction of standard edition

Query help - order by (count) column alias

$
0
0

Hi I need help writing a query which has a "count" and an "order by".

There are 3 tables: "Supplier", "User", and "User_Supplier".

The "User_Supplier" table associates Suppliers to Users (many to many).

In my query I want to select Suppliers, but also calculate how many Users there are associated to the Supplier - AND I want to be able to "order by" a parameter - so the parameter could say "sort by the supplier name" or "sort by the count".

It is the "sort by the count" which I can't figure out. My query can select the suppliers and the count of users, but how do I get it to "order by" the column alias "SupplierUserCount" ?

DECLARE @orderBy VARCHAR(50)='Name'
DECLARE @order VARCHAR(400)='ASC'

SELECT 
    s.Name,
    (
        SELECT
            COUNT(us.SupplierId)
        FROM
            User_Supplier us
        WHERE
            us.SupplierId = s.Id
    ) as SupplierUserCount
FROM 
    Supplier s

ORDER BY 
CASE WHEN @orderBy = 'Name' AND @order = 'ASC' THEN s.Name END ASC,
CASE WHEN @orderBy = 'Name' AND @order = 'DESC' THEN s.Name END DESC
--CASE WHEN @orderBy = 'SupplierUserCount' AND @order = 'ASC' THEN SupplierUserCount END ASC,
--CASE WHEN @orderBy = 'SupplierUserCount' AND @order = 'DESC' THEN SupplierUserCount END DESC


Rows duplication in my query result

$
0
0

Hello Community,

Kindly assist in reviewing this query when I ran it, it resulted in multiple duplication of rows

Select I.INV_ADV_ID AS INVOICE_NO

, (CASE
   WHEN (ADR.ADDR_2_TX = '') THEN
   CONCAT(ADR.ADDR_1_TX, ', ', ADR.CITY_TX, ', ', ADR.STATE_TX, ', ', ADR.POSTAL_CD_TX)
   ELSE
   CONCAT(ADR.ADDR_1_TX, ' ', ADR.ADDR_2_TX, ' ', ADR.CITY_TX, ', ', ADR.STATE_TX, ', ', ADR.POSTAL_CD_TX)
   END) AS SERVICE_ADDR
,ADR.STATE_TX 
, LDC.LDC_ACCT_NO
,LDC.LDC_ACCT_ID


, coalesce(convert(char(10), convert(date, (convert(varchar(8), nullif(MU.SERVICE_PERIOD_BEGIN_DT, 0))), 113)),'') AS SERVICE_PERIOD_BEGIN_DT
, coalesce(convert(char(10), convert(date, (convert(varchar(8), nullif(MU.SERVICE_PERIOD_END_DT, 0))), 113)),'') AS SERVICE_PERIOD_END_DT
, MU.BEGINNING_READING_NO AS PREV_READ
, MU.ENDING_READING_NO AS CURR_READ
, CAST(((MU.ENDING_READING_NO - MU.BEGINNING_READING_NO) * MU.METER_MULTIPLIER_NO) AS DECIMAL (10,0)) AS USAGE
, MU.QTY_DELIVERED_NO
, TH.PRICE_PER_UNIT_NO
, TH.TRANS_AM
, TH.TRANS_QTY
, ug.RATE_CD



from RMPROD..INVOICE_ADVISE I
join RMPROD..INVOICE_ADVISE_RELATE IR 
on i.INV_ADV_ID = ir.INV_ADV_ID
join RMPROD..TRANSACTION_HISTORY TH 
on ir.TRANS_ID = th.TRANS_ID
left join RMPROD..LDC_ACCOUNT LDC 
on th.LDC_ACCT_ID = LDC.LDC_ACCT_ID
join RMPROD..ACCOUNT A 
on TH.ACCT_ID = A.ACCT_ID
join RMPROD..ADDRESS ADR 
ON LDC.ADDR_ID = ADR.ADDR_ID
join RMPROD..CUSTOMER C 
on A.CUST_ID = C.CUST_ID
join RMPROD..VENDOR V 
on v.VENDOR_ID = ldc.LDC_VENDOR_ID
join RMPROD..USAGE_GROUP ug
 on th.USAGE_GROUP_ID = ug.USAGE_GROUP_ID
join RMPROD..USAGE_GROUP_RELATE ugr 
on ug.USAGE_GROUP_ID = ugr.USAGE_GROUP_ID
left join RMPROD..MONTHLY_USAGE MU 
on ugr.MONTHLY_USAGE_ID = MU.MONTHLY_USAGE_ID
JOIN RMPROD..RATING_GROUP RG 
on ldc.LDC_ACCT_ID = RG.LDC_ACCT_ID and UG.RATE_CD = RG.RATE_CD
WHERE coalesce(convert(char(10), convert(date, (convert(varchar(8), nullif(MU.SERVICE_PERIOD_END_DT, 0))), 113)),'') > DATEADD(month,-24,GETDATE())

Your assistance will be of a great help thank you.

microsoft sql connection error

$
0
0

i followed the tutorial : https://www.guru99.com/c-sharp-access-database.html.

after i did the first part, clicked connect, an error occured at cnn.open().

error had to do with machine im connecting to, credential etc..

please help.

MSSQL server service not starting post installing certificate for Server Certificate Validation

$
0
0

I want to test my application with Server Certificate Validation and first wanted to make sure configuration is appropriate at MSSQL server level.

I have turned ON Force Encryption and Imported the Trusted root certificate & Personal certificate under MMC and same personal certificate is used.

Post these configurations I am not able to restart the service.

Getting below error in ERROR.LOG

2020-03-24 16:43:26.45 spid20s     Found the certificate [Cert Hash(sha1) "abcdefghijklmnopqrstuvwxyz"] in the local computer store but the SQL Server service account does not have access to it.

I have given the full access to all the Groups/Users under Private key properties of the certificate imported.

Auto detect errors from the SQL error log

$
0
0

Hello,

I was wondering whether we have any functionality to auto detect any errors or warning message from SQL server.

This is very important for us in order to decrease MTTR of our applications.

Links to any third party tools is also appreciated.

I know SCOM can alert us but I was looking for some alternatives.


Regards, Ashif Shaikh

DBCC log format

$
0
0
can anyone please explain, what is the dbcc log output format?. it is undocumented.

Make the database drop down wider?

$
0
0
I've tried grabbing this and dragging it left/right to see if it would increase in size, but I could only move it side to side.  Is there a way to make the drop down in SSMS that displays the databases attached to the current instance wider?

Determine the database type

$
0
0
Hi, I have web application. I can use it by entering username and password, but I want to see source database. I tried to write URL without "https://" in server text box of Microsoft SQL Server Management Studio my username and password in appropriate textboxes Using SQL Server authentication, but I got message... something "coudn't find a server...". Question: how to determine on what database established web app (SQL Server, Oracle etc.) to connect to it with appropriate tool?

Moving license to new server

$
0
0
I have purchased a SQL Server 2016 license, and I have entered it on my temporary server. will I be able to re-enter the license again into the new server? Please explain

Error when clicked on any login under Security\Logins

$
0
0

Hello All,

I am trying to open a login of user to changes the access but when I try to open one of the user login i get below error.

I got to Security expand it then Logins and tried opening any user login

This is staging server and there are 20 of developers who use this themselves to deploy the dev changes.

I am not sure what is causing this error.

Kindly help

I appreciate your help 


Dilip Patil..


Clean data

$
0
0

Hello

I have an issue. I have a source column which has data like:

Business ID

012345678MVA

202 010 900

221008

The output I want is 

Business ID

012345678

202010900

221008

How can I do it? Can I use replace to do this task?

Regards

PV



The database is not accessible error from SSMS

$
0
0

I have a SQL 2008 R2 Server. It has several databases. When I login to the server through SSMS, one of the databases is shown as "Recovery Pending". When I try to expand the database, an error is shown like "The database is not accessible (objectexplorer)".

Other databases in the server don't have this issue.

Anyone has some idea about what is the issue here?

Viewing all 9243 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>