User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
DaniWeb is a massive community of 391,654 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,800 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Showing results 1 to 14 of 14
Search took 0.01 seconds.
Posts Made By: huangzhi
Forum: MS SQL Jun 9th, 2008
Replies: 1
Views: 966
Posted By huangzhi
Re: dynamic sql query...

create table #tmp (Code varchar(255), Price money, Date smalldatetime)

insert #tmp (Code, Price, Date)
select 'ProductA', 12.00, '12/10/2002' union all
select 'ProductA', 12.50, '01/15/2005' union...
Forum: MS SQL Jun 9th, 2008
Replies: 5
Views: 1,440
Posted By huangzhi
Re: MS SQL query using Max

create table #tmp (Code varchar(255), Price money, Date smalldatetime)

insert #tmp (Code, Price, Date)
select 'ProductA', 12.00, '12/10/2002' union all
select 'ProductA', 12.50, '01/15/2005' union...
Forum: MS SQL Jun 3rd, 2008
Replies: 1
Views: 634
Posted By huangzhi
Re: Converting MYSQL statement to MSSQL

Try this code.


SELECT DISTINCT
COALESCE (s3.ADM_CODE, s1.ADM_CODE) AS Expr1, COALESCE (s3.FULLNAME, COALESCE (COALESCE (CASE s2.shortform WHEN '' THEN NULL
...
Forum: MS SQL May 11th, 2008
Replies: 6
Views: 754
Posted By huangzhi
Re: Problem using JOIN with six tables

Try this code

select c.name, isNull(doc_A.Doc_A, 0) as Doc_A, isNull(doc_B.Doc_B, 0) as Doc_B, isNull(doc_C.Doc_C, 0) as Doc_C, isNull(doc_D.Doc_D, 0) as Doc_D
from tUsers u inner join tContacts...
Forum: MS SQL May 8th, 2008
Replies: 2
Views: 1,629
Posted By huangzhi
Re: Maximum stored procedure, function, trigger, or view nesting level exceeded(limit 32)

You cannot increase this limit. You must change your program. See http://www.daniweb.com/forums/thread114466.html. Hope this link can give you some idea.
Forum: MS SQL May 1st, 2008
Replies: 1
Views: 705
Posted By huangzhi
Re: Sub-Select

select top 1 *
from (select *
from (select * from table where columname > '2') X
where columname > '4') Y
where columname > '6'
order by columname desc
Forum: MS SQL Apr 23rd, 2008
Replies: 2
Views: 1,470
Posted By huangzhi
Re: MS SQL Update Query

update ABC
set XYZ = left(XYZ, 8) + 'A' + substring(XYZ, 9, 1000)
where XYZ like '%P' and XYZ not like '%A%'
Forum: MS SQL Apr 21st, 2008
Replies: 2
Views: 1,183
Posted By huangzhi
Re: insert data between SQL servers

I think you use Transaction. So you must start Distributed Transaction Coordinator on both server.
Forum: MS SQL Apr 14th, 2008
Replies: 1
Views: 411
Posted By huangzhi
Re: Query logic

I think you can create identity columns.


create table #tmpTemp
(ID int identity(1,1),
Code varchar(255),
Name varchar(255))

insert #tmpTemp (Code, Name)
select 'A', 'AA' --> replace...
Forum: MS SQL Apr 10th, 2008
Replies: 2
Views: 575
Posted By huangzhi
Re: To pull all emails that contains +,^,*,&,!

The correct code is:

select * from mail3 where email like '%+%' or email like '%*%'
Forum: MS SQL Apr 1st, 2008
Replies: 1
Views: 1,011
Posted By huangzhi
Re: Read row in a CLR Stored Procedure Without output parameter

Hope this code can help you.

1. Execute your first SP in query analyzer to show the columns list.

2. Create temporary table and the field must the same as first SP columns

create table #tmpTemp (
...
Forum: MS SQL Mar 19th, 2008
Replies: 2
Views: 951
Posted By huangzhi
Solution Re: Depth Travesal

Try this code in Query Analyser. It enough for small data. If you want to use for big data, modify the code.


set nocount on
create table #tmpName (ID int, [Name] varchar(255))
create table...
Forum: MS SQL Feb 14th, 2008
Replies: 2
Views: 1,101
Posted By huangzhi
Re: Problem in finding birthday from date of birth in SQL Server

Try this code

select 1 as EmpID, 'John' as EmpName, '2007/01/01' as DateOfBirth
into #tmpData
union all
select 2 as EmpID, 'Anne' as EmpName, '2007/01/05' as DateOfBirth
union all
select 3 as...
Forum: MS SQL Feb 6th, 2008
Replies: 6
Views: 6,408
Posted By huangzhi
Re: How do I ban ip addresses using MsSQL script?

you need to create table tb_IPList (IP varchar(20)) and code (in ASP) below:
<%
option explicit

Dim Conn as object
Dim RS as object

set Conn = createobject("ADODB.Connection")
Conn.Mode =...
Showing results 1 to 14 of 14

 
All times are GMT -4. The time now is 1:31 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC