|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Generating a Series I | |
What is returned by this code in SQL Server 2022? SELECT value FROM GENERATE_SERIES(4, 1); | |
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) |
The Trigger Updated Column(s) In a trigger, I can use UPDATE() or UPDATED_COLUMNS() to determine which columns were changed. For these functions, which one accepts a column name as a parameter? Answer: Only the UPDATE() function Explanation: Only the update function accepts a parameter. It is the column to check. Ref: |
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 - Development and T-SQL |
Insert bulk fails when Online Index Rebuild is done - Hi, We are getting issue of Insert bulk failed due to schema change of target table. We had created a job to check if fragmentation of table > 30% then to rebuild index online whilst bulk insert is happening in that table. We have around 3 transaction tables in which bulk insert happens and at […] |
SQL Server 2019 - Administration |
Urgent, Please Help. Named Instance Question - Hello all, I just installed a new named instance on SQL Server 2019 RTM-CU32. The installation was successful but when I connected to the new named instance, it had all the databases and data from the default instance. I looked at the properties of a couple databases and both instances (default and named) point to […] |
Best/easiest way to import an SSIS package... - Folks, Looking for advice on the best way to import a package. I hope I'm in the right location! Apologies if I'm not. I inherited a system (Sql Server 2019) with an existing SSIS package. The installation notes indicate that you have to be on the server using SSMS v18. The installation notes indicate: 1. […] |
balancing numa nodes - Can anybody advise on how i go about balancing threads to each node. As you can see from the below screen shot node_id 2 & 3 and 6 & 7 are offline (another query i ran shows them as OFFLINE VISIBLE). This is sql2019 STANDARD so limited to 48 online schedulers which are currently spread […] |
Question about updating statistics - We have very large tables in our database, some even more 1 B records, so updating statistics will take many hours. Would it be a good idea to skip those tables that have ratio of modified records to total number of records less than 0.5 percent? That's because number of buckets in statistics histogram is […] |
SQL Server 2019 - Development |
SSIS raw file conversion - Hi, Does anyone know how to handle a raw data file where some rows contain carriage return characters? The problem is that certain rows, which should be treated as a single line, are being split into multiple lines due to embedded carriage returns in the file. The file was exported using isql from Sybase, not […] |
Error converting data type varchar to float - Hi everyone I have a bunch of CSV files that I need to import into SS using BULK INSERT. One file works fine. The other fails. Both have the same setup...there is one column that has no data in it so there is only a column header. I used the logic from the CSV file […] |
How to convert this to datetime format? - hi everyone I have a CSV that is storing date as "20180919T201400+0000". I am using BULK INSERT to import the file. How do I convert varchar "20180919T201400+0000" to a datetime format that SS can understand? My attempt: CONVERT(VARCHAR(25),REPLACE(ANNOUNCE_DATETIME,'"',''),126) AS ANNOUNCE_DATETIME Error: Conversion failed when converting date and/or time from character string. Thank you |
telephones and sql - hi im pretty sure i could trigger a page on a pager if i had to from t-sql. but triggering a phone call doesnt appear to be as easy. does the community know for sure? perhaps of an approach that doesnt require i bring python , 3rd party software , maybe clr etc into the […] |
Problem with CASE statement - Hi Everyone I have used CASE many times but not sure what I am doing wrong here. SS won't accept it. What am I doing wrong? How can I fix it? SQL ALTER PROCEDURE [dbo].[WIP_UpdateEvents] (@FILENAME varchar(200), @RECORD_ADD_DATE datetime) AS DECLARE @FILEPATH VARCHAR(200) SET @FILEPATH = @FILENAME DECLARE @RECORD_ADD_DT varchar(26) SET @RECORD_ADD_DT = convert(varchar(26),@RECORD_ADD_DATE,121) DROP […] |
Strategies and Ideas |
Measure duplicating its value when non-conformed dimension attribute is included - Hi, I have two fact tables (say FactA, and FactB), that are joined/shared by three dimensions (dimA/B/C) in-between the two fact tables (conformed dimensions). Fact A contains a list of finance agreements. FactB contains budgeted sales figures, so we have a figure for each month, for each product, for each sales channel. There is […] |
T-SQL |
T-SQL - except - add date column - SELECT [A] --,[Date] , ,[C] ,[D] ,[E] FROM [Database].[dbo].[Table] where B = getdate()-4 AND CheckDate |
T-SQL - except - add date column - . |
SQL Server 2022 - Administration |
Force Strict Encryption - SQL Agent fails - Hi, On my SQL 2022 (16.0.4195.2) test environment, I tried to enable Force Strict Encryption. To do this: - I generated a certificate using ps script : $newCertificate = New-SelfSignedCertificate -CertStoreLocation cert:\LocalMachine\My -DnsName "DEV-SERVER.domain.local","DEV-SERVER" -FriendlyName "Cert_Test" -KeySpec KeyExchange -Provider "Microsoft RSA SChannel Cryptographic Provider" -TextExtension "2.5.29.37={text}1.3.6.1.5.5.7.3.1" # Convert the report server password to […] |
SQL Server 2022 - Development |
High Availability Reversed - Force secondary unless failure - Hi I have sql2022 in H/A with a primary and a secondary server. My problem is that I have a query that I need to force it to run the secondary. But I need to point to the listener in case of failover, which is always pointed at the primary. Is there any kinda of […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |