Laden...
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Avoiding Exchange Operators | |
Which type of query processing mode can operate on compressed data and avoid the exchange operator? | |
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) |
Logical Operators I have this table and data: CREATE TABLE ProdList (ProductID INT NOT NULL , ProductName VARCHAR(100) , ProductCategory VARCHAR(40) , ProductSize VARCHAR(4) , ProductColor VARCHAR(20) ) GO INSERT dbo.ProdList (ProductID, ProductName, ProductCategory, ProductSize, ProductColor) VALUES (1, 'Dirt Bike', 'Bike', '26', 'Blue'), (2, 'Mtn Bike', 'Bike', '26', 'Red'), (3, 'Dirt Bike', 'Bike', '24', 'Blue'), (4, 'Downhill', 'Ski', '180', 'White'), (5, 'Telemark', 'Ski', '175', 'Blue'), (6, 'Snowboard', 'Ski', '182', 'Various'), (7, 'Goggles', 'Ski', 'L', 'Clear')How many rows are returned from this code: SELECT productid, pl.ProductName FROM dbo.ProdList AS pl WHERE pl.ProductCategory = 'Bike' OR pl.ProductCategory = 'Ski' AND pl.ProductColor = 'Red'Answer: 3 Explanation: This code returns 3 rows, all from the bike category. The precedence of logical operators means the AND is executed before the OR, which means the query is equivalent to this: SELECT productid, pl.ProductName FROM dbo.ProdList AS pl WHERE pl.ProductCategory = 'Bike' OR (pl.ProductCategory = 'Ski' AND pl.ProductColor = 'Red')Ref: Operator precedence - https://learn.microsoft.com/en-us/sql/t-sql/language-elements/operator-precedence-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 2016 - Administration |
system_health configuration - I'm on SQL Server 2016 (SP2-CU11-GDR) (KB4535706) - 13.0.5622.0 (X64) Dec 15 2019 08:03:11 Copyright (c) Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2012 R2 Standard 6.3 (Build 9600: ) (Hypervisor) Is there a way to change the lock timeout in System_Health GUI? In the u_table.sql it looks like it's seto […] |
SQL Server 2012 - T-SQL |
row changes per hour by TagID - I have a large table being written too every second with equipment (PLC) information. I need to figure out how much of this data is redundant using an hour window, so from 7am-8am how many different values did I capture per Tagid(Machine). I'm trying to figure out for floatvalue how many distinct values where recorded […] |
row changes per hour by TagID - I have a large table being written too every second with equipment (PLC) information. I need to figure out how much of this data is redundant using an hour window, so from 7am-8am how many different values did I capture per Tagid(Machine). I'm trying to figure out for floatvalue how many distinct values where recorded […] |
SQL Server 2019 - Administration |
Can CDC replicate data? - As far as I can tell all CDC does is capture and log data changes, can it also replicate like transactional replication? |
Linked Server Connection Issue - Hi all, I have 2 SQL servers on different domains (lets call them SQL-A and SQL-B), network connected via IPSEC vpn. DNS is not yet set up between the two networks, so I have amended the hosts file on SQL-A. On the machine running SQL-A, I can use SSMS to connect to SQL-B successfully. I […] |
High availability group synchronization - For high availability group, is there an option like transaction log shipping that I can choose the interval of time to synchronize the database. So for example , delay it to 30 minutes to synchronize. Thanks |
SQL Server 2019 - Development |
Sending messages on table rows updates/inserts/deletes to RabbitMQ from SQL Srvr - We have a requirement here. Whenever certain rows in a table are inserted, updated or deleted, we need to send messages to a message broker for further processing. Currently we are using triggers and SQL Server Service Broker for this purpose. But we want to use RabbitMQ for scalability and wider reach. Is there a […] |
Indexing strategy very long text strings - Hey guys, Just looking to see if anyone has any bright ideas how to solve this problem. Background I have been handed down a project to report on files that have gone 'missing'.. Ignoring the fact that are using the wrong tools for the job... I have a process which effectively writes the resutlts of […] |
Frustrated trying to get Cross DB Access by Signing SP with Certificate - Maybe it is lack of caffeine, but I cannot see why the following test code does not work. I keep getting: Msg 916, Level 14, State 2, Procedure dbo.TestTrunc, Line 7 [Batch Start Line 92] The server principal "XDBSignTest" is not able to access the database "db2" under the current security context. Can anyone see […] |
SSIS Execute Package Fail in SSMS but Agent Job Succeeds - Hello, I created a SSIS package to transfer data from an XML file to a database in SQL Server instance A. It works perfectly in Visual Studio. Then the SSIS package was deployed to SQL Server instance B. When I set up a SQL agent job and run as a proxy user "svcSSIS", it works […] |
Integration Services |
Not picking up a specific period - Please assist. I am trying to bring in Period 8 which i find myself in. Its available in the data. I just cant seem to bring it into the ETL. Source and SSIS is attached. |
Business Intelligence |
How to merge first 3 rows when exporting to excel - Hi All, I have a report when I export to excel must auto merge first 3 rows for columns (A to N), when the user opens the report , instead of the user doing it manually, is this possible. Please see the below screen shot. After exporting I manually did merge and center and named […] |
How to merge first 3 rows when exporting to excel - Hi All, I have a report when I export to excel must auto merge first 3 rows for columns (A to N), when the user opens the report , instead of the user doing it manually, is this possible. Please see the below screen shot. After exporting I manually did merge and center and named […] |
How to merge first 3 rows when exporting to excel - Hi All, I have a report when I export to excel must auto merge first 3 rows for columns (A to N), when the user opens the report , instead of the user doing it manually, is this possible. Please see the below screen shot. After exporting I manually did merge and center and named […] |
SQL Server 2022 - Administration |
SQL Server UCP - Hello everybody, I just read on the Microsoft homepage that SQL Server Utility Control Point is still available in SQL Server 2022 Entertrise Edition (https://learn.microsoft.com/en-us/sql/sql-server/editions-and-components-of-sql-server-2022?view=sql-server-ver16). I couldn't find it in the SSMS what so ever. |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. [email protected] |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Laden...
Laden...