Viewing 15 posts - 376 through 390 (of 2,007 total)
Lynn Pettis (12/11/2012)
declare @TestString varchar(8000) = '30;38469|31;38470|32;38471|33;38472|34;38473|35;38474|36;38475|37;38476|38;38477|';
select
max(case ds2.ItemNumber when 1 then ds2.Item else '' end) as field1,
max(case ds2.ItemNumber...
December 11, 2012 at 8:28 am
Myself and a colleague are having some problems with replication. To be honest, replication is something I've had very little to do with so I'm at a loss with trying...
December 11, 2012 at 2:39 am
My hope is that Jeff Moden won't take um-bridge to my ripping apart of his code. . . 😀
I've based this answer on the 8K splitter[/url], with some modifications to...
December 11, 2012 at 2:32 am
karthik M (12/10/2012)
any other approach which will resolve this issue by using only one function or without using any functions?
CLR. If you mean native, then no.
December 11, 2012 at 1:13 am
So this one makes five posts. . . Can I offer a suggestion? One...
December 10, 2012 at 7:00 am
karthik M (12/10/2012)
(
last_name varchar(50)
)
insert into emp
select abc_worldbaank
union
select xyzabc_countrybank
union
select yyybb_districtbank
union
select zzzaaa_internationalbank
my requirement is to display the text after '_'
worldbaank
countrybank
districkbank
internationalbank
I used two method
1) select substring(last_name, charindex('_',last_name), len(last_name) - charindex('_',last_name))
--...
December 10, 2012 at 6:23 am
vs.satheesh (12/7/2012)
HI Still i am not getting answer.
Have you had a read through this --> http://www.manning.com/nielsen/SampleChapter5.pdf ? The sample chapter that I linked shows the "guru" method for performing...
December 10, 2012 at 1:51 am
This is the Islands and Gaps problem.
As this is a university project, I won't just give you the answer. However, take a look at this --> http://www.manning.com/nielsen/SampleChapter5.pdf.
December 7, 2012 at 5:06 am
Why do you need a cursor for this?
Here's your sample data: -
CREATE TABLE MNFC (Col_1 VARCHAR(5),Col_2 VARCHAR(3),Col_3 VARCHAR(6));
INSERT INTO MNFC
SELECT 'Sales','Yes','12-Jan'
UNION ALL SELECT 'Prod','Yes',NULL
UNION ALL SELECT 'Mark','NO','15-Jan'
UNION ALL SELECT 'Finc',NULL,NULL;
So...
December 7, 2012 at 5:04 am
carlosaamaral (12/7/2012)
Hi,is correct XML file?
in some cases the tags were not closed: <Node... /> or <Node...> </ Node> ...
I didn't realise...
December 7, 2012 at 4:39 am
SELECT ENAME
FROM test
WHERE PATINDEX('%[[[]AFG]', ENAME) > 0
OR PATINDEX('%[[[]USA]', ENAME) > 0
OR PATINDEX('%[[[]IND]', ENAME) > 0;
Results in: -
ENAME
------------------------------
Afghanistan [AFG]
United States [USA]
India [IND]
United States [USA]
SELECT SUBSTRING(ENAME,PATINDEX('%[[][A-Z][A-Z][A-Z]]', ENAME),LEN(ENAME))
FROM test;
Results in: -
------------------------------
[AFG]
[BRA]
[USA]
[FRA]
[IND]
[DZA]
[DZA]
[USA]
[BGD]
Can...
December 7, 2012 at 4:36 am
Not without more information, no.
I can tell you that the generated query is awful. Of the top of my head, try this instead: -
SELECT CAST(ISNULL((SELECT TOP 1 1
...
December 7, 2012 at 4:20 am
Have a read of this article --> http://www.sqlservercentral.com/articles/SQLServerCentral/66909/%5B/url%5D, about how to post performance problems.
December 7, 2012 at 4:07 am
Interesting. Something like this maybe: -
SELECT 'CREATE '+CASE WHEN IndexProperty(TableId, IndexName, 'IsUnique') = 1 THEN 'UNIQUE '
ELSE '' END+CASE WHEN IndexProperty(TableId, IndexName, 'IsClustered') = 1 THEN 'CLUSTERED ' ELSE...
December 7, 2012 at 4:03 am
steve.bavis (12/7/2012)
December 7, 2012 at 3:46 am
Viewing 15 posts - 376 through 390 (of 2,007 total)