Encrypt Password in OPENROWSET

  • Is there a way to call OPENROWSET with encrypted password? For example, in the code below, the password xxxxxxxx will be encrypted. If I can't use OPENROWSET, any other suggestion will help.
    OPENROWSET ('SQLOLEDB','Server=SERVERNAME;UID=username;PWD=xxxxxxxx;','select getdate()')

  • Creating a Linked Server stores the password for the credentials in the server, although I don't know what level of encryption is used for that.   However, it makes the use of OPENQUERY far easier, and more secure than using OPENROWSET.   After all, OPENROWSET is just a "temporary Linked Server".   However, given that a Linked Server is then "hanging around", I'd want to be sure that the appropriate permissions are in place to properly limit it's use.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • U could put it in an encrypted stored procedure.
  • sgmunson - Tuesday, April 10, 2018 10:34 AM

    Creating a Linked Server stores the password for the credentials in the server, although I don't know what level of encryption is used for that.   However, it makes the use of OPENQUERY far easier, and more secure than using OPENROWSET.   After all, OPENROWSET is just a "temporary Linked Server".   However, given that a Linked Server is then "hanging around", I'd want to be sure that the appropriate permissions are in place to properly limit it's use.

    I am trying to avoid the use of linked server. If I am to use linked server, I will have to create it on about 100 servers. Thanks for the thought.

  • Joe Torre - Tuesday, April 10, 2018 1:10 PM

    U could put it in an encrypted stored procedure.

    Why din't I think of that? Thanks for the suggestion.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply