| A community of more than 1,600,000 database professionals and growing |
| | ADVERTISEMENT | | New SQL Clone: Now supporting databases up to 64TB Create copies of production databases and SQL backups in seconds and save up to 99% of disk space using SQL Clone. Redgate’s new tool removes much of the time and resource needed to create and manage database copies, allowing teams to work on local environments to develop, test and diagnose issues faster. Try it free |
| | The industry standard for comparing and deploying SQL Server database schemas Trusted by 71% of Fortune 100 companies, SQL Compare is the fastest way to compare changes, and create and deploy error-free scripts in minutes. Plus you can easily find and fix errors caused by database differences. Download your free trial |
|
|
|
| | | Tushar Kanti from SQLServerCentral.com This article will talk about preparing a runbook in Azure to schedule the report of space usage of databases in Azure environment More » |
| Press Release from Redgate In this free eBook Shawn McGehee offers advice on query tuning, cutting stored procedures, and system process design and implementation for high availability. Discover how to perform backup and restore operations using SQL Server Management Studio (SSMS), basic T-SQL scripts and Redgate's SQL Backup tool. More » |
| For most application developers, it's unthinkable to work without version control. What about the database? What's stopping you version controlling yours? More » |
| dustinryan from SQLServerCentral Blogs If you were at the Microsoft Data Insights Summit or were watching the live stream of the keynote, then you... More » |
| Mala Mahadevan from SQLServerCentral Blogs In this post we will explore a common statistical term – Relative Risk, otherwise called Risk Factor. Relative Risk is a... More » |
|
|
| | Today's Question (by Carlo Romagnano): Select 2 correct answers about the result set of the OUTPUT clause CREATE TABLE a(cod VARCHAR(10),description VARCHAR(100)) CREATE TABLE b(cod VARCHAR(10),processed bit) GO INSERT INTO a SELECT * FROM (VALUES ('A','AAAA 1') ,('A','AAAA 2') ,('A','AAAA 3') ,('A','AAAA 4') ,('B','BBBB 1') ,('B','BBBB 2') ,('B','BBBB 3') ,('B','BBBB 4') ,('C','CCCC 1') ,('C','CCCC 2') ,('C','CCCC 3') ,('C','CCCC 4') ) AS V([cod],[description]) GO INSERT INTO b SELECT *,0 FROM (VALUES ('A') ,('B') ,('C') ,('D') ,('E') ) AS V([art]) GO UPDATE b SET processed = 1 OUTPUT deleted.*,a.* FROM b FULL JOIN a ON a.cod = b.cod WHERE b.processed = 0 (How many rows returned and which values for the description column or any syntax error). |
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 1 point in this category: T-SQL. We'd love to give you credit for your own question and answer. To submit a QOTD, simply log in to the Contribution Center. |
|
|
| Yesterday's Question of the Day |
| Yesterday's Question (by Steve Jones): What are my options for the first Raiserror parameter? The second and third parameters are severity and arguments. Answer: A message ID, a string, or a local variable that can be converted to char/varchar Explanation: The first parameter can be a message ID in sys.messages, a string containing a message, or a local variable that can be converted implicitly to char/varchar. Ref: Raiserror - 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. SQL Server Single User Mode - Situation? - Hello, Can anybody please make me understand that under which situtaion a DBA will have only one option that to start... SQL server upgrade to new version - We are currently using SQL server 2014 and SQL server 2012. I am planning to upgrade them in Oct to SQL... Error 17049 (OS error:5 Access Denied) DBCC Errorlog - Hi Experts, While recycling error log using command - DBCC Errorlog , I am facing the below error. Unable to cycle error log file... Convert unicode escape sequence to nvarchar - Hi all, I have string like this: DECLARE @m NVARCHAR(max)= N'\u0633\u0644\u0627\u0645' How can I convert(Unescape) it to normal string ? SQL: HOW to concatenate two fields using trigger, - Hi All, I have SQL database called “S1”, and a table called “WORKORDER”, inside the table, I have two field... Missing months group by - My data is like below currently- 7 columns below in first table. Date Country P1 P2 C1 C2 R1 2017-03-01 IN 0... Reseeding indexes for tables with data - Hello, I have a database with many tables containing auto-incrementing Pk's. Somehow, things got messed up and an insert against a... SQLJOBVIS - anyone still have a copy? - This is the nifty old utility talked about in this article. http://www.sqlservercentral.com/blogs/chadmiller/2010/05/15/sql-agent-visual-job-schedule-viewer/ It seems the company and the website no longer... Dynamic Pivot using XML as column list - I am trying to pull out a list of products from a product table, in the form of a comma... How does this code convert records to a single row? - Hi I stumbled across some SQL code which seems to transpose record data into a single record. Unfortunately the code was... Scalar function with source conditional to a parameter - My code is as follow ALTER FUNCTION . (@SC1 varchar(30)) RETURNS VARCHAR(3) AS BEGIN DECLARE @LB VARCHAR(3) SELECT TOP 1 @LB=Buyer FROM vPurch_Q &n Parse SQL String - Hi, What's the best way to only get "place of work 234" from the Product code? I tried the sql below... Create Auto Insert Script - 500k records to load data into sql server - Hi, I would like to Create Auto Insert Script - 500k records to load data into sql server for my testing. How can... Need Suggestions on Best way to Query Data - Greetings, I have a table that has 2 columns, TransTableDetail_Trans_To and TransTable_Description. the TransTableDetail_Trans_To column lists store numbers that can repeated... How to get these queries into a view? - Hello, I have some data I'm trying to summarize and I'd like to have this in a queryable view instead... Programatically return Login name for DBO user? - Hi all, My Google skills seem to have failed me here!! Any ideas? Thanks, JB Tsql Query help - Hi guys, I am working on a process where the query to be written seems little tricky to me. I have... SQL behaving strangely on different servers - Hi All, I have a sql statement working on static tables (no Insert,Update,Delete) on our testing server it's running very fast... ssrs 2008 report with truncation problem but no issue exists with sql in ssis manager - In an existing ssrs 2008 report, I want to chage a hard coded value of 'P' to use a parameter... "Is not in path" error? - I am not sure exactly what this error is. We had a hard drive crash not too long ago and... |
|
| This email has been sent to [email protected]. To be removed from this list, please click here. If you have any problems leaving the list, please contact the [email protected]. | 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: [email protected] |
|
|