Viewing 8 posts - 1 through 9 (of 9 total)
Run this ...
declare @t1 table(a int, b datetime)
insert into @t1 values(1, '9/1/2010')
insert into @t1 values(2, '9/5/2010');
declare @t2 table(a int, b datetime, c varchar(10))
insert into @t2 values(1, '9/12/2010', 'Dublin')
insert into @t2...
September 23, 2010 at 11:07 am
Thanks in advance for any help you can provide.
I have the following;
ID Desc Amt Status
1 Item1 10 Unknown
1 Item2 20 Unknown
1 Item3 15 Known
2 Item1 25 Unknown
2 Item2 10 Known
2...
September 21, 2010 at 11:45 am
Two developers invoke the same stored proc and a deadlock (usually) results. From the xml output of sql Profiler, the deadlock occurs on the PK of table B (B_ID). Here...
September 19, 2010 at 6:08 pm
You can use charindex too, but convert the string into table is better performance in general.
EX: select * from @temp where charindex(id,@str) > 0
Note, don't use this. It is a...
September 2, 2010 at 11:52 am
Yeah, not sure why you have to start a new thread. Anyway ....
select distinct * from table where column1 in (select distinct column from table)
Not surprised if the query returns...
July 17, 2010 at 4:22 pm
Just add a root
-------------------
DECLARE @yourText varchar(10000)
SET @yourText ='
<Employee>
<SSN>987654321</SSN>
<Employee>
<FirstName>MOREEN </FirstName>
<MiddleName>B</MiddleName>
<LastName>CORN </LastName>
<Suffix/>
...
June 30, 2010 at 2:49 pm
Add address node as below
//--------------------
declare @x xml
set @x = '<ROOT>
<Createstudent>
<id>30</id>
<classId>1</classId>
<lastname>ln</lastname>
<midname>mn</midname>
<firstname>fn</firstname>
<degree>ms</degree>
<address>
<city>false</city>
<state>false</state>
<zipcode>false</zipcode>
</address>
</Createstudent>
</ROOT>'
select
T.c.value('id[1]', 'int') as id,
T.c.value('classId[1]', 'int') as classid,
T.c.value('lastname[1]', 'varchar(50)') as lastname,
T.c.value('midname[1]', 'varchar(50)') as midname,
T.c.value('firstname[1]', 'varchar(50)') as firstname,
T.c.value('degree[1]', 'varchar(50)') as degree,
T.c.value('address[1]/city[1]', 'varchar(50)')...
June 29, 2010 at 2:37 pm
Viewing 8 posts - 1 through 9 (of 9 total)