Laden...
|
|
|
|
|
|
Question of the Day |
Today's question (by Carlo Romagnano): | |
Create temporary table on fly | |
I run the following code: select col1 = 1/0.000 into #a WHERE 0=0 What happens? | |
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) |
Printing the String I am trying to debug a T-SQL script and want to return some information to the messages tab in SSMS. I decide to use the PRINT statement. I have a static message, but I want to include the name of the user in the middle of it. Right now I have: PRINT 'This action was initiated by and it failed.'I want to insert the user name between the "by" and "and". How should I edit my code?
Answer: Change the code to: PRINT 'This action was initiated by ' + USER_NAME() + ' and it failed.' Explanation: The easiest way to do this is insert the user name in the middle of the string with the concatenate operators. Ref: PRINT - https://docs.microsoft.com/en-us/sql/t-sql/language-elements/print-transact-sql?view=sql-server-2017 |
Featured Script |
S_Kumar_S from SQLServerCentral Script to facilitate the comparison of data between two SQL Server tables
|
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 |
Restoring from a backup - Hi, I am trying to put a 2012 database on a new 2017 server. So, I thought that the easiest way would be to take the backup that I have for 2012 and restore it to 2017. However, it would not go. I tried just restoring it, and then made an empty database with the […] |
Seed AG Primary and Secondary with Log Shipping - I am planning a SQL Server migration from 2008/08R2 up to SQL Server 2017 Availability Group. I have 3 08/08R2 stand-alone instances that I'm migrating. Can I use log shipping on SRV1 running 2008 to secondaries like SRV2 and SRV3 that are running SQL Server 2017 and then establish an AG on SRV2/3 with those […] |
SQL Server 2016 - Administration |
Primary server stay on resolving state- Always ON - Hi All , In my case we’re Looking the cause why in our Always On SQL when we lost communication on the secondary replica the primary goes down (stay on the Resolving state) Any thoughts please Thank you |
fail over database in high availability - Always On - Hi All, Currently we have configured Always on - High Availability in our SQL servers. We need to fail over per database not per Availability group because in 1 availability group we have multiple databases. How do I fail over 1 database in Always on environment ? Any feedback is much appreciated |
SQL Server 2016 - Development and T-SQL |
select several lines randomly according to several categories - Hello, I have the following dataset: Family Room subfamily 1 5 6 2 5 7 3 5 7 4 […] |
Rownumber() - I need to get a rolling count only of rows matching a particular criteria and to use the result in a concatenated output field. The remaining rows (those not matching the criteria) do not need to be counted as they will have a different output field. For example... Row 1 - Matches criteria so count […] |
Administration - SQL Server 2014 |
GDR update of SQL Server 2014 for x64-based - Hi, I got a vulnerability that requires me to install a patch on my SQL Server 2014, I downloaded the patch: "SQLServer2014-KB2977315-x64-ENU" but I'm failing to install it, it only get to "Select Features", but it doesn't show any Features to select, and I can't go further than that. Please help. |
SQL Server 2012 - T-SQL |
Trying to create Nested SUM OVER Function for backwards running total. - Here is sample code from my running total, now I need to reverse it and add a where exists clause to subtract rather than add from the initial value (in this case enrolled students from day 1). I need to add some sort of where clause or update for endDates to show drop offs from […] |
SQL Server 2008 - General |
2nd Server min requirements for transaction log shipping & reducing license cost - I will have a 64-bit 2008 R2 SQL Server Standard edition acting as the production (primary) database server in a vSphere environment. I was planning on creating a secondary server that mirrors the Operating system environment and SQL server configuration, which is where the primary databases transactional logs will be shipped and applied. Since this […] |
SQL Azure - Administration |
How to move PROD SQL Azure Singleton database from one subscription to another? - We have our production database (Azure Singleton) up and running in Azure. Due to a few security vulnerabilities found, we were asked to move that into a new subscription. The size of the database is about 200 GB. Obviously we need to move our current production database to the new subscription. Before that we would […] |
Reporting Services 2008/R2 Administration |
Reverting from custom authentication - We have an asp.net application that using forms authentication to embed SSRS into the website. Long story, but the encryption keys were deleted and now the forms authentication no longer works. We are waiting on the developer who did this to be engaged, but I'd like to revert the custom forms authentication back to straight […] |
SSRS 2016 |
Copy or Move Shapshot Reports - Hi We have snapshots on an old report that we would like to move to a new report in Report Manager. Is there anyway to move these reports? Thanks in advance |
Repeat Header and rows on each page doesn't Work please help :( - Hello, just like the header states, SSRS wont let me print the header on each page, it would be nice but cant, i check the box, made sure its checked on the Table properties... I just want it to print my Table header info on each page... didn't know it was going to be this […] |
Integration Services |
how to hide the passsword in the log file when the package fails. - I have an encryption and decryption package and the keyId public and private from GPG coming from config file of package. for testing purpose provided incorrect key id in the config file that will fail the package as gpg didn't find the local key and in the log file captured complete command with passphrase too. […] |
Backups |
SQL Server Restore precheck gets free space wrong - I'm trying to move a large database (22 TB) from a stand alone server to a Storage Spaces Direct (S2D) cluster. The database to be moved is four files, none over 16 TB. The cluster is already hosting many TB of data and is working fine. To minimize downtime, I generally restore a full backup, […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. [email protected] |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Laden...
Laden...