concatenate rows by new line separator from sp_helptext value
I have a query like this belowDEclare @SQL VARCHAR(MAX) Declare @FinalSQL VARCHAR(MAX) Declare @val Varchar(MAX); DECLARE @SchemaName nvarchar(50)= 'aksfood' CREATE TABLE #T1 (text varchar(max))...
View ArticleGetting first line of data from log table
Hello All,I have a table log that contains the following rows. For every given log case I have the following logs id case number Created By Activity Type 247527901 123 Agent2 Transfer 247527900 123...
View ArticleVisual Studie: Sql Schema Compare does not map identical Primary Key (and...
Hi,I use Visual Studio SQL Schema Compare to update a productive SQLServer DB based on the development DB.Due to some varying set-ups there are some tiny variations in my UserData-table definition that...
View ArticleTips on logging updates and deletes of data, executions of procs and...
Hi,I am working on improving the way my team is able to create audit trail and review changes made to data and objects within MSSQL. We will mostly be using MSSQL 2016 or higher. Apologies for the...
View Articletempdb table Cannot delete files - file name is too long
Hi Im having issue with tempdb temporary tables and unable to delete manually due t long name . Any one can advise how to delete manually .
View ArticleGetting last values in log based on specific value
Hello All,I have a log table where I have ticket log.In the log the column Activity type has many values like belowGroup transfer and Assignee transfer occurs many times in the logBut I need to get...
View ArticleMax date value capture issue
Hi Team,Currently we have requirement to capture max date SL_PK, According to currently i tried below Query then its value getting duplicated, Could you please support to get max date wise SL_PK?select...
View ArticleNeed Query for Populating Junk Dimension
Hello Team,We have requirement to create dimension with six columns with all possible combination of TRUE and False. Can some one please provide sql query to populate the data into the dimension...
View ArticleTime difference between 2 rows
Hello All, I have a log table where I have ticket log. In the log the column Activity type has many values like below Group transfer and Assignee transfer occurs many times in the log But I need to...
View ArticleINLINE INDEX - INCLUDED columns syntax?
I have almost always created my indexes in separate statements from the CREATE TABLE statement. Now I am working in an environment that uses DAC package deployments. For whatever reason, the indexes...
View ArticleCreating store procedure
I'm trying to create a store procedure, but for some reasons, I get an error ofIncorrect syntax near the keyword 'CONSTRAINT'. I've check to make sure everything is ok, but can't figure out. --...
View ArticleSub-string issue on Capture specific dataset
Hi Team,Currently i'm tried to capture specific data set using Sub String command but still unable to achieve my requirement, Could you please support to capture that data part for your reference here...
View ArticleLocal Database data synchronization delay issue
Hi Team,Currently i have created local database on the server and have setup merge query on the sql job, Data need to merge with cloud ERP database to Local Database (Only Few Tables), According to...
View ArticleHow to update last record by a trigger?
I have a database system which includes three tables accounts,transactions and transaction_typeTransaction_type table contains Transaction_Type_Id which is primary key.Transactions table contains...
View ArticleInsert 3 records
So I just started using databases, and I've encountered a problem.I have a table with an ID, DateStart, DateStop and Frequency. I need to set 3 records to Frequency and only 3(often, monthly, weekly).I...
View ArticleHow to update parent table identity column values in child table
Hello,I have parent and child tables and already populated with data. We have identity column in parent table and we are using this column values in child table. We found an issue that parent table...
View ArticleCumulative Update complete with Failure
HI guys,Today I have download the cumulative update for sql server.After installing the update its showing update installation complete with failures1.Database Engine services failed.?2.SQL server...
View ArticleHow to Capture SQL Record time Stamp
Hi Team,Currently i have a requirement Capture SQL table Record timestamp when there not available any column on the table, How can we capture record (data row) created or last modified data time...
View ArticleAre statistics important on a table that is almost exclusively INSERT
We're having an issue running stats on a large table. This table is primarily for audit purposes, and very rarely used to fetch data. Running stats is no taking greater than a day. Is it advisable to...
View ArticleIs there anyway to convert a key-value model sql database to a relational model?
I understand there are reasons for using a key-value model but for the life of me I cannot see any advantage for the client in the scenario I have found myself in. I am recently hired to help with...
View Article