Quantcast
Channel: Database Design forum
Browsing all 2729 articles
Browse latest View live

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 Article


Getting 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 Article


Image may be NSFW.
Clik here to view.

Visual 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 Article

Tips 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 Article

Image may be NSFW.
Clik here to view.

tempdb 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 Article


Getting 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 Article

Image may be NSFW.
Clik here to view.

Max 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 Article

Need 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 Article


Time 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 Article


INLINE 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 Article

Creating 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 Article

Image may be NSFW.
Clik here to view.

Sub-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 Article

Local 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 Article


Image may be NSFW.
Clik here to view.

How 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 Article

Image may be NSFW.
Clik here to view.

Insert 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 Article


How 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 Article

Image may be NSFW.
Clik here to view.

Cumulative 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 Article


How 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 Article

Are 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 Article

Is 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
Browsing all 2729 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>