Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2017 - Development |
Transaction has no commit error - All, I have an unusual scenario. A developer sent me some code that has a BEGIN / COMMIT and a rollback right before the commit. It's all wrapped in a reasonable TRY...CATCH. The script builds some dynamic SQL INSERT statements using OPEN_QUERY, dynamic because the WHERE clause depends on some variables. The INSERT statements they […] |
SQL Server 2016 - Development and T-SQL |
How to remove special chars? - Hi everyone, So I have a xml file from which I am trying to import data into my sql tables. I noticed there are some special characters inside the file due to which I am unable to import data properly. Look at the below screenshot: Can anyone tell me what are there square boxes and […] |
SQL Server 2019 - Administration |
How to resolve Login differences between Primary and Secondary cluster nodes - I'm a bit rusty with SQL clustering so please bear with me, thanks. I have a 2-server availabilty group. The other day it failed over during a patching reboot, and a Linked Server connection no longer worked while it was failed over to secondary. Initiating a manual failover back to the original primary resolved the […] |
Azure SQL - Import Data-tier application - Hello! Where can I find log to see how long it took for Import Data-tier application to create new database from the bacpac file? Or is there any script that can be used to get the completion time? Thanks in advance. |
Cannot bulk load because the file could not be opened error - This is a weird one. My user has two NAS shares. QC and Test and two SQL Servers, QC and Test. She has bulk admin permissions on her account and the NAS share (according to the windows group) also has her permissions. She's running the following code: select * FROM OPENROWSET( BULK '//My/nas/Share/QC/MyFile', SINGLE_BLOB) AS […] |
SSMS is filling up our C: drive -- installed on E: - Good day. I didn't know where else to post this, so forgive my ignorance if this isn't the place. I have a situation that involves a single Windows Server with SSMS installed that has the only permissions to hit another organization for our Data Warehousing team. There may be as many as 4 BIDS plus […] |
Trigger on update when changed only desired XML tag. - Hello! I have a task to configure for the Skype for business database logging of user status changes (Available/Away/Offline/etc). i found source for this data in XML field with content like: 15500 |
To get a list of un-used columns in all tables in a database - I am looking to get a list of un-used columns in all tables in a database. I would like the output to look like something like this. DatabaseName, SchemaName, TableName, ColumnName, etc If anyone has a handy script or any link, please share. Thanks. |
SQL Server 2019 - Development |
SELECT ROWS ON TIME CRITERIA - Hi, I would like to retrieve only the rows after 23:59:59 but I am getting the output as shown in the picture. Please advise how to write a correct where clause SELECT ID, STARTDATE, STARTTIME, ENDTIME FROM MACHINELOG WHERE (STARTTIME > CAST('00:00:00' as time(0)) AND ENDTIME < CAST('09:00:00' as time)) ORDER BY ID DESC |
SELECT ROWS ON TIME CRITERIA - Hi, I would like to retrieve only the rows after 23:59:59 but I am getting the output as shown in the picture. Please advise how to write a correct where clause SELECT ID, STARTDATE, STARTTIME, ENDTIME FROM MACHINELOG WHERE (STARTTIME > CAST('00:00:00' as time(0)) AND ENDTIME < CAST('09:00:00' as time)) ORDER BY ID DESC |
Iterate and assign Query help - Table:SchoolTeacher TeacherName Zip City State ------------ ---- ------ ------ Sam 12345 NJ NewYork Pat 12345 NJ NewYork Peter 12588 Spring MD School: SchoolLocationID Zip City State -------------- ------- ----- ----- 105 12345 NV NewYork 105 12345 NJ NewYork 106 12345 NJ NewYork 107 12588 Spring MD BusinessRule: 1) Match should be done on Zipcodes if […] |
SQL Query to display having only values - I am having below -mentioned table1 and I would like to display it as shown in the below table Can someone help me with the query Thanks in advance |
SELECT with computed values - From a huge and ever growing table (tbl_Values) I need to select all records which conform to rules defined in another table (tbl_Rules). Each record in tbl_Values has a time_stamp (datetime) and a fvalue (float); the rules defined in tbl_Rules have a WeekDay (int), a HourOfDay (int), a MinValue (float), a MaxValue (float). Records from […] |
SQL Server 2022 - Development |
Case and When Query - Hi All, I want to rewrite the below query using the Case and When statement Query 1 update [SF_Title_Update] set [Title_Proper]='Human Resource Management System Manager' from [SF_Title_Update] where ( title like '%Human%' and title like '%Resource%' and title like '%Management%' or title like '%HRMS%' ) and (job_level='Manager Level' ) and( [Title_Proper]=' ' or [Title_Proper] is […] |
Dynamic Query - Hi All, I have to generate a dynamic query for the below mentioned keywords to update them in Title_Update column Keywords Recruitment Employee Engagement Performance Management Training and Development Compensation and Benefits Human Resource Diversity and Inclusion Also it should have the below mentioned Job Level Chief Level Director Level Head Level Manager Level Managing […] |