Choosing the Birthday of a Customer by month?
[code language="sql"]CREATE TABLE birthdays( cust_id INTEGER NOT NULL PRIMARY KEY ,cust_fname NVARCHAR(50) NOT NULL ,cust_lname NVARCHAR(50) NOT NULL ,cust_dob DATETIME NOT
View ArticleCoverting SSRS 2005 rdl to SSRS 2015 rdl
HiI apologise if this I in the wrong place.I hope you can help, we have recently move from SQL Server 2005 to SQL Server 2014. I have now been tasked with moving the reporting services reports from the...
View ArticleTricky LAG() and Windowing Script
I have a requirement where 3 records *should* be getting recorded on the patient at the same time. However, occasionally one of those records does not come through and when that happens, I need to look...
View ArticleUnusually Expensive Deletes
Hi all,I have a scenario on a few of our servers that I can't quite explain that I'm hoping someone can help me with. We have a Dynamics CRM system that we routinely need to delete single records out...
View Articledecimal places correction
Hi All,I want my numbers to be converted from a column which is of nvarchar(100) datatype to decimal(18,2).How can I correct it?select CONVERT(DECIMAL(18,2),'129399389') --I' am getting output as...
View ArticleAlternative to a table valued function in SQL Server
Hi All,we have a table valued function fn_ProductType which accepts a ProductID and Order Date as inputs and returns 1 row with 4 columns. ProductID, IsPro,IsBasic,IsOther.The function basically checks...
View ArticleQuery Optimization Advice
Hi All,So I'm faced with the need to optimize a pretty hefty query, as it'
View ArticleResolving many to many linkage
[code language="sql"]USE [iMIS_Prod]GO/****** Object: Table [dbo].[BM_OnlinePass_Subscription_Archive] Script Date: 11/29/2017 9:52:07 AM ******/SET ANSI_NULLS ONGOSET
View ArticleSSMS breakpoint won't add
I'm having an issue in SSMS 2014 where I'm trying to debug a sql script and everytime I try to add a breakpoint ssms becomes unresponsive and won't add the breakpoint. I then have to close ssms via...
View ArticleRedirecting Error Rows using SQL
Can anyone give an example of TSQL to redirect error rows similar to the functionality in an SSIS data flow task?
View ArticleErrors with SSIS web service task
I create a SSIS web service to retrieve data from remote server, Server connection is good, but get the following error:[Web Service Task] Error: An error occurred with the following error message:...
View ArticleItem Price changes
I have a table where we store price information for each item and prices can be changed anytime during the month. How can I store and retrieve correct information based on price updates. Please check...
View ArticleDid anybody have this problem
I have simple query:[code language="sql"]SELECT (select ISNULL(SUM(TOTAL_PAYMENTS),0) from Orders where ST_ID IN(SELECT ID FROM Name where CO_ID = 11750) and ORDER_DATE > '2015-05-08 00:00:00.000')...
View ArticleHelp to reduce stored procedure execution..
Hi Experts,Need some suggestions on below sp to improve performance of the sp. Currently taking 10 -15 secs to execute.Trying to see if we can reduce the overall execution time. I have no much info...
View ArticleSql 2014 Developer Edition Dowload Location?
My work machine died last week, so I got issued with a replacement. It's still Win 7 image, so I can't install 2016 or 2107 and I lost my local cache of MSSQL install media with the old machine.Does...
View ArticleCouldn't create SSISDB catalog
Hi Every one, I have a issue that I couldn't create SSISDB catalog under the Integration Services Catalogs. The error message is " the catalog backup file 'C\Program file\...\SSISDBbackup.bak' could...
View ArticleLogic to check for empty table before joining
Hi All,I have a requirement which requires me to display report as per the dimension access to the user trying to pull the report. Just to give an example.. My dimension "Dimension.Sites" can have more...
View ArticleCreating a column using a select where statement
I am trying to create columns by a time frame where column a would be from 8am to 10am, column b would be from 10am to 12pm, etc..This is what I have so far, I would like to create a column using the...
View ArticleChanging sys.configurations for SQL Azure instance? Is that possible?
Hi All,If I would like to change the sp_configure settings on a SQL Azure instance, how can I do that? Can we do that using tsql statement or something which has to done in azure portal? This is a...
View Article