|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Finding the Git Remote Name | |
In Git, how do I determine the name (shortname handle) of the remote repository that is linked to my local repository? Usually this is origin, but how can I check? | |
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) |
The New Database Owner I create a new login in SQL Server 2019, without any roles. I then grant this login the CREATE ANY DATABASE permission. When this login creates a database, who is the database owner? Answer: the login Explanation: The owner of the database is the login that created it by default. Ref: CREATE DATABASE - https://docs.microsoft.com/en-us/sql/t-sql/statements/create-database-transact-sql?view=sql-server-ver15 |
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 2016 - Administration |
SQL Server Compatibility Mode 130 - Hello, When one of our sql servers was migrated from SQL2k12 to SQL2k16, some of the user database compatibility levels were set to 110. Developers wanted that way at that time. Now, if we change it to 130, I do not think, we need to enable (or turn them ON) any of these trace flags? […] |
Retrieving the total number of records in a SQL instance - Hello, Is anyone aware of a good approach for retrieving the total number of records across all tables and all databases within a SQL instance? I've attempted to write a query for it, but it isn't working as expected. SET NOCOUNT ON DECLARE @Counter INT, @MaxId INT, @DbName VARCHAR(100), @Sql VARCHAR(100) SELECT @Counter = min(database_id) […] |
Monitoring SQL Server performance. SQL Server, Disks baselining - Hey everyone, hope you all are doing great. I got a couple of questions regarding OS/SQL Server information capture and its regarding how you guys capture data and baseline everything in your SQL Server/OS Performance. Here it goes, this might not make perfect sense at the beginning so I hope you guys could cut some […] |
SQL Server 2016 - Development and T-SQL |
Complex Join - I have to tables T1 and T2 that are related by two columns C1 and C2. Both columns are null-able so it's not as simple as: T1 join T2 on T1.C1 = T2.C1 and T1.C2 = T2.C2 So I've come up with this: T1 join T2 on ( T2.C1 = T1.C1 and T1.C2 is null […] |
Administration - SQL Server 2014 |
Distribution DB increasing in size - We have a transaction replication running. We then decided that on a certain application, they would enable a module that would increase data in one of the tables. Prior to this, the Distribution was only 10GB, after 3 days, it is now 27 GB and constantly increasing. I see on the autogrow event that it […] |
SQL 2012 - General |
High parallel processes - Hi, I have a SQL server 2012 instance (Ver-11.0.5058). We execute a stored procedure which fetches more than 24 million records after joining data from 3 different CTEs (each of which has 3 to 7 tables in join). The MAXDOP for the instance is set to 8 and server has 16 logical processors. When we […] |
SQL Server 2019 - Administration |
backup database in alwayson - Hello everyone I need to transfer a database configured on alwayson from one datacenter to another What would be the best practice to back up this database in other words, should I remove my database from alwayson before doing l save operation? Thank you |
SQL Server 2019 - Development |
Export to text file for specific row inserted - I am looking for a solution to export the sql rows to a text file in a path when the database insert meets particular condition. I need one text file for each row. I don't need a text file for all the rows. Need text file output only when the database insert happens for my […] |
SQL query question - I'm trying to create a "smart agent" feature in my website. A user can search for ads by some criteria, and then save his search as a "smart agent". When a new ad is added that matches his criteria he will get an email. For example, I have 3 tables: 'Ads' table: columns: recordID(int), […] |
Silly SQL Question - I'm sure there's a simple way to do this, but I can't seem to figure it out. I have data something like this: ID, RESULT 1, Y 1, Y 1, Y 2, N 2, N 3, Y 3, N 4, Y 4, N I only want to pull records where the ID has both a […] |
Issues with SQL Trigger - I have created a SQL Trigger as below. create trigger testtrigger on testdb for insert as declare @sql varchar(8000) SELECT @sql = 'bcp "select * from testdb" queryout c:/test.txt -c -t -T -S localhost' exec xp_cmdshell @sql go But when a row inserted in the testdb, the text file is created, but there is no […] |
SQL Azure - Development |
Real time sync from One SQL server to another - Hi All, Please forgive me if this is a simple query but im pretty new to all of this. I am working with a company who are developing an app for us. My manager would like to explore the idea of being able to live sync the data from their database to our database so […] |
Reporting Services |
Access to Field!xxxx.value - I have not come across where I needed to do this, I have a report that uses multiple datsets, " I have done this before, but I need to take the value from one dataset field and subtract it from another, as you know when you bind the table to ds1 you get scope errors, […] |
Connecting |
Connecting to SQL server 2019 from python/Jupyter Notebooks - Does anybody have an example of connecting to a local instance of SQL Server from Jupyter notebooks? Do I really have to create a DSN to do this? ## define some variables so this stuff is easier to modify server = 'DESKTOP-D19S9C8/NONALAND' database_name = 'AdventureWorks2017' query = 'SELECT TOP 10 BusinessEntityID,FirstName,LastName,ModifiedDate FROM Person.Person WHERE PersonType […] |
Suggestions |
Spam removal from https://www.sqlservercentral.com/forums/ page - Firstly I like the fact that as soon as a post is marked as spam it's hidden. Perhaps they could be hidden from the https://www.sqlservercentral.com/forums/ overview page as well? |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |