Great! thank you very much!
Fang Ming
Posts
-
sql to convert an int to varchar -
Problem in String Compare" it will take a significant amount of time if the tables grow" yeah ,that's the truth. i just gived a way to resolve Patel's problem. in general , yours must be the first and best choice.
-
Problem in String Comparetake it carefuly Patel's table: ProductID CagtegoryID 1 1,2, 2 1, 3 4, 4 2,3, search condition : categoryid=1,2 i transform it to : CagtegoryID %,1,% %,2,% my statement was
"select * from [your table ] A where exists (select 1 from @temp B where
','+A.CagtegoryID like B.CagtegoryID )"
the "','+" can handle the leading first Cagtegory. and the data in Patel's table "1,2**,",the last ",**" can handle the last one -
Problem in String Comparecreat a temporary table declare @temp table ( CagtegoryID varchar(100) ) insert the CagtegoryIDs into this table one by one it will be like CagtegoryID %,1,% %,2,% then try this statement select * from your table [your table ] A where exists (select 1 from @temp B where ','+A.CagtegoryID like B.CagtegoryID
-
retrieving servers list using dmotry 1.install the sql server client on the other machine 2.register SQLDMO.DLL to the other machine using regsvr32 command line SQLDMO.DLL locates ~~Program Files\Microsoft SQL Server\80\Tools\Binn you'll have to copy some other dll files in the same folder (i cann't remember exactly) to the other machine before you can register it.
-
sql to convert an int to varcharooh. i m sorry i mean how can i convert that to varchar with leading zero: 10 -> 10 0~9 -> '00' ~ '09' and it will be used in a " insert ... select ... from ..." statement. i have a table that containts a datetime column. now i want to transform the data in this to another i have to convert datetime to varchar such as : '2007-09-29 08:05'(datetime) -> '08:05' (varchar) my poor statement is "convert( varchar, datepart( hour , [DateTime] ) ) +':' +convert( varchar, datepart( minute , [DateTime]) ) " but the result is '8:5' what my boss don't want help me. thanks a lot.
-
sql to convert an int to varcharnewbie's question: how to convert an int to varchar using sql script,such as 1 ->'01' ? thanks