|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
The Number Subquery | |
I have this data in a table:
gapID ----- 1 2 3 4 6 7 8 10 14 15 16 17If I run this code, what values are returned? SELECT gapID FROM gaps AS g1 WHERE NOT EXISTS (SELECT gapID FROM gaps AS g2 WHERE (g2.gapID = g1.gapID - 1)) ORDER BY gapID | |
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) |
Container Images I've installed Docker on my Windows workstation. I want to get a list of the images that are downloaded to my local machine from which I can create containers. What command should I run? (choose 2) Answer: docker images, docker image ls Explanation: Either "docker images" or "docker image ls" will work. "Docker image" will give you help asking for another command. 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 2017 - Administration |
SQL Server Collation - I have 2 node in an availability group which has been configured for the wrong collation. Now, I would like to change the server collation. No user db's are attached. So I am thinking to remove the availability group and then re install the sql server with right collation on the same server. Is that […] |
Does creating memory-optimized tables require a lot of extra DBA support? - if I make 2 largest tables in our most transactional database a memory-optimized table with a columnstore index. or just a memory-optimized table -- how much additional DBA tasks/maintenance/awareness (of what?) should be expected? Compared to regular tables. And 2nd scenario: if we do same to all 50 tables (smallest is 2 million rows) in […] |
SQL Server 2016 - Administration |
Identify Indexes hurting performance - Is there a way of knowing Indexes: Which are not being used/used rarely ? Which are hurting performance ? Are there any predefined benchmark to mark an index as "good or bad or unused" ? Can we automate this process of identification. Ex:Like generate a weekly report of these 'bad' indexes. Thanks |
SQL Server 2016 - Development and T-SQL |
SQL 2016 - Need help with complex calculations based on paycodes ! - Hello Friends, I 'm in need of some SQL help please, I have SQL examples below with the following conditions: All REG plus SICK hours cannot exceed 40 hours in that week. The calculation for REG hours is: total no. of hours in a Cost Center Divided By Total REG Hours regardless of Cost Center […] |
SQL Server 2012 - T-SQL |
Dynamic Alert query - Hello, I have a requirement to send an Alert based on Silo Level data , when it hits <= 30% This is more a process design question....I've created a view of silo level data, which is called by a Power automate flow, scheduled every hour to run. which is working well. except the problem now […] |
SQL Server 2019 - Administration |
SQL 2014 and above the Agent job text logs - how to redirect? - For each of our backup jobs in SQL, they are management jobs as SSIS, when they run they create text log files each datecoded. How/where do I make the change to redirect them (each job individually) to a different drive/folder? I looked at the SSIS package, the Agent job itself but can't find it. […] |
extended events bulk copy process - Trying to setup an extended event to capture bulk copy process. Was able to successfully capture some external applications but when I run manually the bcp command on server, the event is not captured. Also, when run on ssms the bcp command using xp_cmdshell it fails to capture the event. Not sure what I am […] |
SQL Server 2019 - Development |
XML Parsing Problem - I need to parse the following XML file into columns and rows: 147 1 A 2 1 A 13 I am using this query: SELECT Data.Col.value('(./PartyID)[1]', 'int') As Party_ID, Data.Col.value('(./CampaignID)[1]' , 'int') As Campaign_ID, Data.Col.value('(./Arc)[1]', 'varchar(1)') As Arc, Data.Col.value('(./TicPosition)[1]', 'varchar(10)') As TicPosition FROM @UsageFile.nodes('/PartyID/CampaignID') As Data(Col) […] |
Database alert if no data added - Hi friends, I’d like to have your help. I have a SQL Server database, and a table dbo.OnData on it. I would like to receive an email alert from my database if: - within a range of 30mins from 8:00:00 a.m. opening time and default time per day - AND 30mins after the time of […] |
Inserting a words from a range randomly into a table - Im in the process of creating test data Now I have a field in the test data called SerialNo this has the following allowed values '111111','222222', '333333','444444','555555','666666' Now I want to be able insert rows randomly into a target table which can take any one of the values above but im not sure how to […] |
How to find unique values in a table - Hello trying to find unique values on the following table First temporary table query (Master Data) insert into #tempCOO select sk.CountryOfOrigin,im.partnumber,sk.Quantity,sol.id,lp.id,lpl.id,so.id,p.SerialNumber FROM sk join lpl on sk.LoadPlanLineId = lpl.id join lp on lp.id = lpl.LoadPlanId join sol(nolock) on sol.id=lpl.SalesOrderLineId join so on so.id=sol.SalesOrderId join im on im.id = sol.itemmasterid join pd on pd.content = sk.batchnumber […] |
General |
Variables - DECLARE @Var1 INTEGER = 12 DECLARE @Var2 SYSNAME = '@Var1' Is there any way to get 12 from @Var2? Thanks! P |
Powershell |
Load .sql from folder - I'm using this process to load a folder full of .sql files there are Stored Procedures that I would like to add to a Newly created DB. It runs into errors but doesn't log with .sql file it had a problem loading. Any help finding which ones loaded and which failed in some sort of […] |
MySQL |
How to normalize? - Hello, friend. Excuse my bad English I'll try to explain my question. So, there is an example of database below. Currently i'm working on a bit more complicated DB, and i have created this example just for better (and fast) understanding of essence of the task. Imagine : we have some store.. In this […] |
Microsoft Access |
ODBC and use of output clause - i am at a loss and this is only forum that i know of. i am using AcuXDBC (genesis odbc) and am needing to gather output of a insert statement. i have tried to use insert into tablea values ('record one') @output record_number but i get a syntax error no matter what i try regarding […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |