|
|
|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Waitfor Threads | |
I have some code that uses a WAITFOR in it. When a lot of people call this code, what happens with the threads associated with the calls? | |
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) |
OPENROWSET DNR This file in this code doesn't exist, but can I compile this code, with deferred name resolution working for OPENROWSET? CREATE PROCEDURE MyOpenRowSetTest4 AS BEGIN SELECT * FROM OPENROWSET(BULK 'd:\downloadedfiles\filethatdoesntexist.txt', SINGLE_CLOB) MyFile END Answer: This works fine Explanation: This works fine. The compilation process doesn't cause issues here. Ref: OPENROWSET - https://learn.microsoft.com/en-us/sql/t-sql/functions/openrowset-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 2017 - Administration |
reads for DMVs - Hi All, I have created a test table with rowsize ~8K. I have inserted 2 rows and when I read data from the table, then it essentially has to show me 2 logical reads but it showing 6. why is it so? Am I missing anything? Second question is why sp_whoisactive is showing this spid […] |
SQL Server 2017 - Development |
Tracking of Accounts data and Stored procedures - Please find my sample db here:https://drive.google.com/file/d/1_8JWxOrAdKEz1dxKITnqW3HZr1GTBgB9/view I have a DB that I would like to track account movements(I created an "Accounts" table) I also want to track "AccountsCommisonHistory"(I also created this table). I created an "Accounts_daily_snapshot" and "CommisionGroups" table, but it contains no records as in the above tables. Where is the error in my […] |
SQL Server 2016 - Administration |
Failover in Availability Group wipes data from sys.dm_db_index_usage_stats - Im using Brent's sp_blitzIndex results and storing them to prevent any loss during a restart. I found that when a failover occurs on a 2016 and 2019 AG that this table gets reset on the server that was Primary and is now a secondary. Is this expected? My assumption was that these tables only lost […] |
SQL Server 2016 - Development and T-SQL |
How to add couple more conditions to the query - Good Morning, Can you please advise how to add these 2 additional filters to the below query, i tried but didnt work. 1)All Colleges under municipal_ID 4269005 were excluded from the output (below query results). That MUNICIPALITY should still be included but we want to make sure the College ID 88 under […] |
Excel style Contains filter - Hi, I am trying to do Excel style "contains" in SQL, but doesn't work. There are two forename fields in my two tables. I would like to know if first forename is "contained" in second forename field or vice-versa. The name can be anywhere in the other column. Basically identifying individuals who put in their […] |
Development - SQL Server 2014 |
Bad data - updating date from new FK - Hi, Our DB vendor is now implementing a new FK. This new FK is not going in due to duplicates - The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.PractitionerInsurance' and the index name 'UX_PractitionerInsurance_PractitionerID_CarrierID_TypeID_Policy_EffectiveDate'. The duplicate key value is (43246, 96146, 13261, K1510, Aug 9 1988 […] |
SQL Server 2019 - Administration |
Rebooting secondary replica of AG causes some databases to stop synchronizing - Rebooting secondary replicas should be non-impactful, but starting about 6 months ago we pretty consistently see a handful of databases that fail to synchronize post-reboot. Background: Each of our SQL cluster nodes hosts 6 AGs, and each AG has around 50 DBs Definition of 'handful' - most recently, we rebooted 8 secondary nodes and had 15 […] |
Database Backup Encryption & Recovery - What happens if a server "Dies" and a new server needs to be rebuilt, using encrypted backups ? If I create a master key CREATE MASTER KEY ENCRYPTION BY PASSWORD = '' Then create a certificate CREATE CERTIFICATE MyTestDBBackupEncryptCert WITH SUBJECT = 'MyTestDB Backup Encryption Certificate' Then backup my database WITH ENCRYPTION (ALGORITHM […] |
SQL AlwaysOn configuration completely disappear - Hi, I've SQL 2019 STD with CU16 on Win 2019 STD. i had some ESXI host unresponsive for 5 sec and the SQL AlwaysOn become completely malfunction that both my SQL Server the databases that are part of the AlwaysOn are i the state of restoring. the "funny" thing is that the AlwaysOn configuration completely […] |
I need to import v7r3 ibm i (as400) info to a sql 2019 database - I need to import as400 data into sql 2019 database. In Sql i can run a linked server to access the as400 data fine. When i look for the same data source to copy all the data to a database, i don't see the one i need, any help would be fantastic. |
SQL Server 2019 - Development |
Inserting data into Physical Table on Azure Taking Longer Than Expected - We have an issue on Azure with inserting data into a physical table . We have done some benchmark testing and we are finding that inserting to a physical table on Azure, is taking 4 times longer compared to using a User Defined Table Type or Temp Table I wanted to know why this might […] |
SQL Azure - Administration |
Need Suggestion: Does Blocking Has Affect On High DTU Utilization ? - Hi, Does blocking has affect on High DTU utilization ? (some people advocate that Spike in DTU might be caused by high number of blocking processes , or long term blocking) DTU definition select convert(decimal(18, 0),AVG([avg_DTU_percent])) from (SELECT (SELECT Max(v) FROM (VALUES (avg_cpu_percent), (avg_data_io_percent), (avg_log_write_percent)) AS value(v)) AS [avg_DTU_percent] FROM sys.dm_db_resource_stats WHERE end_time>=DATEADD(MINUTE, -10, GETUTCDATE())) […] |
General |
SQL to set date/time period to 1600-1559 (dynamic) - Hi I have a View that shows orders entered into a system using GETDATE(). However, I need it to show all orders entered between 1600 and 1559 as the 24 hour period. This then displays in a spreadsheet So at 1610 today it would just show anything entered since 1600 today And at 1559 […] |
SQL Server 2022 - Development |
Domain Extension Splitting Based on Dot(.) - Hi All, I need to extract the domain extension from the column based on dot(.) like the below |
simple query question - hi all, I have a simple question: having a table where I have multiple orders for any number of vendors and a table with orders and amounts, how do I write the query that sums up the amounts by vendor. I tried: select vnd.VENDOR, sum(ord.Amount) as sumAmount from TBL_Vendor vnd inner join TBL_Orders ord on […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |