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

How to get the pivot result for these 3 tables ?

....

View Article


SQL Query

I'm trying to use an SQL query to find parts that have three or more orders in a week's timeframe. The weeks would be as follows: 9/2/13-9/8/13, 9/9/13-9/15/13, 9/16/13-9/22/13, and so on. I want the...

View Article


Stored Procedures for a new Method

I am looking to resolve a stored procedure issue.  I am trying to return the results for the following method: [WebMethod]        public ReturnICAOInformation GetICAO(string ICAO, string Country,...

View Article

Show Count Of Weekly Production

I have seen several examples close to what I am after, but none that hit the nail on the head (and I am not savy enough to tweak to hit exactly my needs).  Heres the story, I want to declare a local...

View Article

Automate Updating Tables with data from CSV files SQL 2012 Ent.

I have CSV files I've imported into a new SQL DB (SQL 2012) as tables. I would like to update the database with the new versions of the CSV files which are generated weekly. What is the recommended way...

View Article


InlineFunction recompilation

Hi All,I have inline table vauled functions with four input parameters. Every time i call the function with different parameters.I need to recompile the inline function every time. Is there any way to...

View Article

How to decrypt values in a sql table

Hi,We have table name Org, it has two fields Orgname and OrgID. The Orgname is a varchar(255) and data in that field is encrypted using  dot net code. Can some tell me how to decrypt that field using SQL

View Article

dynamic sql output to stored procedure

I have two sp's- main_sp & other_sp. other_sp code is written seperately but it accept 3 parameters supplied from main_sp and it is part of main_sp.alterprocedure...

View Article


Intersecting values of Two Tables

I have two tables, each with 40 columns. Row Id is what I want to join on. Table A contains Customer InformationTable B Contains Metric information for that customer. For each Customer I only want...

View Article


Remove spaces

Trying to remove the space between 2 last names.Sample Last name is Johnson Avery, I want the output to JohnsonAvery.  Tried the function dsi_fnremovechars but that did not work.  What else would be...

View Article

pass dynamic sql values to other stored procedure

I have two sp's- main_sp & other_sp. other_sp code is written seperately but it accept 3 parameters supplied from main_sp and it is part of main_spalterprocedure main_spas declare@ReturnTable...

View Article

SQL

Hi All,I have following table in which I want to get the name which does not have type 'a'. In this case it should give me only marry.NameTypeJohnaJohnbJohncMarrybMarrycMarrydThank you in advance

View Article

SQL-CTE and IF clause in Function

Hi Experts ,I have create function which works fine .But I need to modify it ,which comes to me as a challenge . Below is my Function Which worksCREATE FUNCTION RETURN_DATES1 (@Date_part...

View Article


how to check the previous records and after records

Hello everyone,Need help in the following scenarioEveryday we get blood donations, i need to check the test_results for that donations and needs to update status.JAN  09  statusA   (Here, we dont have...

View Article

Case of the Age

Hi Friends,                 I want to find out the age of the case every week. For example: I have in my table like belowCreate table #Case ( caseopened date, caseclosed date ) insert into #Case values...

View Article


Query Time out option in OpenRowSet

Team,     My requirement is to loop through around 100 SSAS Instances and run an MDX query and get response from SQL Server.     To achive this , I used openrowset solutions    SET @sqlquery =N'SELECT...

View Article

how to Commit transaction even the trigger fails?

Hi Everyone, I got a situation here, i have two tables and a trigger. A main table and a log table. Whenever  a change happens in the main transaction ,   a log details will be inserted into the log...

View Article


hierarchy data using recursive CTE

I'm working on a report that is in picbasic(yippee) and converting it to .NET. The tables are all pulled from unibasic tables to sql tables. The report is suppose to look like the example below or...

View Article

Split date range without Calendar table

Hi guys!Is there any way to split date ranges (to days / hours / minutes) in one table without using Calendar table (without joining 2 tables)?Reason I'm asking this is because we have a huge Fact...

View Article

Case Statement Question

I currently have a successful case statement that returns "True" for a condition and "False" for those that don't meet the condition. However, I would like my query to return only "True" statements,...

View Article
Browsing all 23857 articles
Browse latest View live


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