split column
Hi friends,I know this is simple but due to time issue I'm posting here.declare @a varchar(50)='$3500 x FBDs /3' Select @anow i want the result into three columns value type multiplier$3500...
View ArticleHow to change a field data type on referenced tables
Dear all,I have a certain amount of tables in my database structure for which I need to change a field data type value.Those tables are referencing deeply by other tables and of course I am not allowed...
View ArticleSelect people who didn't renew their license registration
Say i have to generate a report to show the people who didn't renew their license registration , renew of license registration must be every year , i want to select by the date of last renew which...
View Articleisnull not working
I have the following SQL statement run by 2008 R2 version ,max(CASE WHEN Rn = 3 THEN isnull(Name,'-') END) AS [Salesperson #3]The expected result is to replace null with the character '-' but it shows...
View ArticleBIT Data Type set to Null not returning result set.
Hello!What could be wrong with the Stored Procedure below? (Please note that this is just an illustration of what I want to achieve with the BIT data type)CREATE PROCEDURE #TestingProc ( @StartDate...
View ArticleRunning Sum
Hi All,DECLARE @example TABLE(ID INT, Amount float) INSERT INTO @example VALUES(1,100), (2,500), (3,50), (4,200) select * from @exampleDECLARE @Target Float = 600Now, I need top records where...
View Articleerror of lock request time out period exceeded
Hello,The user is reporting below errorerror of lock request time out period exceeded.Please suggest.Best regards,Vishal
View Articleobtaining date without stamp time
The datetime is stored in the table as the following: 2014-03-03 00:00:00.000 2014-03-03 00:00:00.000 2014-03-03 00:00:00.000 2014-03-03 00:00:00.000 2014-03-03 00:00:00.000 2014-03-03 00:00:00.000...
View ArticleDate parsin
I need to parse a column that has every different variation of date entries into three categories1. Full Date2. No Date(empty or bad)3. PartialThe problem I run into is that it has every possible of...
View ArticleInner Join or Merge in a single Table?
I have a Single table with City date type vlCC vlVV keyLondon 24-01-2014 CC blue key1 London 25-01-2014 VV...
View ArticleSlow running query --General question
This is just a scenario that you may have come across too. For example there is a query (tables and views) that returned data very quickly until yesterday but slowed down today and takes forever. What...
View Articlehow to exclude a single database from the transaction log backup
How do I exclude a specific backup from Backup TLOG job?C:\Progra~1\Tivoli\TSM\TDPSql\tdpsqlc" backup * log /tsmoptfile="C:\program files\tivoli\tsm\tdpsql\dsm.opt" /sqlserver=Please advise what do I...
View ArticleIF @Parameter Value
I'm trying to use an IF Statement within my Stored Procedure and it's flagging it in Intellisense as "Incorrect Syntax near 'IF'Here's the SQL...WITH CTE_MEMBER_X_DETAILAS (SELECT...
View ArticleTransaction History Updates Slow
Hello ...i have created a transaction history table that now contain 10000 row , in some case i want to delete row , this deletion caused a large number of updates for material and underline other...
View ArticleTrigger - The current transaction cannot be committed and cannot support...
Hi,I have trigger will do insert in to audit table if any DML like Insert,Update and Delete.But Some times the audit table is missing data is nothing but trigger fails.So I have added TRY/CATCH to...
View ArticleOdd problem with cursor
Hi,Have a bit of a problem with a couple of stored procedure (one calls the other) which I use to extract routines from a SQL 2012 database into individual files. I get an error message about creating...
View ArticleProblem using T-SQL for Excel Import
In SSMS, working with SQL Server 2008 R2, I can choose Database, Tasks, Import which launches the SQL Server Import and Export Wizard. I can use the Wizard to create and save a SSIS package to import...
View ArticleHelp send query in HTML
So I have the below sql job that is send me the information but in a non readable format. I would like to make this an HTML email. Can you please help me.I have try to reproduce...
View ArticleError Handling in Stored Procedure code
Hi All,I need to know which step is failing and whats the error message when i run a stored procedure.Lets say i have a stored procedure with below content.So i want to know which of the below four...
View ArticleHow to display Date only in SSRS ?
Hello Everyone.I have a question as listed below.CREATE TABLE dbo.Emp (id int not null,name varchar(100) null,from_date datetime, null,to_date nvarchar(1000) null)I have few date columns have datetime...
View Article