Saturday, February 25, 2012

Removing duplicate Records

I have a table that holds the following

1 7530568 87143 OESCHD 1/5/2006 6:31:58 AM
1 7530568 87143 OESCHD 1/5/2006 7:02:36 AM

for each 7530568 ordernumber there should only be one OESCHD status.

This is the query I'm using to insert the data sent to me.

INSERT INTO ORDER_EVENTS
SELECT d.division as division,
dt.orderNum as orderNum,
dt.poNum as poNum,
dt.statusCode as statusCode,
dt.statusChangeDate as statusChangeDate
FROM dt_Order_Events dt INNER JOIN
division d ON dt.division = d.divisionShort INNER JOIN
status s ON s.division = d.division AND s.statCode = dt.statusCode
WHERE directive <> 'C' AND
dt.orderNum IN (SELECT orderNum FROM ORDER_HEADER)

This works fine when used with in the hourly transactional update. But When I ran it for the Bulk UpDate (so we'd have historical data) it allowed orders to have statuses to many times.

I am not a SQL guru, I have no idea how to write a sql statement or stored proc that will remove the duplicate records. or how to change what I have to prevent further ones.

Any help would be apreciated.

look here:

http://www.sql-server-performance.com/dv_delete_duplicates.asp

you will get your answers there.

tomer

removing duplicate entries in SQL Field

Hi All,

Below is a snippet of MS SQL inside some VB that retieves
Commodity info such as product names and related information and returns the results in an ASP Page. My problem is that with certain searches, elements returned in the synonym field repeat. For instance, on a correct search I get green, red, blue, and yellow which is correct. On another similar search with different commodity say for material, I get Plastic, Glass,Sand - Plastic, Glass,Sand - Plastic, Glass, Sand. I want to remove the repeating elements returned in this field. IOW, I just need one set of Plastic, Glass and Sand. I hope this makes sense.

Below is the SQL and the results from the returned page.


PS I tried to use distinct but with no luck I want just one of each in the example below.

Thanks in Advance!

Scott

==============================

SQL = ""
SQL = "SELECT B.CIMS_MSDS_NUM," & _
"A.COMMODITY_NUMBER, " & _
"B.CIMS_TRADE_NME," & _
"B.CIMS_MFR_NME," & _
"B.CIMS_MSDS_PREP_DTE," & _
"B.APVL_CDE," & _
"COALESCE(C.REGDMATLCD,'?') AS DOTREGD," & _
"COALESCE( D.CIMS_TRADE_SYNM,'NO SYNONYMS') AS SYNONYM, " & _
"A.MSDS_CMDTY_VERIF, " & _
"A.CATALOG_ID " & _
"FROM ( MATEQUIP.VMSDS_CMDTY A " & _
" RIGHT OUTER JOIN MATEQUIP.VCIMS_TRD_PROD_INF B " & _
" ON A.CIMS_MSDS_NUM = B.CIMS_MSDS_NUM " & _
" LEFT OUTER JOIN MATEQUIP.VDOT_TRADE_PROD C " & _
" ON A.CIMS_MSDS_NUM = C.MSDSNUM " & _
" LEFT OUTER JOIN MATEQUIP.VCIMS_TRD_PROD_SYN D " & _
" ON B.CIMS_MSDS_NUM = D.CIMS_MSDS_NUM) "

SQL1 = ""
SQL1 = SQL

SQL = SQL & "WHERE " & Where & " "
==================================

Here is a piece of the problem field, note repeating colors etc.

CCM-PAINTS & COATINGS (1/26/98)F65E36 ORANGE F65W1 GLOSS WHITEF65B50 WR. IRON FLAT BLACK F65R2 TARTAR RED DARKF65B4 SEMI-GLOSS BLACK F65R1 VERMILIONF65B1 GLOSS BLACK F65N11 RICH BROWNF65A49 ASA #49 GRAY F65M1 MAROONF65A4 MACHINE TOOL GRAY F65L10 BRIGHT BLUEF65A2 LIGHT GRAY F65L7 PALE BLUEF65A1 WARM GRAY F65L6 TURQUOISEF65L4 DARK BLUEF65L3 LIGHT BLUE V65V100 MIXING CLEARF65H1 IVORY F65Y48 LIGHT YELLOWF65G41 FOREST GREEN F65Y44 LEMON YELLOWF65G40 MEDIUM GREEN F65W100 MIXING WHITEF65G39 LIGHT GREEN F65W4 TINTING WHITEF65G16 SEMI-GLOSS MACHINERY GRE F65W3 CUSTOM WHITEF65E37 INTERNATIONAL ORANGE F65W2 SEMI-GLOSS WHITEF65B50 WR. IRON FLAT BLACK F65R2 TARTAR RED DARKF65B4 SEMI-GLOSS BLACK F65R1 VERMILIONF65B1 GLOSS BLACK F65N11 RICH BROWNF65A49 ASA #49 GRAY F65M1 MAROONF65A4 MACHINE TOOL GRAY F65L10 BRIGHT BLUEF65A2 LIGHT GRAY F65L7 PALE BLUEF65A1 WARM GRAY F65L6 TURQUOISEDISAPPROVED BY CCM-PAINTS & COATINGS (1/26/98)F65L4 DARK BLUEF65L3 LIGHT BLUE V65V100 MIXING CLEARF65H1 IVORY F65Y48 LIGHT YELLOWF65G41 FOREST GREEN F65Y44 LEMON YELLOWF65G40 MEDIUM GREEN F65W100 MIXING WHITEF65G39 LIGHT GREEN F65W4 TINTING WHITEF65G16 SEMI-GLOSS MACHINERY GRE F65W3 CUSTOM WHITEF65E37 INTERNATIONAL ORANGE F65W2 SEMI-GLOSS WHITEF65E36 ORANGE F65W1 GLOSS WHITEDISAPPROVED BY CCM-PAINTS & COATINGS (1/26/98)F65A2 LIGHT GRAY F65L7 PALE BLUEF65A1 WARM GRAY F65L6 TURQUOISEF65B4 SEMI-GLOSS BLACK F65R1 VERMILIONF65B1 GLOSS BLACK F65N11 RICH BROWNF65A49 ASA #49 GRAY F65M1 MAROONF65A4 MACHINE TOOL GRAY F65L10 BRIGHT BLUEF65L4 DARK BLUEF65L3 LIGHT BLUE V65V100 MIXING CLEARF65H1 IVORY F65Y48 LIGHT YELLOWF65G41 FOREST GREEN F65Y44 LEMON YELLOWF65G40 MEDIUM GREEN F65W100 MIXING WHITEF65G39 LIGHT GREEN F65W4 TINTING WHITEF65G16 SEMI-GLOSS MACHINERY GRE F65W3 CUSTOM WHITEF65E37 INTERNATIONAL ORANGE F65W2 SEMI-GLOSS WHITEF65E36 ORANGE F65W1 GLOSS WHITEF65B50 WR. IRON FLAT BLACK F65R2 TARTAR RED DARKF65A1 WARM GRAY F65L6 TURQUOISEDISAPPROVED BY CCM-PAINTS & COATINGS (1/26/98)F65B1 GLOSS BLACK F65N11

Hi,

if you are using denormalized stored values, you will first have denormalized them to use SQL Server functions for grouping / distinct them. You will have to separate the values first using a separator and using a function like this one here:

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

Removing Duplicate Entries from a Parent-Child Hierarchy

I have defined a Parent-Child hierarchy for one of my dimensions. (It is a flavour of organisation structure)

However, when I process it, each node repeats itself as one of its own children.

What is going on here and how can I fix this? Someone mentioned a property I can set, but nothing jumps out at me.

It's the datamember, no? If you drag and drop theses members for a MDX query it brings the .datamember in the end of the member? If so, just set to hidden the datamember.

The parent-child attribute has a property named "MemberWithData" set to "NonLeafDataHidden".

|||

Handerson is right.

You have the change the default property to get the desired effect.

The default scenario which AS2005 is where a sales mgr and his salesmen all sell products and you wnat to display revenue for them.

The alternative might be that only the salesmen sell and the manager does not have any sales, Then you ahve to reconfigure the property defined above.

|||

I don't understand what you guys are talking about... when I browse the hierarchy of my parent child relationship, for each parent node there is a child node with the same name and properties when the dimension is processed. This is before we even run any MDX...

|||

Let's look a sample, if you have the parent-child dimension entity like that:

America|||Thanks for the clarification ... much appreciated.

Removing duplicate entries

Hi,

I would lke to know what is the best way to remove duplicate entries from a GIANT table ?

I'm using this but I think that too slow..

IF EXISTS (SELECT * FROM DBO.SYSOBJECTS WHERE ID = OBJECT_ID(N'[DBO].[#PABX_TEMP]') AND OBJECTPROPERTY(ID, N'ISUSERTABLE') = 1)
DROP TABLE [DBO].[#PABX_TEMP]

CREATE TABLE [#PABX_TEMP] (
[CHAVE] [int],
[COD_CLIENTE] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[DATA_HORA] [datetime] NULL ,
[NRTELEFONE] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[RAMAL] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[WCOS] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[TEMPO_SEGUNDOS] [real] NULL ,
[TIPO] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[TIPO_ORIGINAL] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[TRONCO] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[TEMPO_ATENDIMENTO] [real] NULL ,
[JAPROCESSADO] [int] NULL ,
[VALOR] [money] NULL ,
[VALOR_CONC] [money] NULL ,
[VALOR_TARIFA] [money] NULL ,
[VALOR_TARIFA_CONC] [money] NULL ,
[CLASSIFICA] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[LOCALIDADE] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ,
[VALOR_TEMPO] [money] NULL ,
[NUMERO_E1] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[BLOQUEADO] [bit] NULL ,
[DATA_BLOQUEIO] [datetime] NULL ,
[TRANSFERIDO] [varchar] (255) COLLATE Latin1_General_CI_AS NULL
)

INSERT INTO #PABX_TEMP
SELECT MIN(CHAVE) as 'CHAVE', [COD_CLIENTE], [DATA_HORA], [NRTELEFONE],
[RAMAL], [WCOS], [TEMPO_SEGUNDOS], [TIPO], [TIPO_ORIGINAL],
[TRONCO], [TEMPO_ATENDIMENTO], [JAPROCESSADO], [VALOR], [VALOR_CONC],
[VALOR_TARIFA], [VALOR_TARIFA_CONC], [CLASSIFICA], [LOCALIDADE],
[VALOR_TEMPO], [NUMERO_E1], [BLOQUEADO], [DATA_BLOQUEIO], [TRANSFERIDO]
FROM PABX WHERE (BLOQUEADO = 0 OR BLOQUEADO IS NULL)
GROUP BY [COD_CLIENTE], [DATA_HORA], [NRTELEFONE],
[RAMAL], [WCOS], [TEMPO_SEGUNDOS], [TIPO], [TIPO_ORIGINAL],
[TRONCO], [TEMPO_ATENDIMENTO], [JAPROCESSADO], [VALOR], [VALOR_CONC],
[VALOR_TARIFA], [VALOR_TARIFA_CONC], [CLASSIFICA], [LOCALIDADE],
[VALOR_TEMPO], [NUMERO_E1], [BLOQUEADO], [DATA_BLOQUEIO], [TRANSFERIDO]

DELETE FROM PABX WHERE (BLOQUEADO = 0 OR BLOQUEADO IS NULL) AND CHAVE NOT IN (SELECT CHAVE FROM #PABX_TEMP)

DROP TABLE #PABX_TEMP

Thanks

Try replacing your NOT IN with NOT EXIST; NOT EXIST tends to be more efficient. Here are some posts to reference:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=299702&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=532892&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=607796&SiteID=1

|||

OK, I'm gonna test

Thanks

Removing duplicate data

I have a table that I need to remove duplicates from and the table includes
an identity column. The table contains 12 fields but our business rules are
that only 3 of the fields can make the record a duplicate. We would like to
keep the record with the min identity column. I have done this in the past,
but it was about 5 years ago and I did not insert the dups into another
table, I did it strictly with a query. Can anybody please help me out with
some code to take care of this or any suggestions on a better way of doing
this? So something along the lines of grouping the data by the fields that
we are interested in and then deleting the records where the identity column
is greater than the min identity column.
Thanks.This is the duplicates along with the
minimum id per group
SELECT MIN(id),Col1,Col2,Col3
FROM sometable
GROUP BY Col1,Col2,Col3
HAVING COUNT(*)>1
Join this to the original table
to give the ids of the duplicates
excluding the minimum id.
SELECT a.id
FROM sometable a
INNER JOIN (
SELECT MIN(id),Col1,Col2,Col3
FROM sometable
GROUP BY Col1,Col2,Col3
HAVING COUNT(*)>1) b(id,Col1,Col2,Col3) ON b.id<>a.id
AND b.Col1=a.Col1
AND b.Col2=a.Col2
AND b.Col3=a.Col3
Put it all together to delete them
DELETE
FROM sometable
WHERE id IN (
SELECT a.id
FROM sometable a
INNER JOIN (
SELECT MIN(id),Col1,Col2,Col3
FROM sometable
GROUP BY Col1,Col2,Col3
HAVING COUNT(*)>1) b(id,Col1,Col2,Col3) ON b.id<>a.id
AND b.Col1=a.Col1
AND b.Col2=a.Col2
AND b.Col3=a.Col3
)|||Do you need to export the removed duplicates to another table?
Try something like this:
INSERT INTO RemDup (...) SELECT ... FROM MyTab AS t1 WHERE EXISTS (SELECT
NULL FROM MyTab AS t2 WHERE t1.Col1=t2.Col1 AND t1.Col2=t2.Col2 AND
t1.Col2=t2.Col2 AND t1.ID>t2.ID)
DELETE FROM MyTab AS t1 WHERE EXISTS (SELECT NULL FROM MyTab AS t2 WHERE
t1.Col1=t2.Col1 AND t1.Col2=t2.Col2 AND t1.Col2=t2.Col2 AND t1.ID>t2.ID)
HTH,
Axel Dahmen
"Andy" <Andy@.discussions.microsoft.com> wrote in message
news:32ACE9AA-67CE-454C-9711-956595CB7A8D@.microsoft.com...
> I have a table that I need to remove duplicates from and the table
includes
> an identity column. The table contains 12 fields but our business rules
are
> that only 3 of the fields can make the record a duplicate. We would like
to
> keep the record with the min identity column. I have done this in the
past,
> but it was about 5 years ago and I did not insert the dups into another
> table, I did it strictly with a query. Can anybody please help me out
with
> some code to take care of this or any suggestions on a better way of doing
> this? So something along the lines of grouping the data by the fields
that
> we are interested in and then deleting the records where the identity
column
> is greater than the min identity column.
> Thanks.|||Here's an example. This will delete all but 1 of the dupes. You will need to
change table / col name accordingly
DELETE FROM _Holding_table
WHERE EXISTS(SELECT NULL FROM _Holding_table s1
WHERE s1.PhoneNumber= _Holding_table.PhoneNumber
and s1.PK_Holding_TableID > _Holding_table.PK_Holding_TableID)
HTH. Ryan
"Andy" <Andy@.discussions.microsoft.com> wrote in message
news:32ACE9AA-67CE-454C-9711-956595CB7A8D@.microsoft.com...
>I have a table that I need to remove duplicates from and the table includes
> an identity column. The table contains 12 fields but our business rules
> are
> that only 3 of the fields can make the record a duplicate. We would like
> to
> keep the record with the min identity column. I have done this in the
> past,
> but it was about 5 years ago and I did not insert the dups into another
> table, I did it strictly with a query. Can anybody please help me out
> with
> some code to take care of this or any suggestions on a better way of doing
> this? So something along the lines of grouping the data by the fields
> that
> we are interested in and then deleting the records where the identity
> column
> is greater than the min identity column.
> Thanks.|||This is untested, perhaps you wrap this in a transaction first:
DELETE FROM SomeTable S
WHERE Idcolumn NOT IN
(
SELECT MIN(idcolumn)
FROM SOMETABLE S2
GROUP BY FirstColumn1,FirstColumn2,FirstColumn3
)
HTH, Jens Suessmeyer.

Removing duplicate dat

Hi
I have a 1.5 million row table with a text field. Can
anybody think of a way to remove any duplicate rows where the text field
contains the same data (and a
way which will not take days to run!)
For example if I have two rows with "SQL SERVER IS GREAT", I want to remove
one of them.
Thanks
here is an example of something that works for me:
create table textstuff
(pk int not null primary key,
textcol text)
go
--insert statements
declare @.int int
select @.int=max(datalength(textcol)) from textstuff
select pk, checksum=checksum(substring(textcol,1, @.int)) into holding from
textstuff order by 2
select pk, holding.checksum from holding,
(select checksum, test=count(checksum) from holding group by checksum having
count(checksum) >1) as a
where holding.checksum=a.checksum
rows which have identical checksums will show up here.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Paul" <xx@.nospam.com> wrote in message
news:e1O%23GfsuEHA.3416@.TK2MSFTNGP09.phx.gbl...
> Hi
> I have a 1.5 million row table with a text field. Can
> anybody think of a way to remove any duplicate rows where the text field
> contains the same data (and a
> way which will not take days to run!)
> For example if I have two rows with "SQL SERVER IS GREAT", I want to
remove
> one of them.
> Thanks
>
>
|||That's awsome, thanks Hilary
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:u4beTGwuEHA.3808@.TK2MSFTNGP15.phx.gbl...
> here is an example of something that works for me:
> create table textstuff
> (pk int not null primary key,
> textcol text)
> go
> --insert statements
> declare @.int int
> select @.int=max(datalength(textcol)) from textstuff
> select pk, checksum=checksum(substring(textcol,1, @.int)) into holding from
> textstuff order by 2
> select pk, holding.checksum from holding,
> (select checksum, test=count(checksum) from holding group by checksum
having
> count(checksum) >1) as a
> where holding.checksum=a.checksum
>
> rows which have identical checksums will show up here.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> "Paul" <xx@.nospam.com> wrote in message
> news:e1O%23GfsuEHA.3416@.TK2MSFTNGP09.phx.gbl...
> remove
>

Removing dupes (distinct like)

Greets, prob. simple problem for experts but my sql is at it's infancy :)

select Entity.OID from Entity
,EN,ENXP as ENXP0
where Entity.OID=EN.TOID
and EN.CS_ST_USE='L'
and EN.OID=ENXP0.POID
and UPPER (ENXP0.ST_NAMEROW) LIKE UPPER ('P%')
and ENXP0.CS_ST_TYPE='GIV'
and ENXP0.CS_ST_QUALIFIER=null
order by ENXP0.ST_NAMEROW,Entity.OID

Gives me:
5266
5266
5266
5088
5088

etc, but I want only unique entity oids returned:
5266
5088

How I can achieve this w/ SQL as distinct no workie bcause of order by?

Thanks
--POTry a GROUP BY instead of ORDER BY. It should still force the sort.|||I'd use both GROUP BY and ORDER BY to get what you've described.

-PatP|||select Entity.OID from Entity
,EN,ENXP as ENXP0

where Entity.OID=EN.TOID
and EN.CS_ST_USE='L'
and EN.OID=ENXP0.POID
and UPPER (ENXP0.ST_NAMEROW) LIKE UPPER ('P%')
and ENXP0.CS_ST_TYPE='GIV'
and ENXP0.CS_ST_QUALIFIER=null
group by ENXP0.ST_NAMEROW,Entity.OID
order by ENXP0.ST_NAMEROW,Entity.OID

(and other combinations) seems still produce exact same dupe OID's.

group by Entity.OID
order by ENXP0.ST_NAMEROW,Entity.OID

won't work (on SQL Server 2000 atleast as ENXP0.ST_NAMEROW must be included also on group by)

Any other suggestions?

--PO|||Did you try a subselect?

select distinct Entity.OID from
(select Entity.OID from Entity
,EN,ENXP as ENXP0
where Entity.OID=EN.TOID
and EN.CS_ST_USE='L'
and EN.OID=ENXP0.POID
and UPPER (ENXP0.ST_NAMEROW) LIKE UPPER ('P%')
and ENXP0.CS_ST_TYPE='GIV'
and ENXP0.CS_ST_QUALIFIER=null
order by ENXP0.ST_NAMEROW,Entity.OID)|||Yepp, unfortunately SQL server does not allow order by's at subselects (otherwise prob could be solved easily ;)

Server: Msg 1033, Level 15, State 1, Line 10
The ORDER BY clause is invalid in views, inline functions, derived tables, and subqueries, unless TOP is also specified.

:(

TOP stuff is not really applicable cause I must fetch all rows possible and seems that SQL server does not understand it inside inline select.

Damn, this *looks* like piece of cake to solve...|||what does "distinct no workie bcause of order by" mean?

of course you can have DISTINCT and ORDER BY

however, since you are returning only one column, it seems rather unnecessary

rule of thumb: select what you want to order

if you want to order your results by order by ENXP0.ST_NAMEROW and Entity.OID, then you should select both of these columns

so, what was your question again?|||what does "distinct no workie bcause of order by" mean?

of course you can have DISTINCT and ORDER BY

however, since you are returning only one column, it seems rather unnecessary

rule of thumb: select what you want to order

if you want to order your results by order by ENXP0.ST_NAMEROW and Entity.OID, then you should select both of these columns

so, what was your question again?

"Distinct no workie" means that for example this won't ofcourse work:

select distinct Entity.OID from Entity
,EN,ENXP as ENXP0
where Entity.OID=EN.TOID
and EN.CS_ST_USE='L'
and EN.OID=ENXP0.POID
and UPPER (ENXP0.ST_NAMEROW) LIKE UPPER ('P%')
and ENXP0.CS_ST_TYPE='GIV'
and ENXP0.CS_ST_QUALIFIER=null
order by ENXP0.ST_NAMEROW

Server: Msg 145, Level 15, State 1, Line 1
ORDER BY items must appear in the select list if SELECT DISTINCT is specified.

Anyway we need those OID's and *only unique* OID's ordered by ENXP0.ST_NAMEROW. OID's are later used on another Query to fetch other rows from db (on that particular order made by ENXP0.ST_NAMEROW). Reason is that our system is using SQL generator to generate SQL clauses and reason for that is that writing SQL by hand is far too slow and difficult todo against schema we are using.

Thanks,|||i think you're missing the point

here are a bunch of OIDs --

5266
5088
5937
5013

how can you tell what their ENXP0.ST_NAMEROW values are? you can't

therefore how would you know if they were, or were not, in ENXP0.ST_NAMEROW order? you can't

you simply cannot order OID values by ENXP0.ST_NAMEROW|||For example:

select ENXP.ST_NAMEROW from ENXP
where ENXP.TOID in (5266)

(as we have duplicate main oid on ENXP table)

and if we can get actual OID's ordered by ENXP.ST_NAMEROW using query like:

select Entity.OID from Entity
,EN,ENXP as ENXP0
where Entity.OID=EN.TOID
and EN.CS_ST_USE='L'
and EN.OID=ENXP0.POID
and UPPER (ENXP0.ST_NAMEROW) LIKE UPPER ('%')
and ENXP0.CS_ST_TYPE='GIV'
and ENXP0.CS_ST_QUALIFIER=null
order by ENXP0.ST_NAMEROW,Entity.OID

which orders them by ENXP0.ST_NAMEROW so do we have OID's ordered by NAMEROW? I think so, but with alot of duplicate values because name is formed using multiple ENXP0.ST_NAMEROW's.|||well, good luck to you sir, i do not understand what you're doing and i cannot help you further|||well, good luck to you sir, i do not understand what you're doing and i cannot help you further

Yep, thanks.
Well basic question was that is there way using SQL to remove duplicate OID's from resultset what this query return (and it must return only OID's ordered by ENXP0.ST_NAMEROW) :

select Entity.OID from Entity
,EN,ENXP as ENXP0
where Entity.OID=EN.TOID
and EN.CS_ST_USE='L'
and EN.OID=ENXP0.POID
and UPPER (ENXP0.ST_NAMEROW) LIKE UPPER ('P%')
and ENXP0.CS_ST_TYPE='GIV'
and ENXP0.CS_ST_QUALIFIER=null
order by ENXP0.ST_NAMEROW

Result:
5266
5266
5266

Can be done ofcourse on server side as last resort if cannot be done using SQL.

Query like:
select distinct Entity.OID,ENXP0.ST_NAMEROW from Entity
,EN,ENXP as ENXP0
where Entity.OID=EN.TOID
and EN.CS_ST_USE='L'
and EN.OID=ENXP0.POID
and UPPER (ENXP0.ST_NAMEROW) LIKE UPPER ('P%')
and ENXP0.CS_ST_TYPE='GIV'
and ENXP0.CS_ST_QUALIFIER=null
order by ENXP0.ST_NAMEROW,Entity.OID

Will return for example:
5266 P
5266 Pamela
5266 Prognost

But again we need only those unique OID's returned, no other data at this point.

Removing drill-down from an existing report

I created a report with drill-down support and then realized that it is
better served without drilldown. Is there a way to remove drilldown support
on an existing report?
ThanksOn Nov 5, 2:55 pm, "shikarishambu" <shikarishamb...@.hotmail.com>
wrote:
> I created a report with drill-down support and then realized that it is
> better served without drilldown. Is there a way to remove drilldown support
> on an existing report?
> Thanks
As far as I know, you should be able to: right-click the table/matrix
cells (where applicable) >> select Properties >> select the Navigation
tab >> and below 'Hyperlink action:', select None. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant

Removing Domain Controller status from a SQL server

Aloha -
I have a sick server (HOKU) which doubles as a domain controller and a SQL
server. The plan is to move SQL to a new server (SQL1), demote HOKU to a
member server, remove it from the domain then do away with it.
The plan is to demote it this weekend. Then in a couple weeks move the SQL
once testing is done. Is there danger in "de-domain controlering" a SQL
server that is used to being on a DC? At this point I know enough to know
that we're making a fairly major change, but I don't know enough to know
exactly what I am nervous about.
Hi
From a SQL Server point of view, I don't see any problems in demoting a SQL
server. SQL server don't use anything from the Domain Controller as such, so
as long as you have your domain fully functional there shouldn't be any
problems.
Depending on how your users connect to the databases, there might be some
fiddling around when you move the SQL server, since you most likely will
change the server name and/or IP adress.
Regards
Steen
Kahonu wrote:
> Aloha -
> I have a sick server (HOKU) which doubles as a domain controller and
> a SQL server. The plan is to move SQL to a new server (SQL1), demote
> HOKU to a member server, remove it from the domain then do away with
> it.
> The plan is to demote it this weekend. Then in a couple weeks move
> the SQL once testing is done. Is there danger in "de-domain
> controlering" a SQL server that is used to being on a DC? At this
> point I know enough to know that we're making a fairly major change,
> but I don't know enough to know exactly what I am nervous about.
|||Kahonu wrote on Wed, 1 Jun 2005 19:03:18 -0700:

> Aloha -
> I have a sick server (HOKU) which doubles as a domain controller and a SQL
> server. The plan is to move SQL to a new server (SQL1), demote HOKU to a
> member server, remove it from the domain then do away with it.
> The plan is to demote it this weekend. Then in a couple weeks move the SQL
> once testing is done. Is there danger in "de-domain controlering" a SQL
> server that is used to being on a DC? At this point I know enough to know
> that we're making a fairly major change, but I don't know enough to know
> exactly what I am nervous about.
I demoted a W2K Server to a member server with SQL Server 2000 just 2 weeks
ago, no ill effects as yet. I needed to rename the server prior to running
in production, and I'd be running it as a domain controller while migrating
from NT4 to 2K. The demotion was painless, it was the renaming that was the
fun part :\
Dan
|||I have also demoted as you are doing, and like the others had no problems...
In fact, it is a bad practice to put SQL on a domain controller anyway - so
you are doing a good thing and improving security by your actions as well.
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)
I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
"Kahonu" <Kahonu@.discussions.microsoft.com> wrote in message
news:FE165EC2-B09B-4D40-9782-D8C54CB036C7@.microsoft.com...
> Aloha -
> I have a sick server (HOKU) which doubles as a domain controller and a SQL
> server. The plan is to move SQL to a new server (SQL1), demote HOKU to a
> member server, remove it from the domain then do away with it.
> The plan is to demote it this weekend. Then in a couple weeks move the SQL
> once testing is done. Is there danger in "de-domain controlering" a SQL
> server that is used to being on a DC? At this point I know enough to know
> that we're making a fairly major change, but I don't know enough to know
> exactly what I am nervous about.
>

Removing Domain Controller status from a SQL server

Aloha -
I have a sick server (HOKU) which doubles as a domain controller and a SQL
server. The plan is to move SQL to a new server (SQL1), demote HOKU to a
member server, remove it from the domain then do away with it.
The plan is to demote it this weekend. Then in a couple weeks move the SQL
once testing is done. Is there danger in "de-domain controlering" a SQL
server that is used to being on a DC? At this point I know enough to know
that we're making a fairly major change, but I don't know enough to know
exactly what I am nervous about.Hi
From a SQL Server point of view, I don't see any problems in demoting a SQL
server. SQL server don't use anything from the Domain Controller as such, so
as long as you have your domain fully functional there shouldn't be any
problems.
Depending on how your users connect to the databases, there might be some
fiddling around when you move the SQL server, since you most likely will
change the server name and/or IP adress.
Regards
Steen
Kahonu wrote:
> Aloha -
> I have a sick server (HOKU) which doubles as a domain controller and
> a SQL server. The plan is to move SQL to a new server (SQL1), demote
> HOKU to a member server, remove it from the domain then do away with
> it.
> The plan is to demote it this weekend. Then in a couple weeks move
> the SQL once testing is done. Is there danger in "de-domain
> controlering" a SQL server that is used to being on a DC? At this
> point I know enough to know that we're making a fairly major change,
> but I don't know enough to know exactly what I am nervous about.|||Kahonu wrote on Wed, 1 Jun 2005 19:03:18 -0700:
> Aloha -
> I have a sick server (HOKU) which doubles as a domain controller and a SQL
> server. The plan is to move SQL to a new server (SQL1), demote HOKU to a
> member server, remove it from the domain then do away with it.
> The plan is to demote it this weekend. Then in a couple weeks move the SQL
> once testing is done. Is there danger in "de-domain controlering" a SQL
> server that is used to being on a DC? At this point I know enough to know
> that we're making a fairly major change, but I don't know enough to know
> exactly what I am nervous about.
I demoted a W2K Server to a member server with SQL Server 2000 just 2 weeks
ago, no ill effects as yet. I needed to rename the server prior to running
in production, and I'd be running it as a domain controller while migrating
from NT4 to 2K. The demotion was painless, it was the renaming that was the
fun part :\
Dan|||I have also demoted as you are doing, and like the others had no problems...
In fact, it is a bad practice to put SQL on a domain controller anyway - so
you are doing a good thing and improving security by your actions as well.
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)
I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
"Kahonu" <Kahonu@.discussions.microsoft.com> wrote in message
news:FE165EC2-B09B-4D40-9782-D8C54CB036C7@.microsoft.com...
> Aloha -
> I have a sick server (HOKU) which doubles as a domain controller and a SQL
> server. The plan is to move SQL to a new server (SQL1), demote HOKU to a
> member server, remove it from the domain then do away with it.
> The plan is to demote it this weekend. Then in a couple weeks move the SQL
> once testing is done. Is there danger in "de-domain controlering" a SQL
> server that is used to being on a DC? At this point I know enough to know
> that we're making a fairly major change, but I don't know enough to know
> exactly what I am nervous about.
>

Removing Domain Controller status from a SQL server

Aloha -
I have a sick server (HOKU) which doubles as a domain controller and a SQL
server. The plan is to move SQL to a new server (SQL1), demote HOKU to a
member server, remove it from the domain then do away with it.
The plan is to demote it this weekend. Then in a couple weeks move the SQL
once testing is done. Is there danger in "de-domain controlering" a SQL
server that is used to being on a DC? At this point I know enough to know
that we're making a fairly major change, but I don't know enough to know
exactly what I am nervous about.Hi
From a SQL Server point of view, I don't see any problems in demoting a SQL
server. SQL server don't use anything from the Domain Controller as such, so
as long as you have your domain fully functional there shouldn't be any
problems.
Depending on how your users connect to the databases, there might be some
fiddling around when you move the SQL server, since you most likely will
change the server name and/or IP adress.
Regards
Steen
Kahonu wrote:
> Aloha -
> I have a sick server (HOKU) which doubles as a domain controller and
> a SQL server. The plan is to move SQL to a new server (SQL1), demote
> HOKU to a member server, remove it from the domain then do away with
> it.
> The plan is to demote it this weekend. Then in a couple weeks move
> the SQL once testing is done. Is there danger in "de-domain
> controlering" a SQL server that is used to being on a DC? At this
> point I know enough to know that we're making a fairly major change,
> but I don't know enough to know exactly what I am nervous about.|||Kahonu wrote on Wed, 1 Jun 2005 19:03:18 -0700:

> Aloha -
> I have a sick server (HOKU) which doubles as a domain controller and a SQL
> server. The plan is to move SQL to a new server (SQL1), demote HOKU to a
> member server, remove it from the domain then do away with it.
> The plan is to demote it this weekend. Then in a couple weeks move the SQL
> once testing is done. Is there danger in "de-domain controlering" a SQL
> server that is used to being on a DC? At this point I know enough to know
> that we're making a fairly major change, but I don't know enough to know
> exactly what I am nervous about.
I demoted a W2K Server to a member server with SQL Server 2000 just 2 weeks
ago, no ill effects as yet. I needed to rename the server prior to running
in production, and I'd be running it as a domain controller while migrating
from NT4 to 2K. The demotion was painless, it was the renaming that was the
fun part :\
Dan|||I have also demoted as you are doing, and like the others had no problems...
In fact, it is a bad practice to put SQL on a domain controller anyway - so
you are doing a good thing and improving security by your actions as well.
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)
I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
"Kahonu" <Kahonu@.discussions.microsoft.com> wrote in message
news:FE165EC2-B09B-4D40-9782-D8C54CB036C7@.microsoft.com...
> Aloha -
> I have a sick server (HOKU) which doubles as a domain controller and a SQL
> server. The plan is to move SQL to a new server (SQL1), demote HOKU to a
> member server, remove it from the domain then do away with it.
> The plan is to demote it this weekend. Then in a couple weeks move the SQL
> once testing is done. Is there danger in "de-domain controlering" a SQL
> server that is used to being on a DC? At this point I know enough to know
> that we're making a fairly major change, but I don't know enough to know
> exactly what I am nervous about.
>

Removing differential backup

I set up a differential backup on my SQL server and have
decided I would rather not have it. However, I can't seem
to get rid of it. Any suggestions?
Hello John
How did you setup the differential backups? Was it setup as a SQLAgent
scheduled job?
If it is setup as a scheduled SQLAgent job, I'm not sure what is preventing
you from disabling/removing the job that performs SQL differential backups.
Could you please elaborate more on what you experience when you try to
disable or delete the job from SQLAgent job list in Enterprise Manager?
Thank you for using Microsoft newsgroups.
Sincerely
Pankaj Agarwal
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.
|||It was set up through Enterprise Manager by selecting the
database then selecting "all tasks:, I then chose Backup
database then selected Differential Backup. I chose a time
of 3:00 AM.
>--Original Message--
>Hello John
>How did you setup the differential backups? Was it setup
as a SQLAgent
>scheduled job?
>If it is setup as a scheduled SQLAgent job, I'm not sure
what is preventing
>you from disabling/removing the job that performs SQL
differential backups.
>Could you please elaborate more on what you experience
when you try to
>disable or delete the job from SQLAgent job list in
Enterprise Manager?
>Thank you for using Microsoft newsgroups.
>Sincerely
>Pankaj Agarwal
>Microsoft Corporation
>This posting is provided AS IS with no warranties, and
confers no rights.
>.
>
|||If you scheduled it there would be a scheduled job that issues the Diff
backup. Simply delete the job. If you didn't schedule a time it would have
been a one shot deal and there is nothing to worry about.
Andrew J. Kelly SQL MVP
"John Schuster" <schuster@.llnl.gov> wrote in message
news:043c01c4a0e2$306adfa0$a301280a@.phx.gbl...[vbcol=seagreen]
> It was set up through Enterprise Manager by selecting the
> database then selecting "all tasks:, I then chose Backup
> database then selected Differential Backup. I chose a time
> of 3:00 AM.
> as a SQLAgent
> what is preventing
> differential backups.
> when you try to
> Enterprise Manager?
> confers no rights.

Removing differential backup

I set up a differential backup on my SQL server and have
decided I would rather not have it. However, I can't seem
to get rid of it. Any suggestions?Hello John
How did you setup the differential backups? Was it setup as a SQLAgent
scheduled job?
If it is setup as a scheduled SQLAgent job, I'm not sure what is preventing
you from disabling/removing the job that performs SQL differential backups.
Could you please elaborate more on what you experience when you try to
disable or delete the job from SQLAgent job list in Enterprise Manager?
Thank you for using Microsoft newsgroups.
Sincerely
Pankaj Agarwal
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||It was set up through Enterprise Manager by selecting the
database then selecting "all tasks:, I then chose Backup
database then selected Differential Backup. I chose a time
of 3:00 AM.
>--Original Message--
>Hello John
>How did you setup the differential backups? Was it setup
as a SQLAgent
>scheduled job?
>If it is setup as a scheduled SQLAgent job, I'm not sure
what is preventing
>you from disabling/removing the job that performs SQL
differential backups.
>Could you please elaborate more on what you experience
when you try to
>disable or delete the job from SQLAgent job list in
Enterprise Manager?
>Thank you for using Microsoft newsgroups.
>Sincerely
>Pankaj Agarwal
>Microsoft Corporation
>This posting is provided AS IS with no warranties, and
confers no rights.
>.
>|||If you scheduled it there would be a scheduled job that issues the Diff
backup. Simply delete the job. If you didn't schedule a time it would have
been a one shot deal and there is nothing to worry about.
--
Andrew J. Kelly SQL MVP
"John Schuster" <schuster@.llnl.gov> wrote in message
news:043c01c4a0e2$306adfa0$a301280a@.phx.gbl...
> It was set up through Enterprise Manager by selecting the
> database then selecting "all tasks:, I then chose Backup
> database then selected Differential Backup. I chose a time
> of 3:00 AM.
> >--Original Message--
> >Hello John
> >
> >How did you setup the differential backups? Was it setup
> as a SQLAgent
> >scheduled job?
> >If it is setup as a scheduled SQLAgent job, I'm not sure
> what is preventing
> >you from disabling/removing the job that performs SQL
> differential backups.
> >Could you please elaborate more on what you experience
> when you try to
> >disable or delete the job from SQLAgent job list in
> Enterprise Manager?
> >
> >Thank you for using Microsoft newsgroups.
> >
> >Sincerely
> >
> >Pankaj Agarwal
> >Microsoft Corporation
> >
> >This posting is provided AS IS with no warranties, and
> confers no rights.
> >
> >.
> >

Removing deployed reports

Hi All,

I deployed many reports on sql server reporting services. I want to remove some of the unnecessary reports. How to remove it?

thanking You,

Thanks,

Muniappan Kandasamy

SQL 2005? If so, in SQL Server Management Studio you can attach to your reporting server instance and then select the report and set its hidden property to true, or delete it outright:

On the login popup, check out your list of Server Types provided, you should see a 'Reporting Services' item. If you are already in the Mgmt studio, on the object explorer, click the Connect button and in the dropdown you'll see a reporting services item. Once you are in, you should be able to find your report objects and do whatever you need to them.

Cheers!

Wayne

|||

Thank you

Removing deployed reports

Hi All,

I deployed many reports in sql server 2005 reporting services. I want to remove some of the unnecessary reports. How to remove those reports?

thank you

thanks,

Muniappan Kandasamy

1. Open report manager (http://localhost/reports).

2. Navigate to your report server project.

3. Click the Show Details button.

4. Check the reports you want to delete then click delete.

Removing delimiters

Hi

I have a database in which the
bankno is 29 and
acctno is 01-001-0000002

I need to write a query to get the data as "29010010000002" that is to concatenate both the fields and take out the delimiters in the second field. I know how to concatenate both
i.e.

select bankno + acctno as acctnos from table;

But that will give me 2901-001-0000002. I need to modify the query so that I can remove the delimiters in the second column.
Can anyone give me an idea.

Thanx in advance.select
replace(bankno + acctno,'-','')
as acctnos from table;

Removing decimals from a nvarchar field

I am trying to remove decimals...for example I have values like this:
01.234.678 and I want to update it to 01234678 or 12345678.
Thanks
SELECT REPLACE(column, '.', '') FROM table;
"Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
news:B084D109-B3E8-4D0D-B0BC-CC7D836ACA8D@.microsoft.com...
>I am trying to remove decimals...for example I have values like this:
> 01.234.678 and I want to update it to 01234678 or 12345678.
> Thanks

Removing decimals from a nvarchar field

I am trying to remove decimals...for example I have values like this:
01.234.678 and I want to update it to 01234678 or 12345678.
ThanksSELECT REPLACE(column, '.', '') FROM table;
"Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
news:B084D109-B3E8-4D0D-B0BC-CC7D836ACA8D@.microsoft.com...
>I am trying to remove decimals...for example I have values like this:
> 01.234.678 and I want to update it to 01234678 or 12345678.
> Thanks

removing decimal points

All,
I need to take a datatype money and remove the decimal point.
Any suggestions? All of the Casts and Converts seem to remove the
decimal places or leave the decimal point.
ex.
I need to take 1234.56 and output 123456
thanks...One way
declare @.m money
select @.m =1234.56
select replace(convert(varchar(30),@.m),'.','')
Denis the SQL Menace
http://sqlservercode.blogspot.com/
aaonms@.gmail.com wrote:
> All,
> I need to take a datatype money and remove the decimal point.
> Any suggestions? All of the Casts and Converts seem to remove the
> decimal places or leave the decimal point.
> ex.
> I need to take 1234.56 and output 123456
> thanks...|||That worked perfectly, thanks...
SQL Menace wrote:
> One way
> declare @.m money
> select @.m =1234.56
> select replace(convert(varchar(30),@.m),'.','')
> Denis the SQL Menace
> http://sqlservercode.blogspot.com/
>
> aaonms@.gmail.com wrote:|||aaonms@.gmail.com wrote:
> All,
> I need to take a datatype money and remove the decimal point.
> Any suggestions? All of the Casts and Converts seem to remove the
> decimal places or leave the decimal point.
> ex.
> I need to take 1234.56 and output 123456
> thanks...
>
DECLARE @.Amount MONEY
SELECT @.Amount = 1234.56
SELECT CONVERT(INT, @.Amount * 100)
Tracy McKibben
MCDBA
http://www.realsqlguy.com

removing deactivated subscriptions

Hi


We are using merge replication - how do we remove deactivated subscriptions from the replication monitor at the publisher. These are anonymous HTTPS subscribers....

Thanks

Bruce

I use this stored procedure which runs against the distribution database:

CREATE PROCEDURE [dbo].[usp_DeleteMergeAgentSessions]

@.Publication [nvarchar](50),

@.Subscriber [nvarchar](50),

@.Database [nvarchar](50) = NULL

AS

SET NOCOUNT ON

DELETE FROM [msmerge_sessions] WHERE [agent_id] IN (SELECT [id] FROM [msmerge_agents] WHERE [publication] = @.Publication AND [subscriber_name] = @.Subscriber AND (@.Database IS NULL OR @.Database = [subscriber_db]))

DELETE FROM [msmerge_agents] WHERE [publication] = @.Publication AND [subscriber_name] = @.Subscriber AND (@.Database IS NULL OR @.Database = [subscriber_db])

Removing Databases

Using SQL Server Management Studio, I see 4 entries, master, model, msdb and temdb, under Databases -> System Databases. Which of these can I safely remove, if any?

Thank you

Hi there,

I don't think you should remove any of them....Each of the system databases is there for a purpose and removing one or more will adversely affect your database server (possibly to the point of inoperability).

Below is a link to adescription of the purpose of each system database:
System Databases

Hope that helps a bit or sheds some light on the matter, but sorry if it doesn't
|||Why should one delete the system databases ?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||

Nate,

Thank you for the reponse, it helped quite a bit. I am new to SQL Express and I wasn't sure what those Db's were for, so the link is very helpful.

Removing Data Base Size Restriction

About a month ago I restored a data base that had been originally created in MSDE into a full version of SQL Server 2000. I thought that the size restriction would automatically be removed by putting it into the full version of SQL. I was wrong and about a week or so later the data base reached the 2GB size and needed attention. I received some assistance through Microsoft and they walked my client through the process of removing the size restriction. Since then everything has been OK.

Now I am doing something similar. My client has a data base that was originally created in MSDE. We upgraded them to SQL Express and the data base has now grown to 4GB which is the max that SQL Express allows.

We will be installing SQL for Workgroups this week.

My question is this. Is there a setting I must change inside the data base or in SQL for Workgroups that will allow the data base to grow beyond 4GB? We need to let it expand to whatever they need and I cant seem to find any documentation on whether or not I have to change a setting for this data base.

Thanks for your help. Jean

It's possible that you may need to change the autogrowth settings for the database. In Management Studio, right click the database, choose Properties, then go to the Files page. Check what's in the Autogrowth column for each file and verify that it's either set to "unrestricted growth", or restricted to a sufficiently large size. Looking at an Express Edition installation, it doesn't appear that a 4 GB autogrowth limit is selected by default, however. You should be able to load Developer Edition onto a test machine and play around with this a bit before you go live.|||Thank you David. I will take a look at that when we upgrade the customer. I am certain that is where I will find the settings. I appreciate your help. Jean

removing data

I have a table that I need to delete some data from and put the deleted
data into a different table.

How do I script the following.

If Field1 in Table1 is null, remove that row from Table1 and put it in
a new table called Table2

Regards,
CiarnCreate a newTable having the structure of Oldtable and write a query

Insert into newTable select * from OldTable where Field1 is null
delete from OldTable where Field1 is null

You can also use Trigger

Madhivanan|||Madhivanan wrote:
> Create a newTable having the structure of Oldtable and write a query

What is the quickest way to create a newtable with the structure of the
Oldtable? The Oldtable has over 50 fields, of many different types.|||chudson...@.hotmail.com wrote:
> Madhivanan wrote:
> > Create a newTable having the structure of Oldtable and write a
query
> What is the quickest way to create a newtable with the structure of
the
> Oldtable? The Oldtable has over 50 fields, of many different types.

Look in BOL under "generating scripts"

Edward
--
The reading group's reading group:
http://www.bookgroup.org.uk|||The most performant (as it hardly touches the transaction log) and
easiest way to copy the data into a new table is to use the SELECT INTO
command. Loom in Books Online for more detailed information on this
command and why it is best for this kind of operation.

This will dynamically create a new table for you with all of the
required columns and their basic attributes.

You can then delete the copied records from the source table.

Regards,

Malcolm
www.dbghost.com|||The quickest way is to highlight the table in Query Analyzer and right
click create script.

removing dash lines in query result

Is there any way to remove the dash line in a query result?
use pubs
select emp_id, fname, lname from employee
emp_id fname lname
-- -- --
A-C71970F Aria Cruz
A-R89858F Annette Roulet
AMD15433F Ann Devon
ARD36773F Anabela Domingues
Thanks,
DougTo copy and paste the results ?
Switch to grid format (CTRL + D)
http://sqlservercode.blogspot.com/
"Doug Hood" wrote:

> Is there any way to remove the dash line in a query result?
> use pubs
> select emp_id, fname, lname from employee
> emp_id fname lname
> -- -- --
> A-C71970F Aria Cruz
> A-R89858F Annette Roulet
> AMD15433F Ann Devon
> ARD36773F Anabela Domingues
> Thanks,
> Doug|||Are you copying and pasting the results somewhere else? Try results to grid
instead of results to text. Much more useful for pasting into Excel, at
least.
"Doug Hood" <Doug Hood@.discussions.microsoft.com> wrote in message
news:60C4473C-FF97-4E45-B8B6-D637EE0E12D5@.microsoft.com...
> Is there any way to remove the dash line in a query result?
> use pubs
> select emp_id, fname, lname from employee
> emp_id fname lname
> -- -- --
> A-C71970F Aria Cruz
> A-R89858F Annette Roulet
> AMD15433F Ann Devon
> ARD36773F Anabela Domingues
> Thanks,
> Doug|||No, This ends up as the body of an email. So I need to remove them in the
query.
"Aaron Bertrand [SQL Server MVP]" wrote:

> Are you copying and pasting the results somewhere else? Try results to gr
id
> instead of results to text. Much more useful for pasting into Excel, at
> least.
>
>
> "Doug Hood" <Doug Hood@.discussions.microsoft.com> wrote in message
> news:60C4473C-FF97-4E45-B8B6-D637EE0E12D5@.microsoft.com...
>
>|||Doug,
Might consider using Reporting Services. Much more flexible and robust for
generating reports including via email.
HTH
Jerry
"Doug Hood" <DougHood@.discussions.microsoft.com> wrote in message
news:D544663C-FA83-4AF7-9BAC-24A6AAE1DB91@.microsoft.com...
> No, This ends up as the body of an email. So I need to remove them in the
> query.
> "Aaron Bertrand [SQL Server MVP]" wrote:
>|||In query analyzer go to tools options results and un check print column head
ers
"Doug Hood" wrote:
> No, This ends up as the body of an email. So I need to remove them in the
> query.
> "Aaron Bertrand [SQL Server MVP]" wrote:
>|||Thanks but that turns off both the dashed line AND the column names. I want
to just remove the dashed line.
Doug
"Lontae Jones" wrote:
> In query analyzer go to tools options results and un check print column he
aders
> "Doug Hood" wrote:
>|||I think you're out of luck. Just delete the line after pasting the data into
your email.
That's assuming that you are using QA to run this query. It's not the query
that's inserting these blank lines: it's QA. You could alway write your own
query execution tool in your favorite programming language and have complete
control over the formatting of the query results.
Bob Barrows
Doug Hood wrote:
> Thanks but that turns off both the dashed line AND the column names.
> I want to just remove the dashed line.
> Doug
> "Lontae Jones" wrote:
>
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.|||Well then I'll say it. You're stuck with them. :-(
You just don't have much control over how QA returns the data.
(and it looks crappy anyway)
The best way I can think of is Jerry's suggestion,
Reporting services or another reporting tool.
"Doug Hood" <DougHood@.discussions.microsoft.com> wrote in message
news:282F0632-3D60-4B31-A8BD-AF9318D986C2@.microsoft.com...
> Thanks but that turns off both the dashed line AND the column names. I
> want
> to just remove the dashed line.
> Doug
> "Lontae Jones" wrote:
>

removing constraints without knowing the constraint name

I have the need to remove a constraint on a table since I'm trying to alter
the datatype of one of the columns. I know I can drop the constraint given
the name, but since the name is auto generated (something like
DF__WHRPT_ITV__Expor__45F365D3)
I need a way to find this constraint name so that I can programmatically
remove it.I can get the name using sp_helpconstraint on the table, but can't
seem to locate where the actual constraint_name is stored.

This is on SQL 2000.

Any help is appreciated.

Thanks,

-GaryYou can get rid of Defaults with automatically named constraints in a script
with the following bit of code. Just replace the <table name> and <column
names> with your table and column(s):

DECLARE @.constraint_name SYSNAME

-- remove all the defaults
WHILE 1=1
BEGIN
SET @.constraint_name = (SELECT TOP 1 c_obj.name
FROM sysobjects t_obj
INNER JOIN sysobjects c_obj
ON t_obj.id = c_obj.parent_obj
INNER JOIN syscolumns cols
ON cols.colid = c_obj.info
AND cols.id = c_obj.parent_obj
WHERE t_obj.id = OBJECT_ID('<table name>')
AND c_obj.xtype = 'D'
AND cols.[name]IN ('<column names>'))

IF @.constraint_name IS NULL BREAK

EXEC ('ALTER TABLE <table name> DROP CONSTRAINT ' + @.constraint_name)
END

--
Jacco Schalkwijk
SQL Server MVP

"Gary" <gld@.hotmail.com> wrote in message
news:EIJmd.349072$wV.15308@.attbi_s54...
>I have the need to remove a constraint on a table since I'm trying to alter
> the datatype of one of the columns. I know I can drop the constraint given
> the name, but since the name is auto generated (something like
> DF__WHRPT_ITV__Expor__45F365D3)
> I need a way to find this constraint name so that I can programmatically
> remove it.I can get the name using sp_helpconstraint on the table, but
> can't
> seem to locate where the actual constraint_name is stored.
> This is on SQL 2000.
> Any help is appreciated.
> Thanks,
> -Gary|||Thanks. That works perfectly.

-Gary

"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid> wrote
in message news:uXQ32kLzEHA.1392@.TK2MSFTNGP14.phx.gbl...
> You can get rid of Defaults with automatically named constraints in a
script
> with the following bit of code. Just replace the <table name> and <column
> names> with your table and column(s):
> DECLARE @.constraint_name SYSNAME
> -- remove all the defaults
> WHILE 1=1
> BEGIN
> SET @.constraint_name = (SELECT TOP 1 c_obj.name
> FROM sysobjects t_obj
> INNER JOIN sysobjects c_obj
> ON t_obj.id = c_obj.parent_obj
> INNER JOIN syscolumns cols
> ON cols.colid = c_obj.info
> AND cols.id = c_obj.parent_obj
> WHERE t_obj.id = OBJECT_ID('<table name>')
> AND c_obj.xtype = 'D'
> AND cols.[name]IN ('<column names>'))
> IF @.constraint_name IS NULL BREAK
> EXEC ('ALTER TABLE <table name> DROP CONSTRAINT ' + @.constraint_name)
> END
>
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Gary" <gld@.hotmail.com> wrote in message
> news:EIJmd.349072$wV.15308@.attbi_s54...
> >I have the need to remove a constraint on a table since I'm trying to
alter
> > the datatype of one of the columns. I know I can drop the constraint
given
> > the name, but since the name is auto generated (something like
> > DF__WHRPT_ITV__Expor__45F365D3)
> > I need a way to find this constraint name so that I can programmatically
> > remove it.I can get the name using sp_helpconstraint on the table, but
> > can't
> > seem to locate where the actual constraint_name is stored.
> > This is on SQL 2000.
> > Any help is appreciated.
> > Thanks,
> > -Gary

Removing Commas

i would greatly appreciate if someone could tell me how to remove all the commas from an address table, its causing an excel export to dislocate.
i've tried the "STUFF" predicate but not sure exactly how this works and i also cant use WRITETEXT or UPDATETEXT because they both use TEXTPTR which only works with data of type text,ntext and image and the data i'm trying to update is a varchar.
many thanks
Adey
Hi
Can you try REPLACE function.
update employee
set name = replace(name,',',' '), address=replace(address,',','')
Thanks
Hari
MCDBA
"Adey" <anonymous@.discussions.microsoft.com> wrote in message
news:125C7857-BC05-4996-9FD4-4E6577A17B4B@.microsoft.com...
> i would greatly appreciate if someone could tell me how to remove all the
commas from an address table, its causing an excel export to dislocate.
> i've tried the "STUFF" predicate but not sure exactly how this works and i
also cant use WRITETEXT or UPDATETEXT because they both use TEXTPTR which
only works with data of type text,ntext and image and the data i'm trying to
update is a varchar.
> many thanks
> Adey
|||just tried it... and it works.
Many thanks
Adey

Removing Commas

i would greatly appreciate if someone could tell me how to remove all the co
mmas from an address table, its causing an excel export to dislocate.
i've tried the "STUFF" predicate but not sure exactly how this works and i a
lso cant use WRITETEXT or UPDATETEXT because they both use TEXTPTR which onl
y works with data of type text,ntext and image and the data i'm trying to up
date is a varchar.
many thanks
AdeyHi
Can you try REPLACE function.
update employee
set name = replace(name,',',' '), address=replace(address,',','')
Thanks
Hari
MCDBA
"Adey" <anonymous@.discussions.microsoft.com> wrote in message
news:125C7857-BC05-4996-9FD4-4E6577A17B4B@.microsoft.com...
> i would greatly appreciate if someone could tell me how to remove all the
commas from an address table, its causing an excel export to dislocate.
> i've tried the "STUFF" predicate but not sure exactly how this works and i
also cant use WRITETEXT or UPDATETEXT because they both use TEXTPTR which
only works with data of type text,ntext and image and the data i'm trying to
update is a varchar.
> many thanks
> Adey|||just tried it... and it works.
Many thanks
Adey

Removing Commas

i would greatly appreciate if someone could tell me how to remove all the commas from an address table, its causing an excel export to dislocate
i've tried the "STUFF" predicate but not sure exactly how this works and i also cant use WRITETEXT or UPDATETEXT because they both use TEXTPTR which only works with data of type text,ntext and image and the data i'm trying to update is a varchar
many thank
AdeyHi
Can you try REPLACE function.
update employee
set name = replace(name,',',' '), address=replace(address,',','')
Thanks
Hari
MCDBA
"Adey" <anonymous@.discussions.microsoft.com> wrote in message
news:125C7857-BC05-4996-9FD4-4E6577A17B4B@.microsoft.com...
> i would greatly appreciate if someone could tell me how to remove all the
commas from an address table, its causing an excel export to dislocate.
> i've tried the "STUFF" predicate but not sure exactly how this works and i
also cant use WRITETEXT or UPDATETEXT because they both use TEXTPTR which
only works with data of type text,ntext and image and the data i'm trying to
update is a varchar.
> many thanks
> Adey|||just tried it... and it works
Many thank
Adey

Removing Columns from a data flow

Seems obvious but I can't see how. How would I remove columns from a data flow so that columns which have been used earlier but are not needed for insert/update are taken out of the flow.

I'm asking because the data ends up in a update statement and the flow has got so big it is unreadable.

Cheers, Al

You cannot remove a column from the buffer, the best method is to not create it to start with. Obviously starting from your source, only bring through the columns you need. Any asynchronous components, e.g. Aggregates, Sorts, Joins, can also be used to carefully select only the required columns. A new buffer is allocated for the output in the case of an asynchronous component, so the column selection can be done there. When the component is synchronous, changing the buffer structure would be a problem, as this would mean messing the what is designed to be a fast and efficient data transfer method, and messing with it during it's lifetime would presumably cost more than just carrying the data along. It would however be nice to hide columns at a meta-data level. Perhaps add it as a request in MSDN Feedback.

|||

Is there a way to remove columns in the UNION ALL component? My understanding is that it is an asynchronous component but I have not found a way to remove unneeded columns.

thanks

Peter

|||Once you have added the component, and added the inputs, you can open the UI for the Uion All. Now click on a row (for the column) to select it, then right-click and Delete. The column is now gone.

Removing Columns from a data flow

Seems obvious but I can't see how. How would I remove columns from a data flow so that columns which have been used earlier but are not needed for insert/update are taken out of the flow.

I'm asking because the data ends up in a update statement and the flow has got so big it is unreadable.

Cheers, Al

You cannot remove a column from the buffer, the best method is to not create it to start with. Obviously starting from your source, only bring through the columns you need. Any asynchronous components, e.g. Aggregates, Sorts, Joins, can also be used to carefully select only the required columns. A new buffer is allocated for the output in the case of an asynchronous component, so the column selection can be done there. When the component is synchronous, changing the buffer structure would be a problem, as this would mean messing the what is designed to be a fast and efficient data transfer method, and messing with it during it's lifetime would presumably cost more than just carrying the data along. It would however be nice to hide columns at a meta-data level. Perhaps add it as a request in MSDN Feedback.

|||

Is there a way to remove columns in the UNION ALL component? My understanding is that it is an asynchronous component but I have not found a way to remove unneeded columns.

thanks

Peter

|||Once you have added the component, and added the inputs, you can open the UI for the Uion All. Now click on a row (for the column) to select it, then right-click and Delete. The column is now gone.

Removing Columns and/or Rows on Export

I have a Report I need to hide subtotals and total and include detail only when I am exporting to excel. So, is there a way to capture that it is exporting to Excel? Possibly a way to capture the rs:Format=Excel?

Hello,

I don't think you'll be able to do this, but you could always create a report parameter that would hold the RenderMethod. Then, you can change the formatting of your report based on this value to display how you want.

Jarret

|||True, but I was hoping I might be able to accomplish it without having to have a user go though the step of chosing, since they are already choosing to export to excel.|||

YOu can′t change the output based on a different rendering format, as already mentioned you would have to make a parametrized report, discarding some fields in the case of a specific parameters OR design another report which has the wanted output format.

Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

That was what I was affraid of, just wanted more experienced minds to confirm it for me.

Thanks for the help.

Removing clustered index on Primary key.

Hi,
I want to remove clustering of the Primary Key and make a foreign key in the
table the clustered index. Can I do this with a replicated database? I
suppose I hav to do this then on the Publisher and Subscriber database. Does
anybody has any experience with this?
TIA,
Stefan
You have to:
1. exclude this table from publication
2. do the required manipulations of table schema on publisher and
subscribers
3. add table back to publication.
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"Stefan Gevaert" <stefan.gevaert@.omegasoft.be> wrote in message
news:uA3bA6LZEHA.728@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I want to remove clustering of the Primary Key and make a foreign key in
the
> table the clustered index. Can I do this with a replicated database? I
> suppose I hav to do this then on the Publisher and Subscriber database.
Does
> anybody has any experience with this?
> TIA,
> Stefan
>
|||Stefan,
when I tested this, I found it was possible in merge but not in
transactional replication. Using merge, you should be able to do it directly
on the publisher and using sp_addscriptexec on the subscribers. For
transactional, you'll need to drop then recreate the publication after
making the changes.
HTH,
Paul Ibison
|||I was able to do it by dropping the publication modifying the table and then
replicating it.
Not sure if this is what you want or not.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:OBMjuFQZEHA.3112@.tk2msftngp13.phx.gbl...
> Stefan,
> when I tested this, I found it was possible in merge but not in
> transactional replication. Using merge, you should be able to do it
directly
> on the publisher and using sp_addscriptexec on the subscribers. For
> transactional, you'll need to drop then recreate the publication after
> making the changes.
> HTH,
> Paul Ibison
>

Removing Cluster node

I want to remove a node from my SQL Server Cluster using Add/Remove
Programs. the SQL resource is on the node that is remaining. Question:
When I do the actual removal of the node, will SQL stay on line on the other
node, or does it go offline for a short period of time?
Thanks!
Why?
What version of Windows? 2000? 20003? 2000 uses Add/remove for the service,
2003 does not anymore.
In either case use Cluster Administrator to evict the node from the cluster.
Cheers,
Rodney R. Fournier
MVP - Windows Server - Clustering
http://www.nw-america.com - Clustering Website
http://msmvps.com/clustering - Blog
http://www.clusterhelp.com - Cluster Training
ClusterHelp.com is a Microsoft Certified Gold Partner
"Steve" <Steve.sam@.hotmail.com> wrote in message
news:O2bgTM5eHHA.1312@.TK2MSFTNGP03.phx.gbl...
>I want to remove a node from my SQL Server Cluster using Add/Remove
>Programs. the SQL resource is on the node that is remaining. Question:
>When I do the actual removal of the node, will SQL stay on line on the
>other node, or does it go offline for a short period of time?
> Thanks!
>
|||We're on Windows 2003 Enterprise 64 bit
I'm just interested in the SQL part right now. I'm using SQL 2005 Standard.
When SQL is on one of the nodes, I'm experiencing all kinds of problems and
have been unable to resolve the issue so I'm just going to get rid of that
node and build a new one. I know I need to evict the node from Windows
Clustering, but I also want to remove the node from the SQL cluster in the
proper way, which I believe to be through add/remove programs and selecting
the instance of SQL to change. But what I wanted to know was if there is
downtime involved in removing the node from the SQL Cluster (i.e. SQL
Virtual Server)
Thanks!
"Rodney R. Fournier [MVP]" <rod@.die.spam.die.nw-america.com> wrote in
message news:etOxiR5eHHA.4772@.TK2MSFTNGP05.phx.gbl...
> Why?
> What version of Windows? 2000? 20003? 2000 uses Add/remove for the
> service, 2003 does not anymore.
> In either case use Cluster Administrator to evict the node from the
> cluster.
> Cheers,
> Rodney R. Fournier
> MVP - Windows Server - Clustering
> http://www.nw-america.com - Clustering Website
> http://msmvps.com/clustering - Blog
> http://www.clusterhelp.com - Cluster Training
> ClusterHelp.com is a Microsoft Certified Gold Partner
>
> "Steve" <Steve.sam@.hotmail.com> wrote in message
> news:O2bgTM5eHHA.1312@.TK2MSFTNGP03.phx.gbl...
>
|||"Steve" <Steve.sam@.hotmail.com> wrote in message
news:e9MVkY5eHHA.2052@.TK2MSFTNGP05.phx.gbl...
> We're on Windows 2003 Enterprise 64 bit
> I'm just interested in the SQL part right now. I'm using SQL 2005
> Standard. When SQL is on one of the nodes, I'm experiencing all kinds of
> problems and have been unable to resolve the issue so I'm just going to
> get rid of that node and build a new one. I know I need to evict the node
> from Windows Clustering, but I also want to remove the node from the SQL
> cluster in the proper way, which I believe to be through add/remove
> programs and selecting the instance of SQL to change. But what I wanted
> to know was if there is downtime involved in removing the node from the
> SQL Cluster (i.e. SQL Virtual Server)
> Thanks!
>
> "Rodney R. Fournier [MVP]" <rod@.die.spam.die.nw-america.com> wrote in
> message news:etOxiR5eHHA.4772@.TK2MSFTNGP05.phx.gbl...
>
>
You would use add/remove pgms to destroy the whole SQL Server install, not
just one node.
Cluster Administrator is your friend.

removing chr(13) and chr(10) from SQL

Hi.

Is there a way to remove carriage returns and line feeds from a field in SQL.

Here is what I have at the moment:

CAST(m.Description AS VARCHAR(8000))AS "Product Description"

(have had to cast as VarChar because of problems with aggregate functions in rest of query).

Problem is that this m.description field has carriage returns and line breaks in it .. how do I remove these inside the SQL statement?

thanksHave you tried REPLACE ( StringExpression1 , StringExpression2 , StringExpression3 ) T-SQL function?|||I tried something like this:

CAST(replace(m.Description, vlbf, ' ') AS VARCHAR(8000))AS "Product Description",

and tried variations of vlbf such as chr(10) chr(13) or \r\n and none of them worked.

I can't put them in single quotes as SQL will look for the actual occurence in the string rather than what it stands for.

I get the error column vlbf is unknown or chr(10) is an unknown function...|||sorted it now.... used this in the end:

REPLACE(CAST(m.Description AS varChar(1000)),char(13) + char(10),' ') AS "Product Description",

Thanks for the help

Removing Characters in Field grouping

Hello,

I am using the following expression to strip the last 11 characters in a field group and it returns an error saying that Len cannot use a negative number. It must be 0 or greater. Is there a better alternative?

Code Snippet

left(Fields!TestName.Value,len(Fields!TestName.Value)-11))

you can use Rtrim|||

Are you always removing 11 character regardless of the field length or do you simply want to restrict it to a certain size?

For example, the following code restricts the length to 5 characters:

=iif(len(rtrim(Fields!TestDATA.Value)) > 5, mid(rtrim(Fields!TestDATA.Value),1,5), rtrim(Fields!TESTDATA.Value))

Removing characters

I want to remove all non-letter, non-number characters in a string. An example string would be: How#can*I^make this@.work?
I would like it to look like HowcanImakethiswork
I need to do this for a whole field. Any ideas?
ThanksCreate a user-defined function such as this:

create function CharOnly(@.TargetString varchar(500))
returns varchar(500)
as
begin
declare @.NewString varchar(50)
declare @.Counter int
set @.NewString = ''
set @.Counter = 0
while @.Counter < len(@.TargetString)
begin
set @.Counter = @.Counter + 1
if ASCII(UPPER(substring(@.TargetString, @.Counter, 1))) between 65 and 90 set @.NewString = @.NewString + substring(@.TargetString, @.Counter, 1)
end
return @.NewString
end

Then use it in your select statement like this:
select dbo.CharOnly('How#can*I^make this@.work?')

blindman|||If you are looking for a way to process regular expressions, click on the following link:

link (http://www.codeproject.com/database/xp_pcre.asp?target=xp_pcre)

Removing character from varchar

Hello all,
How would you remove the last character from the following string:
jmy0084t?
Thanks
JonJon wrote:
> Hello all,
> How would you remove the last character from the following string:
> jmy0084t?
> Thanks
> Jon
>
select left('jmy0084t',len('jmy0084t')-1)|||Hi
Such as
DECLARE @.str varchar(10)
SET @.str = 'jmy0084t?'
SELECT @.str,LEFT(@.str,LEN(@.str)-1),STUFF(@.str,LEN(@.str),1,'')
John
"Jon" wrote:
> Hello all,
> How would you remove the last character from the following string:
> jmy0084t?
> Thanks
> Jon
>

Removing certain records of a SQL Server table

Hello all,

A little question regarding SQL Server DB's.

I have a two tables containing customers invoices, one for the invoices header (ie: customer #, invoice date,... KEY: invoice # + invoice date) and another for the details of the invoices (ie: each invoice line details KEY: invoice # + line #). I need to periodically remove invoices older than a certain timeframe (ex: all invoices older than 48 months).

How can I proceed?

I am fairly new with SQL server... Please help!

Thanks,

Eric
:(Set up a cascading delete relationship between your invoices table and your invoice lines table. Then run this statement:

delete
from Invoices
where InvoiceDate < dateadd(months, -48, getdate())

Look up the dateadd function in Books Online to verify the syntax above.|||Skunked again.

Removing case sensitivity

Is there a way to remove Case Sensitivity from a SQL 2000 server? I can't
imagine why anyone would set the server to this but one of my vendors did and
I hate needing to know exactly where to put my caps...
TIA,
Joe
This should help :-
http://support.microsoft.com/default...b;en-us;325335
HTH. Ryan
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
> Is there a way to remove Case Sensitivity from a SQL 2000 server? I can't
> imagine why anyone would set the server to this but one of my vendors did
> and
> I hate needing to know exactly where to put my caps...
> TIA,
> Joe
>
|||"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
> Is there a way to remove Case Sensitivity from a SQL 2000 server? I can't
> imagine why anyone would set the server to this but one of my vendors did
> and
> I hate needing to know exactly where to put my caps...
> TIA,
> Joe
>
Case sensitive db's can be faster. ;-)
You don't have to figure out whether or not Apple = APPLE = ApPle etc. You
can do a simple binary compare.
Rick Sawtell
MCT, MCSD, MCDBA
|||Thank you I will check this out.
From a quick look it seems like I have to rebuild the SQL server for this?
Thanks Again,
Joe
"Ryan" wrote:

> This should help :-
> http://support.microsoft.com/default...b;en-us;325335
> --
> HTH. Ryan
> "jaylou" <jaylou@.discussions.microsoft.com> wrote in message
> news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
>
>
|||Yes you are correct, but when I have a query "select * from apple_tbl" I get
an error saying the object does not exist becuase it is spelled apple_Tbl.
How do you get around every query and SP you write?
Thanks for the response,
Joe
"Rick Sawtell" wrote:

> "jaylou" <jaylou@.discussions.microsoft.com> wrote in message
> news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
> Case sensitive db's can be faster. ;-)
> You don't have to figure out whether or not Apple = APPLE = ApPle etc. You
> can do a simple binary compare.
>
> Rick Sawtell
> MCT, MCSD, MCDBA
>
>
|||Afraid so..
HTH. Ryan
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:819D50DF-DF8A-49CE-B6D2-17E822F8A742@.microsoft.com...[vbcol=seagreen]
> Thank you I will check this out.
> From a quick look it seems like I have to rebuild the SQL server for this?
> Thanks Again,
> Joe
>
> "Ryan" wrote:
|||jaylou wrote:
> Yes you are correct, but when I have a query "select * from
> apple_tbl" I get an error saying the object does not exist becuase it
> is spelled apple_Tbl.
> How do you get around every query and SP you write?
>
You do not have to reinstall SQL Server to change a database collation.
You can create a new database with the correct collation and then
migrate the data. System tables in master will still be case sensitive.
You can also change the database collation directly and then copy the
tables in the database (changing the collation does not change the
collation of existing objects)
-- for example
alter database MyDB
COLLATE SQL_Latin1_General_CP1_CI_AS
You could also rename your objects in the existing database to use
lower-case to avoid these issues. While the standard has moved away from
case-sensitive collations, I do think they offer some advantages since
they keep object names capitalized the same in the database.
David Gugick - SQL Server MVP
Quest Software
|||and some of us hate when applications are written that don't use the correct
case and barf on case-sensitive servers ;)
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:2FD17568-400F-40DD-953A-D0181683761E@.microsoft.com...[vbcol=seagreen]
> Yes you are correct, but when I have a query "select * from apple_tbl" I
> get
> an error saying the object does not exist becuase it is spelled apple_Tbl.
> How do you get around every query and SP you write?
> Thanks for the response,
> Joe
> "Rick Sawtell" wrote:

Removing case sensitivity

Is there a way to remove Case Sensitivity from a SQL 2000 server? I can't
imagine why anyone would set the server to this but one of my vendors did and
I hate needing to know exactly where to put my caps...
TIA,
JoeThis should help :-
http://support.microsoft.com/default.aspx?scid=kb;en-us;325335
--
HTH. Ryan
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
> Is there a way to remove Case Sensitivity from a SQL 2000 server? I can't
> imagine why anyone would set the server to this but one of my vendors did
> and
> I hate needing to know exactly where to put my caps...
> TIA,
> Joe
>|||"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
> Is there a way to remove Case Sensitivity from a SQL 2000 server? I can't
> imagine why anyone would set the server to this but one of my vendors did
> and
> I hate needing to know exactly where to put my caps...
> TIA,
> Joe
>
Case sensitive db's can be faster. ;-)
You don't have to figure out whether or not Apple = APPLE = ApPle etc. You
can do a simple binary compare.
Rick Sawtell
MCT, MCSD, MCDBA|||Thank you I will check this out.
From a quick look it seems like I have to rebuild the SQL server for this?
Thanks Again,
Joe
"Ryan" wrote:
> This should help :-
> http://support.microsoft.com/default.aspx?scid=kb;en-us;325335
> --
> HTH. Ryan
> "jaylou" <jaylou@.discussions.microsoft.com> wrote in message
> news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
> > Is there a way to remove Case Sensitivity from a SQL 2000 server? I can't
> > imagine why anyone would set the server to this but one of my vendors did
> > and
> > I hate needing to know exactly where to put my caps...
> >
> > TIA,
> > Joe
> >
>
>|||Yes you are correct, but when I have a query "select * from apple_tbl" I get
an error saying the object does not exist becuase it is spelled apple_Tbl.
How do you get around every query and SP you write?
Thanks for the response,
Joe
"Rick Sawtell" wrote:
> "jaylou" <jaylou@.discussions.microsoft.com> wrote in message
> news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
> > Is there a way to remove Case Sensitivity from a SQL 2000 server? I can't
> > imagine why anyone would set the server to this but one of my vendors did
> > and
> > I hate needing to know exactly where to put my caps...
> >
> > TIA,
> > Joe
> >
> Case sensitive db's can be faster. ;-)
> You don't have to figure out whether or not Apple = APPLE = ApPle etc. You
> can do a simple binary compare.
>
> Rick Sawtell
> MCT, MCSD, MCDBA
>
>|||Afraid so..
--
HTH. Ryan
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:819D50DF-DF8A-49CE-B6D2-17E822F8A742@.microsoft.com...
> Thank you I will check this out.
> From a quick look it seems like I have to rebuild the SQL server for this?
> Thanks Again,
> Joe
>
> "Ryan" wrote:
>> This should help :-
>> http://support.microsoft.com/default.aspx?scid=kb;en-us;325335
>> --
>> HTH. Ryan
>> "jaylou" <jaylou@.discussions.microsoft.com> wrote in message
>> news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
>> > Is there a way to remove Case Sensitivity from a SQL 2000 server? I
>> > can't
>> > imagine why anyone would set the server to this but one of my vendors
>> > did
>> > and
>> > I hate needing to know exactly where to put my caps...
>> >
>> > TIA,
>> > Joe
>> >
>>|||jaylou wrote:
> Yes you are correct, but when I have a query "select * from
> apple_tbl" I get an error saying the object does not exist becuase it
> is spelled apple_Tbl.
> How do you get around every query and SP you write?
>
You do not have to reinstall SQL Server to change a database collation.
You can create a new database with the correct collation and then
migrate the data. System tables in master will still be case sensitive.
You can also change the database collation directly and then copy the
tables in the database (changing the collation does not change the
collation of existing objects)
-- for example
alter database MyDB
COLLATE SQL_Latin1_General_CP1_CI_AS
You could also rename your objects in the existing database to use
lower-case to avoid these issues. While the standard has moved away from
case-sensitive collations, I do think they offer some advantages since
they keep object names capitalized the same in the database.
David Gugick - SQL Server MVP
Quest Software|||and some of us hate when applications are written that don't use the correct
case and barf on case-sensitive servers ;)
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:2FD17568-400F-40DD-953A-D0181683761E@.microsoft.com...
> Yes you are correct, but when I have a query "select * from apple_tbl" I
> get
> an error saying the object does not exist becuase it is spelled apple_Tbl.
> How do you get around every query and SP you write?
> Thanks for the response,
> Joe
> "Rick Sawtell" wrote:
>> "jaylou" <jaylou@.discussions.microsoft.com> wrote in message
>> news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
>> > Is there a way to remove Case Sensitivity from a SQL 2000 server? I
>> > can't
>> > imagine why anyone would set the server to this but one of my vendors
>> > did
>> > and
>> > I hate needing to know exactly where to put my caps...
>> >
>> > TIA,
>> > Joe
>> >
>> Case sensitive db's can be faster. ;-)
>> You don't have to figure out whether or not Apple = APPLE = ApPle etc.
>> You
>> can do a simple binary compare.
>>
>> Rick Sawtell
>> MCT, MCSD, MCDBA
>>
>>

Removing case sensitivity

Is there a way to remove Case Sensitivity from a SQL 2000 server? I can't
imagine why anyone would set the server to this but one of my vendors did an
d
I hate needing to know exactly where to put my caps...
TIA,
JoeThis should help :-
http://support.microsoft.com/defaul...kb;en-us;325335
HTH. Ryan
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
> Is there a way to remove Case Sensitivity from a SQL 2000 server? I can't
> imagine why anyone would set the server to this but one of my vendors did
> and
> I hate needing to know exactly where to put my caps...
> TIA,
> Joe
>|||"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
> Is there a way to remove Case Sensitivity from a SQL 2000 server? I can't
> imagine why anyone would set the server to this but one of my vendors did
> and
> I hate needing to know exactly where to put my caps...
> TIA,
> Joe
>
Case sensitive db's can be faster. ;-)
You don't have to figure out whether or not Apple = APPLE = ApPle etc. You
can do a simple binary compare.
Rick Sawtell
MCT, MCSD, MCDBA|||Thank you I will check this out.
From a quick look it seems like I have to rebuild the SQL server for this?
Thanks Again,
Joe
"Ryan" wrote:

> This should help :-
> http://support.microsoft.com/defaul...kb;en-us;325335
> --
> HTH. Ryan
> "jaylou" <jaylou@.discussions.microsoft.com> wrote in message
> news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
>
>|||Yes you are correct, but when I have a query "select * from apple_tbl" I get
an error saying the object does not exist becuase it is spelled apple_Tbl.
How do you get around every query and SP you write?
Thanks for the response,
Joe
"Rick Sawtell" wrote:

> "jaylou" <jaylou@.discussions.microsoft.com> wrote in message
> news:068ACE9B-3F12-4ED0-926A-8826B059CA3D@.microsoft.com...
> Case sensitive db's can be faster. ;-)
> You don't have to figure out whether or not Apple = APPLE = ApPle etc. Y
ou
> can do a simple binary compare.
>
> Rick Sawtell
> MCT, MCSD, MCDBA
>
>|||Afraid so..
HTH. Ryan
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:819D50DF-DF8A-49CE-B6D2-17E822F8A742@.microsoft.com...[vbcol=seagreen]
> Thank you I will check this out.
> From a quick look it seems like I have to rebuild the SQL server for this?
> Thanks Again,
> Joe
>
> "Ryan" wrote:
>|||jaylou wrote:
> Yes you are correct, but when I have a query "select * from
> apple_tbl" I get an error saying the object does not exist becuase it
> is spelled apple_Tbl.
> How do you get around every query and SP you write?
>
You do not have to reinstall SQL Server to change a database collation.
You can create a new database with the correct collation and then
migrate the data. System tables in master will still be case sensitive.
You can also change the database collation directly and then copy the
tables in the database (changing the collation does not change the
collation of existing objects)
-- for example
alter database MyDB
COLLATE SQL_Latin1_General_CP1_CI_AS
You could also rename your objects in the existing database to use
lower-case to avoid these issues. While the standard has moved away from
case-sensitive collations, I do think they offer some advantages since
they keep object names capitalized the same in the database.
David Gugick - SQL Server MVP
Quest Software|||and some of us hate when applications are written that don't use the correct
case and barf on case-sensitive servers ;)
"jaylou" <jaylou@.discussions.microsoft.com> wrote in message
news:2FD17568-400F-40DD-953A-D0181683761E@.microsoft.com...[vbcol=seagreen]
> Yes you are correct, but when I have a query "select * from apple_tbl" I
> get
> an error saying the object does not exist becuase it is spelled apple_Tbl.
> How do you get around every query and SP you write?
> Thanks for the response,
> Joe
> "Rick Sawtell" wrote:
>

removing Builtin\Administrators login

How can I safely remove the Builtin\Administrators login?See the following:
http://www.microsoft.com/technet/tr...chnet/prodtechn
ol/sql/maintain/security/sp3sec/SP3SEC02.ASP
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||Thanks
quote:

>--Original Message--
>See the following:
>http://www.microsoft.com/technet/treeview/default.asp?

url=/technet/prodtechn
quote:

>ol/sql/maintain/security/sp3sec/SP3SEC02.ASP
>Thanks,
>Kevin McDonnell
>Microsoft Corporation
>This posting is provided AS IS with no warranties, and

confers no rights.
quote:

>
>.
>

Removing BUILTIN\Administrators

We need to remove the BUILTIN\Administrators from reporting services. I.T. personnel do not want to be able to see restricted reports. We have two department users that have been added as Content Managers and we are running reporting services under a created domain user account that we created and not a system service. I have removed BUILTIN\Administrators from the Home folder and when I check, it comes right back. Do I need to deny access to BUILTIN\Administrator on SQL Server 2005 itself? I would apprecate any suggestions.

I used the link below and followed the steps to remove the BUILTIN\Administrators group from SQL Server 2005 and SRS 2005. Hopefully this will be helpful to others.

http://www.mssqltips.com/tip.asp?tip1017

Removing BUILTIN\ADMINISTRATOR

Hello
I'm sure this has been answered many times, but my search of the newsgroup
gives me hits on messages that have already been 'removed'. Googling hasn't
given me the answer yet either.
I need to remove BUILTIN from many 'inherited' servers that I am called on
to support. I am required to remove it. However, it is also DBO for every
database. All the databases are actually owned by 'sa'. If I try to drop
BUILTIN access to a database I get the 'the database owner cannot be
dropped'. If I try to drop remove the DBO permit for BUILTIN in a database
I get 'Error 15405: Cannot use the reserved user or role name dbo'. UGH!
There's a simple solution for this, right?
Thanks!
> I need to remove BUILTIN from many 'inherited' servers that I am called on to support. I am
> required to remove it. However, it is also DBO for every database. All the databases are
> actually owned by 'sa'.
Above is a contradiction. You can't have both BUILTIN\Administrators *and* sa as owner for a
database! My guess is that the owner is BUILTIN\Administrators. Just change the owner to sa, using
sp_changedbowner.
Also, before removing the administrators group, add LocalSystem (actual name is NT
AUTHORITY\SYSTEM). Google for it to see why.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Steve" <pezguy@.mn.rr.com> wrote in message news:fpsbe.31959$215.21781@.tornado.rdc-kc.rr.com...
> Hello
> I'm sure this has been answered many times, but my search of the newsgroup gives me hits on
> messages that have already been 'removed'. Googling hasn't given me the answer yet either.
> I need to remove BUILTIN from many 'inherited' servers that I am called on to support. I am
> required to remove it. However, it is also DBO for every database. All the databases are
> actually owned by 'sa'. If I try to drop BUILTIN access to a database I get the 'the database
> owner cannot be dropped'. If I try to drop remove the DBO permit for BUILTIN in a database I get
> 'Error 15405: Cannot use the reserved user or role name dbo'. UGH!
> There's a simple solution for this, right?
> Thanks!
>
|||Hi Steve,
Maybe this articles will help you:
"Removing builtin\administrators: Some pitfalls to avoid"
http://www.sqlservercentral.com/colu...lstoavoi .asp
"10 Steps to Securing your SQL Server"
http://www.sqlservercentral.com/colu...rsqlserver.asp
Cristian Lefter, SQL Server MVP
"Steve" <pezguy@.mn.rr.com> wrote in message
news:fpsbe.31959$215.21781@.tornado.rdc-kc.rr.com...
> Hello
> I'm sure this has been answered many times, but my search of the newsgroup
> gives me hits on messages that have already been 'removed'. Googling
> hasn't given me the answer yet either.
> I need to remove BUILTIN from many 'inherited' servers that I am called on
> to support. I am required to remove it. However, it is also DBO for
> every database. All the databases are actually owned by 'sa'. If I try
> to drop BUILTIN access to a database I get the 'the database owner cannot
> be dropped'. If I try to drop remove the DBO permit for BUILTIN in a
> database I get 'Error 15405: Cannot use the reserved user or role name
> dbo'. UGH!
> There's a simple solution for this, right?
> Thanks!
>