Viewing 15 posts - 31 through 45 (of 113 total)
pls give any dummy value to that variable..
it is not pass that value to to file system task..
for validation purpose only........
October 23, 2012 at 12:37 am
PLS try below mentioned steps:
(1) go to flat file show advance advisor .
(2) go to input and output columns
(3) go to filat file sorce output--> output columns
...
October 23, 2012 at 12:30 am
try below code....
declare @Questions varchar(MAX)='1-32|26,42-41|32'
--select * FROM [dbo].split(@Questions)
SELECT ...
October 18, 2012 at 4:45 am
USE BELOW CODE...
--DROP TABLE #temp1
declare @STR varchar(100)='12345678910111213141516'
declare @pos varchar(50)='1,1,2,5,4,2'
declare @t int=0
create table #temp1(id varchar(100))
WHILE CHARINDEX(',',@pos)>0
BEGIN
set @t=SUBSTRING(@pos,1,(CHARINDEX(',',@pos)-1))
INSERT INTO #temp1 VALUES( substring(@str,1,@t))
SET @pos=SUBSTRING(@pos,(CHARINDEX(',',@pos))+1,LEN(@pos))
set
October 18, 2012 at 3:45 am
first create function after call that function in your query...
Text
CREATE FUNCTION SPLIT(@VAL VARCHAR(MAX))
RETURNS @T1 TABLE(COL1 VARCHAR(MAX))
AS
BEGIN
WHILE CHARINDEX(',',@VAL)>0
BEGIN
INSERT INTO...
October 17, 2012 at 10:12 pm
PLS TRY BELOW CODE:
CREATE TABLE #tmp_end_date
(ID INT,
tgs_rec_eff_dt DATE,
tgs_rec_end_dt DATE,
SEQNUM INT )
GO
insert into #tmp_end_date values(12345,'15-Mar-2012',NULL,4)
insert into #tmp_end_date values(12345,'10-Feb-2012',NULL,3)
insert into #tmp_end_date values(12345,'2-Feb-2012',NULL,2)
insert into #tmp_end_date values(12345,'05-Jan-2012',NULL,1)
;WITH A
AS(SELECT *,DENSE_RANK()OVER(PARTITION BY ID ORDER BY ...
October 17, 2012 at 3:54 am
try below code.....
declare @t1 table (day varchar(10),value int)
insert into @t1
select 'june 1',4
union all
select 'june 1',5
union all
select 'june 1',2
union all
select 'june 2',1
union all
select 'june 2',5
union all
select 'june 2',3
select [Day], AVG(convert(decimal(10),[Value])) as...
October 15, 2012 at 10:26 pm
Pls check conditions...
DECLARE @T TABLE (ID INT,DAT DATETIME)
INSERT INTO @T(ID,DAT)
SELECT 1,'2012-04-01 10:20:00'
UNION
SELECT 1,'2012-05-01 10:20:00'
UNION
SELECT 1,'2012-06-01 10:20:00'
SELECT * FROM @T
WHERE DAT >= convert(datetime, '04/01/2012')
and DAT < convert(datetime, '06/15/2012')
October 9, 2012 at 11:54 pm
DECLARE @DATE=(SELECT DATEADD(MM,DATEDIFF(MM,0,GETDATE())+1,0))
use above variable to your query
if next time to chage data is very easy...
October 3, 2012 at 1:22 am
pls try below code:
declare @days int=350
select convert(varchar(10),(@days/7))+' '+case when (@days-((@days/7)*7))=0 then '' else convert(varchar(10),(@days-((@days/7)*7)))+'/7' end
October 3, 2012 at 1:11 am
pls try below code.
SELECT CUSTOMER_NUMBER,
RECEIPT_ENTRY_ID,
RECEIPT_DATE,
CHECK_NUMBER,
CHECK_DATE,
CUSTOMER_BANK,
RECEIPT_STATUS,
RECEIPT_HEAD,
RECEIPT_AMOUNT,
SERVICE_TAX,
REVERSED_DETAIL,
ACCOUNT_HEAD,
convert(nvarchar(20),PRINT_DATE) PRINT_DATE,
PRINTED,
RCVD_FROM
FROM OPENQUERY(PRODERP,'SELECT
CUSTOMER_NUMBER,
RECEIPT_ENTRY_ID,
RECEIPT_DATE,
CHECK_NUMBER,
CHECK_DATE,
CUSTOMER_BANK,
RECEIPT_STATUS,
RECEIPT_HEAD,
RECEIPT_AMOUNT,
SERVICE_TAX,
REVERSED_DETAIL,
ACCOUNT_HEAD,
PRINT_DATE,
PRINTED,
RCVD_FROM
from Apps.xxcom_cust_receipt_details') a
September 14, 2012 at 5:27 am
PLS TRY BELOW CODE..
SELECT TABLE_NAME,COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH,NUMERIC_PRECISION,NUMERIC_SCALE FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME
IN(SELECT name FROM sys.tables)
ORDER BY TABLE_NAME
September 13, 2012 at 10:11 pm
Pls try below code.
CREATE TABLE #table1
(
ID Nvarchar (10),
Date DATE
)
INSERT INTO #table1
(ID,Date)
SELECT '1', '12/31/2078'
UNION ALL
SELECT '1', '12/31/2011'
UNION ALL
SELECT '2', '12/31/2011'
UNION ALL
SELECT '2', '11/30/2011'
UNION ALL
SELECT '2', '10/31/2011'
SELECT *,(SELECT...
September 12, 2012 at 1:12 am
Viewing 15 posts - 31 through 45 (of 113 total)