Quantcast
Channel: Transact-SQL forum
Browsing all 23857 articles
Browse latest View live

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 Article


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


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

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

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


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

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

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


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


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

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

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

Image may be NSFW.
Clik here to view.

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


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

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


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

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


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

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

Advice 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
Browsing all 23857 articles
Browse latest View live


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