|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
The External Database Principals | |
What types of external principals can be stored in sys.database_principals besides Windows groups and users? | |
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) |
More Choice I have this code in an application: DECLARE @i INT = 4, @j int SELECT @j = CHOOSE(@i, 10,20,30,3.14,50,'Test') SELECT @j What is the value returned from this batch? Answer: 3 Explanation: CHOOSE() acts like an indexing mechanism into an array of values. The data type of the values is not important here, as they can vary. The value of @j will determine the casting. If the data cannot be implicitly cast to the data type, an error is returned. Ref: CHOOSE() - https://docs.microsoft.com/en-us/sql/t-sql/functions/logical-functions-choose-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 2017 - Development |
Query improvement (Index spool) - Hi, I have a query that takes too much time to execute. Query and plan can be seen here: https://www.brentozar.com/pastetheplan/?id=SJWSzileL I believe problem is in this part of the query: CROSS APPLY (SELECT MAX(DATO) AS dato FROM dbo.STDORD ST WHERE DATO <= DS.CLARION_DATE AND ST.KUNDE = sto.KUNDE AND ST.ANN <> 1) CA Any suggestions are […] |
SQL Server 2016 - Administration |
SP_MSIns_ "stuck" on inserting into a table. - Hello All, I'm having trouble with transactional replication I'm hoping someone can help with. I have Server A (publisher), Distro (Distribution server), and Server B (Subscriber). All servers are 2016. B is our report server. We have a particular table I'll just call 'Sales' that might have 300 records replicated to it in a day. […] |
Will adding files to TempDB replicate to 2nd node within an always on group? - I want to add 3 more datafiles to tempdb on a database server that has a second node in an always on high availability group. With MSSQL (I'm more used to Oracle) when I do this on the primary server, does the DDL get ran on the 2nd node and the files created on it […] |
Need help with generating random pass for 100s of certificates - All, I am in a process of implementing TDE on all DBs which are on our Dev servers. There are close to 200 DBs and I am creating 1 certificate for each DB. So there are going to be 200 certificates. I am also going to be backing up those certificate using different password. And […] |
SQL Server 2016 - Development and T-SQL |
Two tables but if 2nd table has one row that is to be ignored - I cannot think of an easy way Two Tables Table 1 PROJECT Project_ID , Client ID Data Project_ID , Client ID 101000 A00001 101000 A00002 102000 A1111111 Table 2 CLIENT Client_ID ROLE Client ID ROLE A00001 SYS A00002 SYS A1111111 SYS SELECT * FROM […] |
import from sql tables into windows event viewer - Dears, I need some ideas about how to export from 2-3 sql server tables ( filled with app messages) and import into windows event viewer application/security ? Thanks, Hadrian |
Grant exec permission but prevent DML operations in proc - Hi I have got a business need where a user can execute a proc but if there are any DML commands in it, then those should not be executed(error can be thrown and is fine with me or message can be printed.) Now I can't create triggers as I don't know which table DML operation […] |
Administration - SQL Server 2014 |
Cluster, HA., replication. what are my options without a static ip address - SQL Server 2014, we have never been asked to provide redundancy until now. We have servers but they are all virtual and do not have static ip addresses. I need to know what kind of fail over I can do when I dont have an ip address. I have spent most of this year researching […] |
Change Log Backup Frequency Automatically - During our weekly index rebuilds (using Ola Hallengren's scripts), the log expands considerably. This isn't unexpected and there's plenty of space into which it can expand. I do have a task to look at minimising the growth but it's behind other things, including mitigating the growth. The problem we actually have is further downstream. We […] |
Development - SQL Server 2014 |
Index larger than table - I am looking at the large amount of space taken up by indexes and have a few questions; I have been searching online for a while and can't find seem to find a direct answer. For context I have more of an Oracle background. On a table with a clustered primary key, is the row […] |
SQL Server 2019 - Administration |
Saving Maintenance Scripts to Azure DevOps - We have scripts that we use to maintain our data warehouse. For example, we have a script that will truncate our dimension tables and reset the identity columns. Anyway, I'm confused on how to save those scripts (simple .sql files) to Azure DevOps. Can it be done directly from SSMS? EDIT: never mind, I […] |
SQL Server 2019 - Development |
TSQL Help - I need help on SQL Query i have table with 2 column Acol BCol 1 ABD 1 ACD 1 ADD 2 DEF 2 DDD 2 EEE I want output as 1 ABD,ACD,ADD 2 DEF,DDD,EEE Appreciate your help. |
SQL Azure - Administration |
Correlation of DTU and RAM in ( GB) allocated to DB - Hi, Azure portal and DMV providing % of memory used by database I want to query MAX RAM in GB allocated to server assuming we have only one customer database per server DTU 500 = ? GB Ram , DTU 1750 = ? GB Ram Is this information secret ? Thank you Alex |
Reporting Services |
ssrs 2012 page footer - in an ssrs 2012 report, my user would like a page footer to only be displayed when there is a specific 'group' changes. Basically this would only occur when a school name changes. This request is being made for a large school district that contains a large volume of schools. If this is possible, would […] |
Integration Services |
[DBNETLIB][ConnectionOpen (SECDoClientHandshake()).]SSL Security error - We are experiencing the following error when attempting to run a SQL Server 2016 SSIS package. Error: 2020-01-07 11:01:19.31 Code: 0xC0202009 Source: InsightMonthlyFile Connection manager "CognitionDB"Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80004005 Description: […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |