Laden...
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
LOGON Trigger Count | |
I have the need in SQL Server 2022 to create a complex set of checks for logins. I want to use Longon triggers, but I'd like to separate out logic. How many Logon Triggers can I create? | |
Think you know the answer? Click here, and find out if you are right. |
Yesterday's Question of the Day (by Steve Jones - SSC Editor) |
Multiple Query Trace Flags I want to enable two trace flags, 4199 and 4137, for a single query. How should I do this: -- A SELECT a.AddressID , a.AddressLine1 , a.AddressLine2 , a.City , a.StateProvinceID , a.PostalCode , p.FirstName , p.LastName FROM Person.Address a INNER JOIN person.Person AS p ON p.rowguid = a.rowguid WHERE City = 'SEATTLE' AND PostalCode = 98104 OPTION (QUERYTRACEON 4199, 4137); -- B SELECT a.AddressID , a.AddressLine1 , a.AddressLine2 , a.City , a.StateProvinceID , a.PostalCode , p.FirstName , p.LastName FROM Person.Address a INNER JOIN person.Person AS p ON p.rowguid = a.rowguid WHERE City = 'SEATTLE' AND PostalCode = 98104 OPTION (QUERYTRACEON 4199, QUERYTRACEON 4137); -- C SELECT a.AddressID , a.AddressLine1 , a.AddressLine2 , a.City , a.StateProvinceID , a.PostalCode , p.FirstName , p.LastName FROM Person.Address a INNER JOIN person.Person AS p ON p.rowguid = a.rowguid WHERE City = 'SEATTLE' AND PostalCode = 98104 OPTION (QUERYTRACEON 4199), (QUERYTRACEON 4137);Answer: B Explanation: If you want multiple flags, you need to repeat the QUERYTRACEON keyword for each one, separated by a comma. This is in the same OPTION clause. Ref: Query Hints - https://learn.microsoft.com/en-US/sql/t-sql/queries/hints-transact-sql-query?view=sql-server-ver16 |
Database Pros Who Need Your Help |
Here's a few of the new posts today on the forums. To see more, visit the forums. |
SQL Server 2017 - Administration |
Always on With Different DB name on Secondary - Hi Guys I have a request to configure Always ON with the secondary having a different database name Is that possible? Thanks |
SQL Server 2016 - Administration |
Table partitioning best practice - I've inherited a couple of rather large databases from my ex-colleague when I join this company. Today, a developer reached out to me to inform me that in that databases there's a couple of large tables which has partition & they would want to partition ALL of the tables in the DB. Bear in mind […] |
SQL Server 2016 - Development and T-SQL |
Script to Merger duplicate indexes - Hello, I am trying to firgure out how to merge duplicate indexes using a script; any help will be greatly appreciated. |
SQL Server 2019 - Development |
SQL Server Encrypt data into a file, send it and then decrypt - First off, my apologies for what could potentially be a bad title! I am looking for some general information. I may have a potential project where I need to pull data from a SQL Server, populate a parquet file and then SFTP this parquet file to the end user. Seems simple enough. The caveat here […] |
Change IN for EXSITS - I have had a hard time to understand how to use EXISTS. I Always use IN instead. Here it dont work, "Only one expression can be specified in the select list when the subquery is not introduced with EXISTS." Someone who can rewrite this: SELECT minutes FROM dbo.timeaccountmovement WHERE ownertype = 1 AND timeaccountid = […] |
get all txt files $filenameAndPath = code please help - Hello I need to get txt files from directory and send email, when I put name of the file my code is working, but I need to get all txt files from directory and dont know which to use,please help me thank you here is my code: This code is working,just not sure how select […] |
SQL Azure - Development |
using Openrowset to access delta files in ADLG2 - Dears, I was told that I cannot access delta files in SQL Server Managed instance. Those delta files are generated by synapse spark But we need to move this information into a SQL Server Managed instance Hence we have created a layer (curated layer) in synapse which converts this deltas into parquet files. Goal is […] |
SQL Azure - Administration |
Azure SQL how to grant ALTER DATABASE permission - I have the user Managed identity , granted it carte blanche alter with GRANT ALTER TO successfully at the application database level with the intent to give the user permissions to alter all tables of all schemas. But before the index maintenance job runs, I have to auto scale up using ALTER […] |
SQL Server 2005 Integration Services |
Remove comma inside Comma Delimited File csv in SSIS Using Script task - Hi, I have two tables: one for headers with 9 fields and another for lines with 6 fields. Both header and lines are highlighted in yellow. I need to combine both the headers and lines using a UNION operation to display the result below. From the line table, I need to add 3 empty fields […] |
Oracle |
Subscription to Oracle DB not working after upgrading subscriber to Oracle 19c - Hi Replication and publisher configured on the same sql server 2022 version. Subscription to Oracle database was configured and worked without any problem till the subscription Oracle database was on 11g. The subscriber Oracle database version was upgraded from Oracle 11g version to Oracle 19c. The job creates *.pre, *.sch, *.bcp scripts on the repl […] |
SQL Server 2022 - Administration |
Clear Trace - Asking for SQL Server 2008 - Hi, I have SQL Server 2019 installed and when go the Clear Trace database created on it. When I try to use the Clear Trace tool, the tool is prompting to configure SQL Server 2008 and not allowing to use my trace files. I tried to download SQL Server 2008 from Microsoft Download Central but […] |
Always on Availability groups cluster question - Hello, I have a question regarding Availability group server architecture. A little background: We want to convert our 20 FCI instances to Availability groups. Those instances will be converted by moving all databases from one FCI instance to one standalone instance (which is on one virtual machine). That means 20 VMs for primary nodes and […] |
AG listener cant be removed - Testing with AG on Linux with Cluster=NONE. it was all going ok and as expected but now I have a very strange situation after a failover - AG listener is "null" - so I can not drop it and in the same time I cant add a new one cause one already exist. Anyone experienced […] |
SQL Server 2022 - Development |
Error while an ADF pipeline runs stored procedures against Azure SQL Server MI - Dears, We are using Azure Data factory pipes to run some stored procedures against a SQL Server Managed Instance in the cloud Almost every day while running we receive the following error : Error Message: Execution fail against sql server. Please contact SQL Server team if you need further support. Sql error number: 64. Error […] |
Inserting 100K rows Performance - Baseline Performance - We're trying to understand how quick new versions of SQL server can be. Obviously server specs come into play. Can anyone run this simple test and share the output (ms). Create simple Table CREATE TABLE [dbo].[Data]( [Id] [int] IDENTITY(1,1) NOT NULL, [Comment] [varchar](50) NOT NULL, [CreateDate] [datetime] NOT NULL, CONSTRAINT [PK_Data] PRIMARY KEY CLUSTERED ( […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. [email protected] |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Laden...
Laden...