|
|
|
|
|
|
|
Question of the Day |
Today's question (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); | |
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) |
Creating Statistics on XML I have a table in SQL Server 2022 that is an XML data type. I have an index on this column and want to create statistics using CREATE STATISTICS for some of the data in the column. What should I do? Answer: Nothing, you cannot create statistics on an XML column manually. Explanation: An XML column is not valid for CREATE STATISTICS and there is no CREATE XML STATISTICS command. Ref: CREATE STATISTICS - https://learn.microsoft.com/en-us/sql/t-sql/statements/create-statistics-transact-sql?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 2019 - Administration |
Extend Event with sqlserver.login - My knowledge of Extended Events is limited, but I am trying to capture some login details with extended events and can see actions for: sqlserver.client_app_name sqlserver.client_hostname sqlserver.database_name sqlserver.username etc I would also like to find out the client interface (.Net SqlClient Data Provider, ODBC, OLEDB etc), which is client_interface_name in sys.dm_exec_sessions. Does anyone know if […] |
ghost backups processed 0 pages - I've got something I'm not aware of performing backups of my dbs at random times in the day. I think it is performing backups however it says 0 pages processed. Regardless, anyone have any idea oh how to trouble shoot this? |
The OS returned the error '(null)' while attempting 'DeleteFile' filestream.hdr - I have a SQL Server 2019 Enterprise Edition on CU 25. It has in-memory oltp enabled. I have a full and a diff backup I'm trying to restore under a new database name, followed by some log files. The full restores fine but then the diff throws this error and I can't find anything about […] |
SQL Server 2019 - Development |
plugging a repo version number into the tabular model - hi we run 2019 std. we saw this week that someone hid 3 important columns (2 are calc'd measures) from our sales cube. i'm in the process of setting up a repo for our bim going forward. i'm not the only one that can deploy and process. its totally possible that these were hidden before […] |
Stored Procedures - passed string than variable length - Dear all, I was just wondering: Can you change the default behaviour as illustrated below? The user passes a longer string than it was defined in the proc parameter and may not get a feedback, that the string was not processed as he/she wanted. (e.g. when inserting the value into a table) create procedure prp […] |
Multi row tally query with max value - Hello folks, I would be very grateful if someone could assist me with this problem. I have been having an issue getting this query to display correctly. This is basically some geological drillhole data being captured by depth intervals. A user request came in for having this displayed in single 1 meter intervals. A tally […] |
timeout in vs for ssas tabular deploy is 0 but i still timeout deploying - hi we run 2019 std but i'm testing this on 2016. following some old notes and starting from the debug tab in vs, i picked options, went to bi developer and set the properties you see below. but i still get a timeout on each line of the process when deploying as shown in the […] |
Table variable declared within cursor persists across loop iterations - If you run this code it creates a 2 row cursor loop. Within the cursor the temp table @spec is declared and inserted into (as the output of a select). What was unexpected for me is in the second iteration of the loop the temp table contains 2 rows. The "solution" to this issue I'm […] |
SQL Azure - Administration |
Looking for a Recommended Azure SQL Managed Instance Book - Can anyone recommend an Azure SQL Managed Instance book? I'm looking for information about "care and feeding," best practices, etc. |
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 […] |
SQL Server 2022 - Administration |
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 […] |
Page could not be moved - Hello Everybody, I have a database on which I try to empty a file and get rid of it. But I get this error: Cannot move all contents of file "databasename" to other places to complete the emptyfile operation. DBCC SHRINKFILE: Page 9:7748583 could not be moved because the partition to which it belonged was […] |
SQL Server 2022 - Development |
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 ( […] |
SQL-CTE reqursive query - I have table TicketNumbers i TicketNumber UID 2 10 09901a22c7c3acc6786847c775f1d113 6 5 00dad28bef21f916240d6e8c1c1bd67d 12 20 00dad28bef21f916240d6e8c1c1bd67d I need to produced 35 rows (UID also must be present in result) for the same rules: 10 sequence number started from 1 (row i=2) than next 5 […] |
Multiple processes accessing the same table. some to write others to read / Lock - Dears, Hope this message finds you well We have a log table which is used at same time by some processed to read and others to write. This is causing deadlock What can we do to secure that we end up with deadlocks? Shall we shift the isolation level on the read queries or something […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |