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

Query Help Merging 2 Tables

I have 2 tables as follows and need the output to be as the 3rd example below. Ā I have tried using the left outer join, but have not been successful. Ā I am using SQLServer 2008. Ā Ā Any help would be...

View Article


CTE Query

hi,Ā  I need some help in writing a query . Scenario like i have some items stored in one place. The items are stored as boxes and each box have quantity. When i sell some quantity i need to chnage...

View Article


Need to execute the Store procedure based on the previous Store procedure got...

Hi Dude,I have three store procedure named as SPTest1, SPTest2 and SPTest3. In SPTest1 store Procedure, i have executed the SPTest2 and SPTest3 Store procedure continuely. Since my problem is, SPTest3...

View Article

Differences SQL and MySql

Hi guys, one non technical question. First at all, a message for the moderator: if this post break the rules of the forum please forgive me and I apologize. If I put this question is because I don't...

View Article

How to see intermediate results while testing procedure?

Hi everybody,I am testing a complex stored procedure. I added some print statements and the select from intermediate steps. I want to see results of these select statements while I am testing the code....

View Article


Need help in writing a SELECT statement with CASE and SUM function

Dear Experts,I am a newbie and trying to learn sql queries.The following query does not work, I know there is something wrong with the syntax.Please help me in writing this query better.Thanks in...

View Article

TSQL - Help need to Pivote a result

Hi,I have a table (TEST_ with the following dataClientĀ Ā Ā Ā Ā Ā Ā Ā Ā Ā  MarketĀ Ā Ā Ā Ā Ā Ā Ā Ā  ChannelĀ Ā Ā Ā Ā Ā Ā Ā  Old_ValĀ Ā Ā Ā Ā Ā Ā  New_Val ====================================================================== EISAI...

View Article

Median Calculation on T-SQL need Help

Hi Team,Thanks for looking into my question.I need a T-SQL logic for Median calculation as derived column .--Table Creation :create table EMP_MEDIAN ( Statusid int ,Statusname...

View Article


Help required compiling a Query

Hi,I have a transactions table with Tran_num, card_num, transaction_date and total_points for that particular transaction.I have to write a query that gives me the summary of the number of points...

View Article


Performance problem with image datatype

There are 1,500,000 rows in a table. The data type of a column is Image data. It costs one and half hours to query all the images data. This issue was reported by a importantĀ customer.Ā How to improve...

View Article

Creating views in build scripts without existing tables inside linked Server DB

I want to Create views in build scripts without existing tables inside linked Server DB. On Development server I dont have linked server setup for Source Database but on Pre-prod it is.I am able to...

View Article

Dynamically Create table and insert the records from source to destination in...

Hi, i have written below query for dynamically create the table and insert the records from source table. Declare @Sql Varchar(Max) Declare @x int declare @value varchar(100),@schema varchar(100) SET...

View Article

Script to Create Footprint ticket

Hello all,I want help on below scenario....Sp to Create Footprint ticket whenever file available in purticular folder..Thanks in Advance-:)I got an requirement that whenever files comes for purticular...

View Article


Please help - SQL Command

I haveĀ to write a SQL statement to create a trigger called "ValidOrder" checking the value of a new order inserted into the OrderDetails table is greated that $100. If the value is less that $100, the...

View Article

Please help - SQL Command

I have to write an SQL command that generates a stored procedure named 'spCustomerValue' that returns the total value of order from the OrderDetails table placed by customer whose reference is passed...

View Article


FIFO Cost of Goods Sold

I thought I had this problem solved already, but turned out my solution returned wrong info and also I can not figure out what that solution is doing by looking at it. So I'll present the problem again...

View Article

Image may be NSFW.
Clik here to view.

Need a T-Sql Query for the below mentioned scenario

I ahve 2 tables Employee and Employee_Type i would want the output as the 3rd tableĀ  as shown in the image below.would appreciate your help.thanks & Regards,rio.

View Article


Strip characters before a dash in SQL

Hi Is there a way to strip all characters from a text field before a dash (-)e.g. hello-world to just worldThe character length before and after the dash is not specific.Thanks

View Article

What is wrong with this SQL command?

Question: Write an SQL command using the 'having' clause that retrieves the order numbers of orders over $1000 grouped by the date ordered from the OrderDetails table.Answer:SELECT OrderRef FROM...

View Article

SQL Command try/catch block - Please help with command

I have a question that I cannot figure out, please help!Write an SQL command that utilises a try/catch block dividing 1 by 0 and notifying the client via a RAISERROR call.Can someone please assist?

View Article
Browsing all 23857 articles
Browse latest View live


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