|
|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
The Default Variable String | |
What is returned by the second SELECT in this code in SQL Server 2022?
DECLARE @s VARCHAR; SELECT @s = 'this is a test of a fairly long string' SELECT @s | |
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) |
An Updatable View I have this view, based on a table where CityNameID is an identity field. CREATE VIEW dbo.City AS SELECT cn.CityNameID, cn.CityName FROM dbo.CityName AS cn GO I want to make it updatable to run this code: INSERT City (CityName) VALUES ('Elbert') What do I need to do?
Answer: Nothing. This view is updatable. Explanation: All views are updatable, if they meet a few restrictions on what the SELECT statement includes. In this case, the view is updatable. Ref: CREATE VIEW - https://learn.microsoft.com/en-us/sql/t-sql/statements/create-view-transact-sql?view=sql-server-ver16#updatable-views |
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 |
SQL Server Always On Availability Group in an Active/Passive Cluster Environment - I currently have a setup where we have an Active/Passive Cluster Environment that also has a Disaster Recovery Secondary Availability Group. There is a need for another secondary replica to use the read-only functionality to reduce the workload on the Primary Replica. My main question here is I'm assuming I will have to have another […] |
Bad checksum in Image column - We have a large table that stores file data in a column with an Image data type. One of the records appears to have corrupt data. When trying to select the record with the file data, I get the following error: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, […] |
SQL Server 2016 - Administration |
Migrate MS SQL Cluster to a New SAN - Hi, As the titles states, I am in the process of moving my sql cluster from an older SAN to a new one. I reviewed and partially followed this post: How-To: Migrate MS SQL Cluster to a New SAN but I can not do this: Back in Failover Cluster Manger right click on the old […] |
SQL Server 2019 - Administration |
Create a dynamic script to create view for all tables having MAX columns - Hi I need some help on this request Create a dynamic script to create view for all tables having MAX columns in the database And if the column is MAX then I need to use CONVERT(VARCHAR(2000), SUBSTRING (COLUMN_NAME,1,2000)) as COLUMN_NAME in the view Thanks |
RESERVED_MEMORY_ALLOCATION_EXT wait and totally slowness - Hi, we have a little bit of an interesting topic. Sometimes, we get wait RESERVED_MEMORY_ALLOCATION_EXT, we have 12TB RAM , and not all are full but the primary server is totally slow, whoisactive is not possible run, other queries are waiting for this memory wait or also DTC or HADR SYNC, and we tried to […] |
ALTER SERVER AUDIT -- need to supply 1 predicate with 2 values to filter on - Looking for example FILTER containing multiple values in the predicate -- to apply to "ALTER SERVER AUDIT" Need to filter on 2 SERVER_PRINCIPAL_NAMES which I do not want captured in my DATABASE AUDIT (EG. thousands of rows of activity for Idera's SQLdm ID: 'mydomain\!sqlmonitoring' and our standard service account performing the DML 'myDomain\myServiceAccount') An internet […] |
Minimal permission to stop a SSIS execution from Active Operations dashboard? - What is the minimal permission to allow a user (who is not a member of the SYSADMIN or SSIS_ADMIN role) to stop a SSIS operation using the [stop] command button on the Active Operations dashboard? This would be similar to the SQLAgentOperatorRole for SQLAgent - except for SSIS operations. |
SQL Server 2019 - Development |
Function Returning NULL on Specific Server Instance, 0 on Other Servers - This has me very perplexed... we have a function that on one server is returning a 0 but on another server it returns a NULL: USE TempDB GO CREATE FUNCTION dbo.TestNuLL() RETURNS BIT AS BEGIN DECLARE @MyBit BIT; SET @MyBit = 0 SELECT @MyBit = 1 WHERE 1 = 0 RETURN @MyBit END I tested […] |
Reporting Services |
Error in conditional summing - I'm creating a SSRS report pulling from SSAS cube using a MDX Query. In my report I'm trying to sum conditionally inside a grid using the following expression. =Sum(iif((Fields!TOC_DIsplay.Value = "Default TOC" or Fields!TOC_DIsplay.Value = "Labor" or Fields!TOC_DIsplay.Value = "Non-Labor"), cdec(Fields!Next_Year_Budget__E_.Value), cdec(0))) I'm getting the following error when the column has no values. Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: The […] |
Powershell |
Throw error without stack trace - Hi all We're using PowerShell V5 on a SQL2022 Enterprise box. I've got SQL Agent job step that calls a PS script. Occasionally, the step fails but doesn't fail the job (it just carries on regardless). I need this step to fail the job so I've been looking at the PS […] |
Integration Services |
Connecting Oracle Database with SSIS - Hi, I have Visual Studio 22 and I am trying to connect to Oracle database among other sources. I can not see Oracle as an alternative when creating OleDB data sources. I installed 32 bit 'Oracle Client for Microsoft Tools' which my client provided for me ==> no luck I googled this and that and […] |
SQLServerCentral.com Website Issues |
504 Gateway Time-out – The server didn't respond in time. - I've been getting this error more and more frequently. It happens when I respond to a post … especially if mine is the first response, it seems. Despite the error, the post is usually made successfully. |
SQL Server 2022 - Administration |
User-Friendly Task Executor / Scheduler - We have a requirement to allow certain nominated users to execute 'jobs', where the definition of a job could be running a stored proc, or a PoSh script, or some other command line task. I'd be interested to know how others here provide this functionality to their users. Any recommendations for a suitable tool? This […] |
SQL Server 2022 - Development |
Conditionally Selecting Rows within Union - Hello, I have a union where I need to select rows from the first query if the Car Status column is equal to "New". Otherwise, I need to select rows from the second query in the union which comes from a separate db and table if the Car Status column in the first query equals […] |
Declare XMLNAMESPACES - Hello fellows, does anyone know how to format XMLNAMESPACE declaration so that its output is formatted specific way? ; WITH XMLNAMESPACES ( DEFAULT 'fsrv', 'http://www.w3.org/2001/XMLSchema-instance' as xsi, 'fsrv PositionRec.xsd' as schemalocation, '30' as Version ) SELECT GETDATE() for XML PATH ('TestPath'), ROOT ('AcctFncl') /******************************************************************************************************* The output of the below script gives me namespaces declaration on […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |