Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
declare @ds varchar(25)
set @ds = CONVERT(CHAR(10), GETDATE(),126)
set @ds =  LEFT(@ds, LEN(@ds) - 6)
set @ds = RIGHT(RTRIM(@ds), 2)
select @ds+ '/' + RIGHT('0000' + <big>CONVERT(VARCHAR(5),MAX(CAST(RIGHT(COLUMN_NAME,5)AS INT))+ 1),5) DC_No from Table_Name


i need to make a view or function with this query
but i cant make function because i don't know how add 'set' in function
plz Help in this Query
Posted
Updated 9-Apr-13 19:51pm
v3
Comments
Maciej Los 10-Apr-13 2:08am    

1 solution

There is nothing special to do.

Please, follow the instruction: http://msdn.microsoft.com/en-US/library/ms186755%28v=sql.90%29.aspx[^]
 
Share this answer
 
Comments
saimm 10-Apr-13 5:47am    
there is so much detail
plz short ans how i do...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900