|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Data Analytics Classification I | |
If I am searching for the answers to question about why something happened, what type of data analytics activity am I performing? | |
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) |
Checking the Type Code What is wrong with this code? CREATE OR ALTER TYPE LocationParameter AS TABLE ( LocationName VARCHAR(50) , CountryCode CHAR(3) , INDEX IX_CountryCode ( CountryCode ) ); GO Answer: There is no CREATE OR ALTER syntax for TYPEs Explanation: You cannot alter a user-defined type. There is only CREATE syntax. There is no ALTER syntax, either. You can add indexes, and commas or schemas are the same as any other statement. Note: There is a feedback item for voting to get this fixed. |
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 |
Migrating 2012 database to 2017 instance - compatibility level question - Hi Restoring a backup of a 2012 database to 2017 instance and will copying over logins and Jobs using scripts, just wondering what I do with compatibility level of the database once its restored over to the 2017 instance. thanks in Advance Caz100 |
SQL Server 2016 - Administration |
how can I get param passed to specific SP procedure - Hello, I'm looking to optimize Store procedures which run hundreds of times in a day and see if I can optimize them in anyway by checking there execution plan and code. I have sample param for couple of SP..but how can I get param used for running any store procedure. There should be some trace […] |
MEMORY_ALLOCATION_EXT - I have a sql2016 (Std) VM box with 16gig of memory when I run the posted query I see this wait type, and wondering how to research more what I'm seeing and how to fix. The queries are select statements in the "executing SQL". Sql is using around 9gig and 11gig is allocated of the […] |
SQL Server 2016 - Development and T-SQL |
lead and lag records - Hi Expert, I am facing multple 0 value records and needs only expired and active records i.e. 0 ,1 for below table. Added sample table for your reference div idCustomerID Div_Status LogDate -1 -1 0 18-01-2022 -1 -1 0 19-01-2022 -1 -1 0 20-01-2022 -1 -1 0 22-01-2022 -1 -1 0 23-01-2022 -1 -1 1 […] |
Slowness in query of target data - Hello experts, I'm trying to write a query to convert event session target data to a more readable SQL recordset, following this Brent Ozar example, among others: https://www.brentozar.com/archive/2015/01/query-extended-events-target-xml/ I set up an event session to capture the TLS version used for client connections based on the info here: https://www.sqltreeo.com/docs/find-out-which-tls-version-is-used-for-sql-server-connections -- Insert data into temp table. […] |
SQL Server 2019 - Administration |
Proxy accounts failing to authenticate intermittently - We've recently moved a couple servers to SQL 2019 running on Windows Server 2019, these were previously on SQL2016/Win2016. We started getting jobs that failed to start due to authentication issues with proxy accounts (credentials). Only happens once a day or every few days. Not related to any specific job or proxy account and not […] |
Log shipping broken after application upgrade - I have a weird situation regarding log shipping. We back up the databases on our production database server every hour, and then restore to our reporting server. This has been running for years. Last weekend, we upgraded our accounting system, and afterwards, log shipping stopped on the databases that the accounting system users. There is […] |
SQL Server 2019 - Development |
Data visualization tool - Hi everyone I am looking for a good data visualization tool to see my data. I do not want a pay per month type of product. I am ok with paying for a perpetual license or free. Can someone help me with some product suggestions? Thank you |
Join of dates field of 1 table and add +7 days to join to a different table - I have two CTEs. From one UDT_CKB_SNAPSHOT I am taking Event Names, from the 2nd CTE called FCSTPERFSTATIC I am taking Forecast and Actuals. I connect those two tables on Unit#, Location and Startdate. And everything is correct. However, I need to add 2 more columns namely 'Forecast for the 2nd week' and 'Actuals […] |
What am I doing wrong with this subquery? - I am trying to return all values from the lookup table to columns on the same row for the Diagnosis code. Here is my query: SELECT distinct a.accession_no as "Accession Number", (ISNULL((select m.code from medical_code m where ai.icd9_id = m.id and ai.sort_ord = 1), '')) + '~' + (ISNULL((select m.code from medical_code m where […] |
cursor not getting next values - I've built this cursor to build a new diagcode from all the values in the cursor. The cursor is working in the sense that it's looping, but it's not getting the next "code" or value in the list. What am I doing wrong? Note: I am selecting a list of codes. then I have declare […] |
populate a table with new data set but keep the original identity column values - I have a table like below, I would reset the values in the table with some fake addresses. I have already have the fake addresses ready without identity columns. But I would keep the original addressID in the table, so that other table use it as FK still works. Basically I want to keep the […] |
Reporting Services |
How to group the data by student name and display data in multi level - I am having the data as follows DECLARE @Student TABLE ( StudentId INT, StudentName NVARCHAR(200), StudentRollNo NVARCHAR(20) ) INSERT INTO @Student VALUES (1, 'GDOVFKMIZS', 'S12345'), (2, 'QXAKWOYMRZ', 'X1256') DECLARE @StudentHistory TABLE ( StudentId INT, Remarks NVARCHAR(500), StartDate DATETIME, EndDate DATETIME ) INSERT INTO @StudentHistory (StudentId, StartDate, EndDate, Remarks) VALUES (1, '2021-01-01', '2021-03-28', 'Test Remarks'), (1, […] |
SSRS Long Text 2 Column report with some variables - I need to design what looks like a simple report. However, it's 29 pages or so, 2-column, with a few variables mixed into the long text with various formatting throughout. It seems simple enough. However, I'm not sure how to even begin. I have the data set setup without issue. I also have my parameters […] |
Design Ideas and Questions |
Need some example or answer for this doc - Need answer or data sample for this exam CMSC424 - Database Design SQL Assignment (Parts A and B) Fall 2007 (TENNIS DB SCHEMA) I trying test some tennis db like this doc, if someone has example with data test sample for test. https://ufile.io/dih6vn9a |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |