|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
A Strange View | |
I have a table that is defined like this:
CREATE TABLE [dbo].[OrderLineItem] ( [OrderLineItemKey] [int] NOT NULL, [OrderID] [int] NOT NULL, [OrderLinenumber] [smallint] NULL, [qty] [int] NULL, [unitcost] [money] NULL, [linetotal] AS ([qty]*[unitcost]) ) ON [PRIMARY] GOI want to create a view of just a few of these columns, and I type this: CREATE VIEW dbo.MyView AS SELECT OrderLineItemKey , OrderID , OrderLinenumber , qty , unitcost linetotal FROM dbo.OrderLineItem AS oli GOWhat happens with this view? | |
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) |
RANKX Ties What values can I use for the RANKX() "ties" parameter? Answer: Dense and Skip Explanation: The two values are Skip and Dense. This determines if the number ties are counted when determining subsequent values or if all ties are counted as a single value. Ref: RANKX() - https://docs.microsoft.com/en-us/dax/rankx-function-dax |
Featured Script |
dawaller from SQLServerCentral This script on missing indexes that SQL had found. SQL will track queries and provide suggestions on indexes it feels will provide improvements. You should not take this information and create all the indexes. Performance tuning can be an art and takes practice. This information should be reviewed and as a DBA implemented a little […]
|
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 |
Replicatio DB issue - Hi Team , We have Prod publisher database and subscription database using the transaction replication .Last week one of prod application were completely slow due to bad query .So we recreate the query and tested in publisher , it was taking 14 sec meanwhile our developer has executed same query on Subscription database , […] |
SQL Server 2017 - Development |
Column total using group by rollup - I'm trying to total all the rows but one in a column using group by rollup in SQL Server. I'm getting the below which is correct for all the columns but I'd like to removed the RTF Total-224549.33. Is there a way to have a case statement in the group by rollup or what other […] |
Integration service and OLE DB provider Microsoft.ace.oledb.16.0 is not register - Hi to all. I'm in trouble. I want to create an Integration Service project in Visual Studio 2017. I've already installed Microsoft Access Database Engine 2016 Redistributable x64. So when I add a new Excel source type with an OLEDB connector Visual Studio tells me "OLE DB provider Microsoft.ace.oledb.16.0 is not registered". I tried to […] |
How create a report based on column value change - I have been asked to create a report based on when a column gets updated with the row and date it was updated. what is the best way to create the report. Table has about 3 million rows and the column report is created on is INT. Thanks in advance. |
SQL Server 2016 - Administration |
TempDB full - Hello, When the temp db is full ( due to a temp tbl) my learning has been you can drop the temp tbl by going to the tempdb - temp tbls - right click - dropNow, this was done to resolve the issue by dropping the Temp table. I was wondering if dropping the temp […] |
SQL Server 2016 - Development and T-SQL |
Question regarding decimal field - Dear All I have a question regarding decimal field, i have set field to DECIMAL (18,2) and it looks like this, is there a way to separate thousands with dot(.), so that number looks like 9.090,00 in column. It is a pretty big table and when i got the results after SUM i get unclear […] |
Administration - SQL Server 2014 |
Tracking Connections To a Database - I'm trying to come up with a way to track the history of connections made to one database without setting up a trace or having a job run every minute. So far I've been focusing on the sys.dm_exec_sessions and sys.dm_exec_connections DMVs and each offers some of what I'm looking for (ID, host name, time) but […] |
SQL Server 2019 - Administration |
How will one setup a SQL FCI on WSFC with Windows Core ? - Multi Subnet WSFC of 4 Nodes 2 Nodes in primary DC and other 2 in DR Center. Idea is to set up failover cluster instance here in Primary DC and another at DR Center . and Setup an AOAG in async mode. Please criticize it if there are any gotchas. Please guide me here. Even […] |
rows Issu - Hello Team, I have 2 Tables A and Tables B.In Table A i have 3 rows(1,2,3) and Table B i have 3 rows(4,5,6).I need to get all the rows but i need to have single cloumn.Please advise Thanks in advance RK |
How do I use cascade delete with SQL Server? - I have 2 tables: T1 and T2, they are existing tables with data. We have a one to many relationship between T1 and T2. How do I alter the table definitions to perform cascading delete in SQL Server when a record from T1 is deleted, all associated records in T2 also deleted. The foreign constraint […] |
SQL Server 2019 - Development |
sum of sales 2 dates - if object_id( 'tempdb..#anchorj') is not null begin drop table #anchorj end create table #anchorj ( ID varchar(10),anchor sales date date) User ID Sales Date S12 3/12/2015 S13 4/5/2017 S14 2/15/2016 S15 1/1/2017 S16 5/4/2014 S17 3/24/2017 S18 2/6/2015 S19 4/18/2017 S20 6/2/2015 S21 7/5/2016 S22 8/2/2015 S23 8/2/2018 Select Distinct User ID, sum ( sales_amt) […] |
Sync data between Two databases - Hi All, This is sampath i am new to sqlservercentral community,i am begginer in sql related queries please help me to achieve. I have two databases in same server assume Realtime database and Backup database these two databases contains 25+ tables. i have done insert/delete/update in Realtime database automatically Backup database should be updated. Is […] |
SSRS 2016 |
Font renders correctly online, but not when exported to PDF or Excel - Hello, I'm having a problem with Wingdings/Wingdings 2 in SSRS reports exported to PDF or Excel (haven't tried other export formats). In my report I set the cell value and FontFamily from the dataset, i.e.; Value FontFamily * Wingdings P Wingdings 2 and it renders correctly online (*/Wingdings = envelope, P/Wingdings 2 = check mark); […] |
Analysis Services |
The 'Tabular View' feature is not included in the '64 Bit Standard' edition of - Hi , I am getting the error below when i want to process the cube.Please help me if anyone came across this before. "Errors related to feature availability and configuration: The 'Tabular View' feature is not included in the '64 Bit Standard' edition of Analysis Services" I am running sql 2014 standard and visual studio […] |
COVID-19 Pandemic |
Daily Coping 16 Apr 2020 - Today's tip is to put your worries into perspective and try to let them go. No easy to do, but here are my thoughts: http://voiceofthedba.com/2020/04/16/daily-coping-16-apr-2020/ |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |