|
|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Default Statistics Sampling | |
If I don't specify a percentage of sampling (or fullscan) with CREATE STATISTICS, what is the default percentage of the table sampled? | |
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 First Place Seeing the New Year I want to find out which time zone gets to experience the new year first. Which of these queries will get me that time zone? -- 1 SELECT TOP 1 [name] , MIN (tzi.current_utc_offset) OVER (ORDER BY tzi.current_utc_offset) FROM sys.time_zone_info AS tzi; -- 2 SELECT TOP 1 [name] , tzi.current_utc_offset FROM sys.time_zone_info AS tzi ORDER BY tzi.current_utc_offset; -- 3 SELECT TOP 1 [name] , tzi.current_utc_offset FROM sys.time_zone_info AS tzi ORDER BY tzi.current_utc_offset DESC; -- 4 SELECT TOP 1 [name] , tzi.current_utc_offset FROM sys.time_zone_info AS tzi ORDER BY CAST (REPLACE (tzi.current_utc_offset, ':', '') AS INT) DESC; Answer: 4 Explanation: The time zones are stored as nvarchar, so to order them by time, they need to be changed to ints. However, an int cannot have a colon, so that must be removed. Also, the first time zone to experience the new year will be a plus + time zone ahead of UCT. Happy New Year! |
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 - Development |
How to establish a relationship in SQL Server - Good morning and Merry Christmas everyone! I'm not sure if anyone has posted something like this before, and if they have, I couldn't find it. And I apologize for the repeat. I'm looking to take the minimum value of a relationship between customers and accounts and apply it to all accounts, thereby establishing a relationship […] |
SQL Server 2016 - Development and T-SQL |
How to validate existing data in a table - Hello Team, I have some application databases where i need to perform data validation. I am not sure what type of data is already stored in the tables. Does there are any set of pre-defined rules / constraints with which i am cross verify data ? Or i have to reply on the application team […] |
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 2019 - Development |
Temp Tables Used within Procedure giving error in one 2019 sql server instance - I have Three stored Procedures A,B,C C is a common procedure which derives data into a common table depending on parameters from respective procedures A or B and returns to a or b for further processing on one sql 2019 environment its working normally but on another if Proc A is executed first then later […] |
Managed Instance: Resource alerts with db_mail for usage and notifications? - Hello SQLServerCentral community, I'm looking for guidance on setting up resource alerts for Managed Instance. Specifically, I want to monitor resource usage and receive email notifications when reaching storage or CPU limits. Can someone please provide me with detailed instructions or steps on how to configure this using db_mail? Thank you in advance for your […] |
SQL2019 ODBC Connection from Linux setup help. - I can connect to the sql server 2019 from my linux machine with tsql but not with isql or with PHP odbc_connect. I can connect to older SQL Servers. I have tried a lot of different thing including FreeTDS. isql error is [ISQL]ERROR: Could not SQLConnect my odbcinst.ini [FreeTDS] Description=FreeTDS Driver Driver=/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so Setup=/usr/lib/x86_64-linux-gnu/odbc/libtdsS.so [ODBC Driver […] |
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 […] |
SSRS Unable to log in to web Portal - Hi guys, I have a new SSRS setup on a new computer, but the default web authentication won't go through no matter what. I've tried adding roles on SSMS, adding Firewall Ports and Authentication and changing my windows info but it all didnt works. Can anyone give me some tips on what to do? Thanks |
Report is Blank in PDF only!? - Hi all, This one is stumping me and I can't tell if this is a bug or a user issue (meaning me). Hoping for some insight. My report consists of a main report with two sub-reports in a table, and my first sub report has its own subreport with a grouping applied. So something like […] |
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 […] |
Article Discussions by Author |
Always On Failover Availability Group Automation - Hi! I have successfully installed the always-on system from your current repository, and I want to thank you for that. However, while the primary database is inaccessible, I want to be able to write to and update the secondary database. In other words, how can I automatically make the secondary database the primary one in […] |
SQL Server 2022 - Administration |
SQL Server 2022: AlwaysOn AG databases can not sync after applying CU6 or higher - The setup is: OS - Win Server 2022 & MSSQL - SQL Server 2022 AlwaysOn Availability Groups are enabled on two (primary + secondary) replicas and use WSFC. Several availability groups are created and a database in each of them. AGs are configured with Sync Commit and Automatic failover mode, also they use dedicated separate VLAN […] |
Database space issue - Hi experts, I am facing issue with the database file space used. Here are some details: Server - Azure database Data file size - 350 GB All table combined izes - ~40 GB Space used within the data file- 340 GB I looked at sys.allocation units and there are several container_ids that are missing in […] |
SQL Server 2022 - Development |
Return - Self taught novice learning SQL and would welcome some help with the following code problem In my data set I have one record per customer but would like my select query to return 12 rows for each customer record in the data set. e.g. If I have 2 customers I would end up with 24 […] |
Last value in a row containing.. - I've inherited code in which I need to designate each PATID as either Rel_Exempt or Med_Exempt, depending on whether it is the last column in the row (not counting the column with 'NONE'). Hoping it will turn out as below. Thanks in advance for any help. create table #values ( PatID varchar(10) ,Name1 varchar(10) […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |