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

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 Article


How 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 Article


Select 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 Article

isnull 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 Article

BIT 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 Article


Running 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 Article

error 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 Article

obtaining 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 Article


Image may be NSFW.
Clik here to view.

Date 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 Article


Inner 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 Article

Slow 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 Article

how 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 Article

IF @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 Article


Transaction 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 Article

Trigger - 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 Article


Odd 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 Article

Problem 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 Article


Help 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 Article

Error 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 Article

How 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
Browsing all 23857 articles
Browse latest View live