Sample Header Ad - 728x90

Database Administrators

Q&A for database professionals who wish to improve their database skills

Latest Questions

0 votes
0 answers
27 views
Running an Agent Job using Azure Shared Access Key Credential
I'd like to have a SQL agent job that copies a file up to Azure Storage using a Shared Access Key Credential. The credential is set up and works for backup and restore process, but I'd like to use it for copying files up to blob storage. I don't mind using PowerShell, CMD or SISS, I just want to be...
I'd like to have a SQL agent job that copies a file up to Azure Storage using a Shared Access Key Credential. The credential is set up and works for backup and restore process, but I'd like to use it for copying files up to blob storage. I don't mind using PowerShell, CMD or SISS, I just want to be able to leverage the credential Any Ideas? Cheers Alex
AlexP012 (53 rep)
Sep 3, 2024, 10:30 AM
1 votes
0 answers
808 views
Sql Server Agent Job - Unable to start execution of step 1 (reason: Error authenticating proxy "user", system error: The user's account has expired.)
My predecessor created several "Intergration Services Catalogs" dtsx packages which are scheduled / run via SQL Server Agent -> Jobs using an SSISFileProxy which is using SSISProxyCredentials. The expired error "user" is referring to my predecessors user account, and the only object I have seen that...
My predecessor created several "Intergration Services Catalogs" dtsx packages which are scheduled / run via SQL Server Agent -> Jobs using an SSISFileProxy which is using SSISProxyCredentials. The expired error "user" is referring to my predecessors user account, and the only object I have seen that uses his account was in the Job's Properties -> General -> Owner field. I changed the Owner to another server admin but after rerunning the job, the error message still referred to the old expired user account (rather than the updated Job owner). I am new to MSSMS and am struggling how to even articulate my question, but assume there is a simple solution. Any assistance you can provide will be greatly appreciated. Thanks!
Wyvernstail (11 rep)
Aug 24, 2021, 09:24 PM • Last activity: Jul 5, 2024, 09:05 AM
5 votes
1 answers
949 views
Compare a credential secret against a known value
Suppose I have a SQL Server [Credential](https://learn.microsoft.com/en-us/sql/t-sql/statements/create-credential-transact-sql?view=sql-server-ver16) saved in the database with a specific secret. I want to only modify the credential if the secret saved in the database is different from the actual se...
Suppose I have a SQL Server [Credential](https://learn.microsoft.com/en-us/sql/t-sql/statements/create-credential-transact-sql?view=sql-server-ver16) saved in the database with a specific secret. I want to only modify the credential if the secret saved in the database is different from the actual secret. Sometimes, an example is good, so take a look at this:
CREATE CREDENTIAL [MyCred]
WITH IDENTITY = N'DOMAIN\User'
    , SECRET = N'some_password';
So, after the password for DOMAIN\User is changed from some_password to some_new_password, I need to update the secret, but only if the stored value does not match. i.e. I don't want to blindly drop and recreate the credential. With server principals, I can use the LOGINPROPERTY([login_name], 'PasswordHash') function to get the hashed version of the encrypted password stored in the master database, but that doesn't seem to work for credentials.
Hannah Vernon (70988 rep)
Jan 26, 2023, 08:38 PM • Last activity: Jan 26, 2023, 10:11 PM
2 votes
1 answers
1397 views
Create a SQL Credential for a Managed Service Account
Is it possible to create a SQL Credential in SQL 2019 for a Managed Service Account? When I try, it asks for a password, which I don't know. I want to run a Powershell command from SQL Agent using this credential as a proxy, but can't add the credential.
Is it possible to create a SQL Credential in SQL 2019 for a Managed Service Account? When I try, it asks for a password, which I don't know. I want to run a Powershell command from SQL Agent using this credential as a proxy, but can't add the credential.
Greg (3292 rep)
Sep 14, 2021, 06:30 AM • Last activity: Sep 14, 2021, 04:38 PM
2 votes
1 answers
4342 views
How do SSIS connection strings send passwords?
I have a SQL server that pulls data from another SQL server via SSIS. We recently converted the server targeted by SSIS to VM. Since the VM conversion I have been getting "login failed for user '(username)'.". errors and the SSIS package fails to run. The connection string of the SSIS package indica...
I have a SQL server that pulls data from another SQL server via SSIS. We recently converted the server targeted by SSIS to VM. Since the VM conversion I have been getting "login failed for user '(username)'.". errors and the SSIS package fails to run. The connection string of the SSIS package indicates the username (which is correct for the target DB), but I do not see how it passes the password to connect to that DB and pull that data. So how does SSIS send passwords if not in the connection string? The Package Protection Level is set to EncryptAllWithPassword enter image description here Windows Authorization only option to run. SSIS Execute package utility
mcv110 (75 rep)
Apr 15, 2021, 06:10 PM • Last activity: Apr 22, 2021, 02:25 PM
0 votes
1 answers
46 views
Is best practice to Web Application users credentials using same database users credentials
**I have multiple Web applications using same database (MariaDB), so i want to using same user credentials as centralize, so:** - Is it best practice to using same database users credentials and when add new user add the user also on the database with proper privilege ?? **OR** - create separate tab...
**I have multiple Web applications using same database (MariaDB), so i want to using same user credentials as centralize, so:** - Is it best practice to using same database users credentials and when add new user add the user also on the database with proper privilege ?? **OR** - create separate table for the users and the any transaction using only one database user to connect, insert, delete, update, .... Thanks & Regards.
Hazim Eid (101 rep)
Aug 28, 2020, 02:45 PM • Last activity: Aug 29, 2020, 03:43 PM
0 votes
1 answers
725 views
Login failed for User 18456 State 5. User id works on other machines
I have a really weird login issue I've been pursuing. I experience this only on my Macbook Pro (2018) and only when logging into this one specific SQL Server 2016 database directly through a database client. Login attempts through any database client to this specific database are met with: > Login f...
I have a really weird login issue I've been pursuing. I experience this only on my Macbook Pro (2018) and only when logging into this one specific SQL Server 2016 database directly through a database client. Login attempts through any database client to this specific database are met with: > Login failed for user ''. (Msg 18456, Level 14). Failure state is 5, "invalid user id". These credentials work fine when used as credentials for a local copy of the java application that this DB backs. These credentials work fine when used to login from another machine. User ID/password does not work **only** when used to log in through a database client, and **only** on my machine. Tested with DataGrip and SQLPro for SQL Server. Both applications can log into other SQL Server databases without issues. I generated a new user account to no avail. The issue persists. I can connect to other database servers through 1433, and my application can connect to **this** database when running locally with the same credentials I am connected through a VPN, but I don't think that has anything to do with it. I would suspect that it's some kind of encoding issue with the request, but the problem persists across multiple applications. Anybody have any ideas?
Andrew Ross (1 rep)
Oct 3, 2019, 06:16 PM • Last activity: Feb 26, 2020, 12:56 PM
0 votes
1 answers
47 views
How to create a new user in a remote offline database without elevating roles
An enterprise C++ system that needs to be "translated", uses ODBC for connecting to SQL Server Database. The system has one central main database, many distributed local databases, which are actually offline and are periodically kept updated with the central database by exchanging merging xml files,...
An enterprise C++ system that needs to be "translated", uses ODBC for connecting to SQL Server Database. The system has one central main database, many distributed local databases, which are actually offline and are periodically kept updated with the central database by exchanging merging xml files, something like a star topology. The distributed databases are stored on many different OS and different local domains. Each user has been registered in the SQL Server and with certain user roles on the database. The number of login users at the database were kept fixed. My question is how the remote **new** user to create/update his own profile and/or credentials without the need to elevate his rights.
db-hopper (13 rep)
Feb 12, 2020, 02:18 PM • Last activity: Feb 15, 2020, 12:51 PM
3 votes
1 answers
718 views
SQL Server Credential Password and Secret Difference?
What is the difference between SQL Server secret and password for credentials(both server and db scope)? For example while reading the BOL I can see specifying a secret. Is this just the same password? https://learn.microsoft.com/en-us/sql/t-sql/statements/create-credential-transact-sql?view=sql-ser...
What is the difference between SQL Server secret and password for credentials(both server and db scope)? For example while reading the BOL I can see specifying a secret. Is this just the same password? https://learn.microsoft.com/en-us/sql/t-sql/statements/create-credential-transact-sql?view=sql-server-2017
igelr (2162 rep)
Aug 13, 2019, 01:18 PM • Last activity: Aug 31, 2019, 02:28 PM
0 votes
1 answers
1771 views
Using sp_send_dbmail with SQL authentication to send attachments from UNC path
I'm trying to send emails with attachments using a SQL authentication account that I have granted [credentials][1] to. The login used in the stored Credentials is a domain account that has permissions to read from the share. EXEC msdb.dbo.sp_send_dbmail @recipients = 'me@abc.xyz.nz', @profile_name =...
I'm trying to send emails with attachments using a SQL authentication account that I have granted credentials to. The login used in the stored Credentials is a domain account that has permissions to read from the share. EXEC msdb.dbo.sp_send_dbmail @recipients = 'me@abc.xyz.nz', @profile_name = 'Alarms', @subject = 'Test with Attachment', @body = '*** Alarms ***' , @file_attachments = '\\Servername\Share\Images\TestImage.png' But when I use the SQL login I get the following error: > Msg 22051, Level 16, State 1, Line 26 The client connection security > context could not be impersonated. Attaching files require an > integrated client login What have I missed? how can I test that the credentials have been applied correctly? Does this only work for a local share? Edit: I granted my SQL login Sysadmin privs and it now works with both a local share and with a remote share. So what privs does sysadmin have that allows this to work?
Sir Swears-a-lot (3253 rep)
Aug 29, 2018, 04:45 AM • Last activity: Sep 3, 2018, 08:24 PM
Showing page 1 of 10 total questions