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 ArticleStored 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 ArticleShow 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 ArticleAutomate 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 ArticleInlineFunction 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 ArticleHow 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 Articledynamic 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 ArticleIntersecting 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 ArticleRemove 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 Articlepass 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 ArticleSQL
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 ArticleSQL-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 Articlehow 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 ArticleCase 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 ArticleQuery 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 Articlehow 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 Articlehierarchy 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 ArticleSplit 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 ArticleCase 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