| A community of more than 1,600,000 database professionals and growing |
| | Cool Projects This editorial was originally published on Aug 23, 2013. It is being re-published as Steve is on vacation. I had a conversation recently with a developer that was working on a rather neat problem. This had to do with a financial system and it involved some complex calculations and real time interactions with a variety of systems. It was important for their company, and a lot of pressure was on this developer to not only deliver this software quickly, but also to have it perform at a very high level. This particular person was using Red Gate's ANTS Performance Profiler to dig into their code, feeling pressure to make it as efficient as possible. However this developer was also enjoying the work. It was a challenge, and it was a cool project. I know this community is made up of people working in all sorts of industries, in a variety of roles. We develop many different kinds of software. Some may be for employers, some may be for ourselves, some may be for a side business, but across that spectrum of work, there are some interesting applications. What cool things are you working on? It might not be software. Perhaps you're working on an interesting data application, like a super collider. Maybe you work on some gaming software or a large hardware system. Perhaps you deal with a system that makes people's lives better, easier, or even possible. I'm sure more than a few of you work on some real time systems, which have all kinds of data challenges. Let us know this week what type of interesting work you're doing. Steve Jones from SQLServerCentral.comJoin the debate, and respond to today's editorial on the forums |
|
| ADVERTISEMENT | | How do you manage sensitive data? Redgate's Foundry team are researching data discovery and classification. Fill out this short survey if you think you can help, and at the end you'll be entered into a prize draw. Fill out survey |
| | Could your SQL coding be more efficient? Data Platform MVPs and SQL Server experts share their tips on how to standardize formatting whilst stripping out the repetition of coding with SQL Prompt. Over these 20 short videos we will help you write better, shareable SQL faster. Check out the tips |
|
|
|
| | | Gregory Larsen from SQLServerCentral.com In SQL Server there are 4 different ranking functions: RANK, DENSE_RANK, NTILE, and ROW_NUMBER. These ranking functions were introduced in SQL Server 2005. In this stairway level I will be reviewing each of these different ranking functions, and will show you how to use them by providing a few examples. More » |
| Before Excel and other data-linked spreadsheets, business reports needed to be hand-crafted by IT experts, and changes were arbitrated slowly via change control. Power BI was designed to take the liberation that Excel pioneered to the max, by allowing 'power' users to not only to create Power BI desktop reports, graphics and visualisations in Power BI App, but then link and publish these to the Power BI app. These in turn can be given row level security and have their underlying data kept up-to-date so that users can log in and see the relevant and appropriate data in a browser. Saurabh Desai shows how. More » |
| David Postlethwaite from SQLServerCentral Blogs Introduction By David Postlethwaite Ensuring that your databases can survive a major outage such as a server failure and can continue to... More » |
| Andy Galbraith from SQLServerCentral Blogs This is the first in a new series of blogs I am going to create talking about useful tools (mostly... More » |
|
|
| | Today's Question (by Thomas Franz): Which of the following SELECTs will return a line (select 9)? CREATE TABLE #test (id INT IDENTITY, some_stuff SQL_VARIANT); INSERT INTO #test (some_stuff) VALUES ('hey') INSERT INTO #test (some_stuff) VALUES (123) GO SET NOCOUNT ON; DECLARE @stuff SQL_VARIANT; /* 1*/ SET @stuff = 'hey'; SELECT 1, t.some_stuff FROM #test AS t WHERE t.some_stuff = @stuff /* 2*/ SET @stuff = '123'; SELECT 2, t.some_stuff FROM #test AS t WHERE t.some_stuff = @stuff /* 3*/ SET @stuff = 123 ; SELECT 3, t.some_stuff FROM #test AS t WHERE t.some_stuff = @stuff DECLARE @string VARCHAR(3); /* 4*/ SET @string = 'hey'; SELECT 4, t.some_stuff FROM #test AS t WHERE t.some_stuff = @string /* 5*/ SET @string = '123'; SELECT 5, t.some_stuff FROM #test AS t WHERE t.some_stuff = @string /* 6*/ SET @string = 123 ; SELECT 6, t.some_stuff FROM #test AS t WHERE t.some_stuff = @string /* 7*/ SET @string = 'hey'; SELECT 7, t.some_stuff FROM #test AS t WHERE t.some_stuff = cast(@string as sql_variant) /* 8*/ SET @string = '123'; SELECT 8, t.some_stuff FROM #test AS t WHERE t.some_stuff = cast(@string as sql_variant) /* 9*/ SET @string = 123 ; SELECT 9, t.some_stuff FROM #test AS t WHERE t.some_stuff = cast(@string as sql_variant) /*10*/ SET @string = 'hey'; SELECT 10, t.some_stuff FROM #test AS t WHERE CAST(t.some_stuff AS VARCHAR(3)) = @string /*11*/ SET @string = '123'; SELECT 11, t.some_stuff FROM #test AS t WHERE CAST(t.some_stuff AS VARCHAR(3)) = @string /*12*/ SET @string = 123 ; SELECT 12, t.some_stuff FROM #test AS t WHERE CAST(t.some_stuff AS VARCHAR(3)) = @string /*13*/ SET @stuff = 'hey'; SELECT 13, t.some_stuff FROM #test AS t WHERE CAST(t.some_stuff AS VARCHAR(3)) = @stuff /*14*/ SET @stuff = '123'; SELECT 14, t.some_stuff FROM #test AS t WHERE CAST(t.some_stuff AS VARCHAR(3)) = @stuff /*15*/ SET @stuff = 123 ; SELECT 15, t.some_stuff FROM #test AS t WHERE CAST(t.some_stuff AS VARCHAR(3)) = @stuff |
Think you know the answer? Click here, and find out if you are right. We keep track of your score to give you bragging rights against your peers. This question is worth 2 points in this category: SQL_VARIANT. We'd love to give you credit for your own question and answer. To submit a QOTD, simply log in to the Contribution Center. |
|
|
| |
ADVERTISEMENT | Introducing Microsoft SQL Server 2016: Mission-Critical Applications, Deeper Insights, Hyperscale Cloud With Microsoft SQL Server 2016, a variety of new features and enhancements to the data platform deliver breakthrough performance, advanced security, and richer, integrated reporting and analytics capabilities. In this ebook, we introduce new security features: Always Encrypted, Row-Level Security, and dynamic data masking; discuss enhancements that enable you to better manage performance and storage: TemDB configuration, query store, and Stretch Database Get your copy from Amazon today. | e | |
|
|
|
|
|
| Yesterday's Question of the Day |
| Yesterday's Question (by Steve Jones): I've got this code: WITH myTally(n) AS (SELECT n FROM (values (N' '),(N''),('2^2') ) a(n) ) SELECT top 10 TRY_CONVERT(INT, n) , ISNUMERIC(n) FROM myTally Of the three rows, how many can be converted with TRY_CONVERT to an integer, and return a 1 from IS_NUMERIC()? Answer: 0 Explanation: Only two of these rows can be converted to an integer with TRY_CONVERT(). The row with "2^2" returns NULL, so it isn't converted. IS_NUMERIC, however, sees none of these values as numeric. Ref: Is It Time To Stop Using IsNumeric()? - click here ISNUMERIC - click here TRY_CONVERT - click here » Discuss this question and answer on the forums |
|
|
| Database Pros Who Need Your Help |
| Here's a few of the new posts today on the forums. To see more, visit the forums. Index-Filegroup (how many Files) - Hi, I have created an index filegroup (NonClustered) on a separate device. How many files do you recommend for this index... SQL 2016 SP1 CU2 - sudden and unexplained shutdowns - Hi there, Anyone had problems with unplanned instance shut-downs on SQL 2016 SP1 CU2? We patched our Data Warehouse to CU2 in... Explicit value must be specified for identity column in table 'TABLEA" either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column. - I keep getting this error even if had my identitycolumn explicity mentioned. Explicit value must be specified for identity column in... query to track columns which are encrypted via Symmetric Keys - Hi, Any query to track columns which are encrypted via Symmetric Keys? Thanks Successful jobs got failure notifications - I've got some very puzzling job failure notifications for scheduled jobs that actually ran successfully. These jobs have been running... Inner/Outer Join - I want to select all the columns from tblA and two columns from tblB: select A.field1, A.field2, A.field, B.Cost, B.totalcost from... XML - Basic but help me out if you can - Hi, This is probably pretty basic but I've never really played with queryingXML. I've attached a screenshot which shows my XML... Collapsing Hierarchy of messages into single row - All, I am working on a messaging system which contains message chains. I have attached an Excel sheet with the first... Check for Excel File Existence and Send Email (SSIS) - I've been using Script Task to check for the existence of File(.xls) in a folder(directory). I've written C#Code by declaring... Sum when between - Hi I am trying to do a count, to see how many times N-CO occurred until the Re-Act was completed. Could you... Kerberos and NTLM - We use NTLM authentication in our environment. SELECT auth_scheme FROM sys.dm_exec_connections WHERE session_id = @@spid ; Returns NTLM from all my instances How do... How to find all procs in a DB which cross reference other databases - Hi All I need to find all procs from a database which reference tables from another databases. all my DB has... How to find the root cause of database growth – DATA FILE ? - Hi All , Help with query - I need all combinations (not permutations) of the keywords and their synonyms. I'm having trouble getting groups of words substituting... task => generate script with tool sqlCmd - Hello all, i would like to know if it's possible to generate a script (create schema and datas) with the command... why cant we take regular full backup on secondary replica? - Good Morning Experts, In Alwayson Availability Groups, why cant we take regular full backup on secondary replica? excel source - hi I have 13980 rows coming in excel files which containg employee status. I need to load those in sql server table.... SSIS and GIT structure - New gig uses GIT for source control (Bitbucket to be exact) which I'm not really all that familiar with (that's... Data flow concept - Thoughts wanted - Looking for thoughts on this. I have an application where we receive data from customers via text file. Unfortunately, we... How to Repair Damaged SQL Server 2012 Database? - Something happened with my sql database. Due to an unexpected reason sql server database has become corrupted. But don't know... |
|
| This email has been sent to newsletter@newslettercollector.com. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. | This newsletter was sent to you because you signed up at SQLServerCentral.com. Feel free to forward this to any colleagues that you think might be interested. If you have received this email from a colleague, you can register to receive it here. | This transmission is ©2017 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. Contact: webmaster@sqlservercentral.com |
|
|