Laden...
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
The Character choice | |
What happens when I run this code in SQL Server 2022? create table Names ( namestring varchar(20)) go insert Names select 'Steve' go select choose(namestring, 'steve', 'andy', 'brian') from Names | |
Think you know the answer? Click here, and find out if you are right. |
Yesterday's Question of the Day (by MMartin1) |
Dateadd with a numeric value What is returned from the following query ? declare @currentDateTime DATETIME = '2025-01-01 00:00:00.000' select dateadd(hour, 3.0/2, @currentDateTime);Answer: 2025-01-01 01:00:00.000 Explanation: From the DATEADD Docs at: https://learn.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql?view=sql-server-ver16 " DATEADD truncates a specified number value that has a decimal fraction. It doesn't round the number value in this situation." |
Database Pros Who Need Your Help |
Here's a few of the new posts today on the forums. To see more, visit the forums. |
Development - SQL Server 2014 |
Different number of records returned from SSMS and C# ExecuteReader - I am using the EXACT same query in SQL Server Management Studio (2014) as I am in my C# program, but I get different results. How is this possible? SELECT tblWTHistory.Date, tblWTHistory.EstCompDate, tblOperator.BadgeID, tblOperator.OperatorName, tblWTHistory.WONum, tblWTHistory.WOType, tblWTHistory.PartNum, tblWTHistory.CellReceivedQty, tblWTHistory.OpNum, tblWorkCenter.WorkCenterName, tblWorkType.WorkTypeName, tblWTHistory.WorkQty, tblWTStatus.StatusName, tblWTHistory.ReasonID, tblWTReasons.ReasonName, tblWTHistory.Rework, tblWTHistory.OpComment FROM tblWTHistory INNER JOIN tblWTReasons ON tblWTHistory.ReasonID = […] |
SQL Server 2019 - Administration |
Column Encryption/Exporting Windows Certificate - So random question about Windows Certificates -- I administer and develop a SQL Server DB App -- Back End is on an Azure Server/Front End is MS Access, about 35 End Users. We employ column encryption on a handful of fields, and re encrypt every 3 months or so. When this encryption is done by […] |
Sync SQL Server and Kafka in real time - Hello, Let say, my .NET API has been inserted successfully into SQL Server Database. It is possible, this data also inserted in Kafka in real time ? This transaction should be done in .NET API or should be done in SQL Server by configuration ? Please help me to understand more and better |
SQL Server 2019 - Development |
Unable to delete records from table - Hi, Im unable to delete records from a table.Im a little surprised as have not witnessed this. The SQL server runs on MSSQL 2019 RTM. I use the below queries. select top (5) * from Journal where createddatetime<'2006-01-01' -- To figure out the records below year 2006 Fetched the 5 top queries Delete from Journal […] |
Is anybody using Windows 2022 clustered SQL Failover cluster ( 2019 CU30 ) - How do you configure the cluster resources to be able to use Distributed Transactions ? Documentation ( 01/15/2014 ) is unclear and doesn't show a working solution. Begin Distributed Transaction fails ! Msg 8501, Level 16, State 3, Line 12 MSDTC on server 'VirtSQLServer\MyInstanceName' is unavailable. |
Query Help to show record in single row - Hi All, need help with an SQL query. We have an existing table that's already formatted this way, and I am having trouble extracting the data in single record. Current Output: EXPECTED OUTPUT: The EndDate and EndTime I want it displayed in the same row where BName like '% Start' I tried to do this through […] |
MSDTC not available on Windows 2022 clustered SQL 2019 CU30 - I connect to this clustered instance and run : begin distributed transaction Msg 8501, Level 16, State 3, Line 2 MSDTC on server 'ClusteredTargetServer\Instance' is unavailable. I have configured the clustered msdtc of this instance: Test-Dtc -LocalComputerName $env:COMPUTERNAME -Verbose VERBOSE: ": Firewall rule for "RPC Endpoint Mapper" is enabled." VERBOSE: ": Firewall rule for […] |
General |
What Version MS SQL Server and SSMS Am I Running? and Git with MSSSQL - Information I've run across searching other topics led me to want to find out what version I'm running. This was motivated by trying to learn if git/github would be good tools for version control on my database which led to the question of version. I found an article that told me to run SELECT @@version. […] |
Several Questions: Relationships and SSMS and Data Diagrams - I'm struggling setting relationships among tables. I understand the one-to-many, many-to-one, many-to-many, and self-referential concepts. It's implementing them that I find a bit vexing. I've used queries like this successfully: ALTER TABLE clan.parents ADD CONSTRAINT FK_FatherID_PeopleID FOREIGN KEY (parentsFatherId) REFERENCES clan.people (peopleID); How can I view relationships after I've completed queries like the above? After […] |
SQL Server 2022 - Administration |
Backup taking too much time - Hi Experts, One of my Large database having about 4TB in size is taking almost 3 days to complete the backup . To reduce the backup I stripped the same to 4 different cluster drives and still its taking the same time. The data stored is all documents and it uses filestream. Below are the […] |
Keeping QUERIES for Using Again and Adding DB to Git/Github and VS Code - While I know that it will speed my learning to type queries as I need them, sometimes I have put other people's queries to good use, queries that I lack the skills to create but will likely use in the future. Alas, I find no way to store and retrieve queries making them very accessable. No […] |
Found a Tool Very Helpful for Beginner - I struggled with remembering the conventions I'd chosen when creating column names and data types. Likewise I struggle - continually - with relationships and keeping track of Foreign Key assignments. While I have not fully resolved the last issue, I stumbled upon a query that will list all the data elements in a database along […] |
SQL Server 2022 - Development |
After an Oracle migration, write out a function into a View SELECT statement - This is the function oracle.xxxfloat BEGIN IF @first IS NULL OR @second IS NULL RETURN NULL IF @first < @second RETURN @first RETURN @second END Here is the select statement getting column2, where I need to write the function 'oracle.xxxfloat' inline as part of the select so I can phaze out the above function. In […] |
Convert stored procedure into a Table-valued function - <sorry, duplicate> =( |
Convert stored procedure into a Table-valued function - Feel like I'm missing something blatantly obvious. I am trying to return the cost of each of a set of ingredients as of a specific date (so I can sum them in the next step, for example). It works fine if I create it as a stored procedure, but when I try to create a […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. [email protected] |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Laden...
Laden...