New answers tagged

1 vote

SQL Server - Linked Server - Using OPENROWSET with windows integrated security

This is for DBAs out there who are using OPENROWSET to collect data from multiple instances. I also found a new method. Try to execute following before your script execute as login = 'sa' GO so your ...
user avatar
5 votes
Accepted

Cannot execute as the server principal... with Windows (Active Directory) Group login

This is not supported by design. Ref: EXECUTE AS Clause (Transact-SQL) Specifies the statements inside the module execute in the context of the user specified in user_name. Permissions for any ...
user avatar
  • 12.2k
0 votes

WHERE in based on multiple columns

I just ran into the exact same problem. Used to working with Oracle and Teradata I just wrote a query like: select * from table where ID in (select ID from table group by ID having count(*) > 1) ...
user avatar
0 votes

Run MSSQL stored procedures containing SSIS packages using Windows Authentication from another computer

You can use SQL Server Authentication / a SQL Login to execute SSIS packages, as long as that account has the appropriate permissions provisioned. This might be the simpler route to go for your ...
user avatar
  • 24.1k
2 votes

BOM query combining components on 1 row

You need pivoting. For multi-column pivot, easiest is to use condition case statement with aggregate. select p.Code, Component1 = max(case when rn = 1 then Component end), Quantity1 = ...
user avatar
  • 475
0 votes

Split Brain scenario Always on Availability group

if I failover to the DR site and shut off all the nodes at the Primary site one after another and once the maintenance is over I simply turn back on the nodes at the primary server one by one and then ...
user avatar

Top 50 recent answers are included