Fill up missing value with value from previous date until next appearing date
Hello,i have the following table:CREATE TABLE [dbo].[fill_up]( [date] [date] NULL, [value] [numeric](2, 1) NULL ) ON [PRIMARY] GO INSERT [dbo].[fill_up] ([date], [value]) VALUES (CAST(0x94360B00 AS...
View Articlesoap vs sql
guys, Im new to soap. I need to get data from that.the webpage says for example this function.function _getCarsList();$client=new SoapClient(...
View ArticleIncreasing View performance--missing index in one of the table used
I have a view definition as follows...I have databases Database1 and Database2. The table H is on Database2 and all other tables in Database1. select A.Id,B.ID,C.ID,D.ID,E.ID,F.Id,G.Id,H.HistoryId FROM...
View ArticleHow to parse a field that has one space in between
I have a field which is called Name and It contains first name , Middle name and last name, I need to parse these and put it in 3 fields called FirstName, MidName, LastName.Any help?GGGGGNNNNN
View ArticleANSI_WARNINGS off, deny permissions = transaction killed - Why?
When ANSI_WARNINGS are ON and an insert fails due to permissions being denied, a transaction continues.When ANSI_WARNINGS are OFF and an insert fails due to permissions being denied, a transaction is...
View ArticleShrink Database
Hi,I gone through the some of blogs/site.(http://www.sqlskills.com/blogs/paul/why-you-should-not-shrink-your-data-files/) that Shrinking Database a bad thing. Is it true?If yes what is the alternative.
View ArticleBest practice for procedures calling other procedures - chain them or call...
I am dealing with a situation that involves one procedure that calls another procedure which in turn calls another which...you get the idea. The chain is about 5 long. Yes its ugly and I want to...
View ArticleLinking data to new column
Hi,I have a metadata table that contains all the columns for my data table.E.g. oldcolumnname newcolumnname Size Size WorkIndustry Industry Acct AccountMy existing data table1 shows as below which uses...
View ArticleNot exists with CTE taking more time .
hi ll i am having query like this formatwith b as( select query -row return:11252 -10 secunion all select query - row return 55163 - 2 sec) select column1,column2,column3 from Tablename(row retun:35...
View ArticleUNION ALL
Hi there ive been trying to figure this out but not to many examples available,i have the following procedure:my question would be:if i want to add to new columns from 2 different new table how would...
View Articlebuilding SCD2 table issue
Hello,I have to build SCD type 2 on one column value. Before I implement "catch-modification" in our DWH, I have to load historical data to such dimension.I have original table which is catching...
View ArticleFinding Characters using LIKE and Wildcard...Problems
I need to clean up a database of a client now that they are using a new program. Some characters are not allowed as a Key field of their inventory database, such as $,#,space, etc. So they have a lot...
View ArticleExtracting individual words from a text column.
I've done many searches for an answer to this question but generally they are looking for specific characters or text in order to determine the data to extract and nothing really fits the bill that I...
View ArticleLinking data to a new column
Hi,I have a metadata table that contains all the columns for my data table.E.g. oldcolumnname newcolumnname Size Size WorkIndustry Industry Acct AccountMy existing...
View ArticleSplitting multiple rows into multiple columns
Hi All,I've got a scenario where multiple rows should be splitted into 3 different columns .For EG :EMPTest1test2test3Test4test5into 3 different columns as Test1test2test3Test4test5Is there any way...
View Articledelete rows
hihere is my queryCREATE TABLE [dbo].[CustomCode]([ID] [int] NULL,[pcondition] [varchar](50) NULL,[Pinten] [int] NULL,[scondition] [varchar](50) NULL,[sinten] [int] NULL ) ON [PRIMARY]insert into...
View ArticleDynamic Pivot Table - Incorrect syntax near '+ @cols +'.
When trying to build dynamic pivot tables, I keep getting the error message "Incorrect syntax near '+ @cols +'." I've pasted the query below exactly like I am trying to run it. Any help would be...
View ArticleWant to remove specific charcters and number from 1 column
Hello TeamI have 5 column table which name is content, here is below content table which is already created in my databasename,mobile, address, city,participatedwhere in column mobile there is i have...
View ArticleNeed help for fine tuning this query
Please advice on Query Tuning for below requirement.I have 4 tables Table1....Table4. Where Table1 will be used for other three tables.I have query something as below;With Chk As ( Select Distinct Col1...
View ArticleAdvice on modifcation of Merge statements.
Hey,I have a one set of Merge statements which does updates and inserts as per the matched and non matching values.Since this Merge statements are taking time for the process I need to modify the...
View Article