Laden...
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Which Default Schema | |
I run this code on a SQL Server 2022 instance: CREATE LOGIN JoeDBA WITH PASSWORD = 'DemoP@sswordTh@t1sLong' GO ALTER SERVER ROLE sysadmin ADD MEMBER JoeDBA GO USE sandbox GO CREATE SCHEMA etl GO CREATE TABLE etl.Customer (CustomerID INT, CustomerName VARCHAR(200), LoadDate DATETIME) CREATE TABLE dbo.Customer (CustomerID INT, CustomerName VARCHAR(200), status tinyint) GO INSERT etl.Customer (CustomerID, CustomerName, LoadDate) VALUES (1, 'Acme', GETDATE()), (2, 'Roadrunner, Inc', GETDATE()), (3, 'Coyote Enterprises', GETDATE()) GO INSERT dbo.Customer SELECT c.CustomerID, c.CustomerName, 1 FROM etl.Customer AS c go CREATE USER JoeDBA FOR LOGIN JoeDBA WITH DEFAULT_SCHEMA =[etl] GO This all works fine. I then log into the instance as JoeDBA. I change to the sandbox database and run this: USE sandbox GO SELECT * FROM Customer AS c Which three columns are returned? | |
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) |
High Cardinality When we say a column has high cardinality, what do we mean? Answer: Lost of different values, with the counts not mattering Explanation: Cardinality refers to the number of distinct values in a column. High cardinality means lots of unique values. The counts don't matter, as you could have a table with 1.1 million rows and 1.05 million unique values with 1 repeated 50,000 times. Ref: High Cardinality - https://en.wikipedia.org/wiki/Cardinality_(SQL_statements) |
Database Pros Who Need Your Help |
Here's a few of the new posts today on the forums. To see more, visit the forums. |
Administration - SQL Server 2014 |
FTS Not enabled for DB - but it is working(?) - Hello. I have a couple of DBs that say that Full Text Search is not Enabled on the DB - yet it seems to work? FTS catalogs were created by upgrades to SW that use them to run Contains queries via the portal - this seems to work fine. Maybe the data is stale or […] |
SQL Server 2012 - T-SQL |
Parse out filed as date time ??? - Hi I have a field with a start and end date (sometimes no end date) . How can I parse this out to have two fields start and end dates? Data looks like ~__2019121407025301GMTOFFSET=-18000~__2019121415164202GMTOFFSET=-18000~ desired out is Start Date 12/14/2019 7:02 AM End Date 12/14/2019 3:16 PM Thanks |
SQL Server 2019 - Administration |
SQL 2019 data masking - I have setup data masking on several fields and can see that the data is masked using t-sql. I need this masking to follow through to report server. I am not seeing the data masked there. any ideas / suggestions would be greatly appreciated |
SQL Server 2019 - Development |
Query Tuning - I have a table that has 5.5 million records. The query used by a report filters records based on a date column in the table, and currently it returns all records in the table. The query gives result in 100 seconds. I need to make it run faster. Query ----- Select column1, column2... column18 From […] |
Dyanamic SQL to call sproc with input params and an output param - All, I have the following which works perfectly: DECLARE @ProcessName VARCHAR(100) = 'ETL_InitialLoad' ,@TableName SYSNAME = 'dbo.tableA' ,@id NVARCHAR(30) IF NOT EXISTS (SELECT * FROM dbo.ETL_Log WHERE ProcessName = @ProcessName AND TableName = @TableName AND ProcessEndTime IS NULL) BEGIN EXEC [dbo].[ETL_InsertLog] @ProcessName = @ProcessName, @TableName = @TableName, @id = @id OUTPUT; END SELECT @id […] |
Reporting Services |
How to use pagination for huge reports - Hi all, I created a SSRS report that supposed to load about 600k records. In order to minimize loading time, I used pagination, by 50 records each page. However, when I refresh it in a Preview mode it throws "out of memory" exception. I expected that if I use pagination it will only load 1st […] |
General |
Task solution help request - Couldy You help me with this task, please? You are working with the library books database. The Books table has the columns id, name, year. The library has new books whose information is stored in another table called "New", however they do not have a year column. Write a query to select the books from both tables, Books and […] |
Analysis Services |
SSAS tabular account impersonation - Hello, I'll try my best to summarize the problem and I hope someone can offer me a hand with this. The Enviroment: 2 Domains (let's call them domain_1 and domain_2) Server1 (it is joined to domain_1) This server has SQL Server and SSAS SSAS has a domain account set up on the service Domains have […] |
Comparison of rolap and molap in the tubular or multidimensional - I want to write a comparison article on ROLAP and MOLAP, and I have installed SSAS. During the installation process, there was a Tabular section and a Multidimensional section that I needed to choose from. As far as I knew, Tabular is specifically for ROLAP, and Multidimensional is tailored for MOLAP. However, it seems that […] |
Integration Services |
On Error Event handler in For Each Loop Container - I have a For Each Loop Container that iterates through a list of servers in my environment. Usually it is used to gather information from each of the servers. Inevitably there are a few errors. But my error handler does not write the name of the Server at which the error occurred. Here is my […] |
Visual studio 2019 hangs when open excel data source - I had Visual studio 2019 installed on windows 10. I have a SSIS package that has been working when I run it in visual studio. But recently when I open the ssis package, and open the excel data source to edit, it freeze there forever, then visual studio shows busy. I have to hard stop […] |
Anything that is NOT about SQL! |
SSC Fantasy Football 2024 - Placeholder for 2024. Prized: $100 $75 $50 |
SQL Server 2022 - Development |
Basic query performance - Hi, I have this pretty basic query that is starting to perform slowly. It returns over 22m records in about 5 minutes. I know its difficult without table defs but any ideas on what I can try to make this return faster? SELECT [e].[eligibility_id] FROM [dbo].[eligibility] AS [e] -- Table is updated hourly with […] |
Need Help Uninstalling SQL Server 2019 for SQL Server 2022 Installation - hello everyone, I'm currently facing an issue with uninstalling SQL Server 2019 Developer from my computer. The goal is to make way for the installation of SQL Server 2022 Developer, and I want to avoid having two instances of SQL Server on my PC. Despite attempting to uninstall SQL Server 2019, it seems to persist […] |
Freezing of multiple databases using VDI snapshot backup command. - Transact-SQL snapshot backup for SQL Server 2022: Suspend all user databases on the server for a snapshot backup: ALTER SERVER CONFIGURATION SET SUSPEND_FOR_SNAPSHOT_BACKUP = ON; BACKUP SERVER TO DISK = 'd:\temp\db.bkm' WITH METADATA_ONLY, FORMAT; METADATA_ONLY is synonymous with SNAPSHOT. The Virtual Device Interface (VDI) uses SNAPSHOT. VDI Snapshot backup: Backup statement: BACKUP DATABASE {database_name} TO […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. [email protected] |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Laden...
Laden...