Please excuse my noviceness, but how is it possible that I
can have duplicate records that are exactly the same in
every way when there is a PK field that is meant to be
unique?
Because this has happened, I've had to remove and re-index.
Can anyone please help this novice?That shouldn't happen, and I've never heard that it really happened. But it
is difficult to do anything or troubleshoot if you don't have a repro or
don't have the data anymore.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Benjamin" <ben.jones@.trendwest.com.au> wrote in message
news:2c7301c3a8ad$61c25480$3101280a@.phx.gbl...
> Please excuse my noviceness, but how is it possible that I
> can have duplicate records that are exactly the same in
> every way when there is a PK field that is meant to be
> unique?
> Because this has happened, I've had to remove and re-index.
> Can anyone please help this novice?
Thursday, March 29, 2012
duplicate the SQL login
I have some sql login but I have forgotten the password. I can't modify the password anyway. Is there anyway to copy the login to a new login so that I can use the new login to access the database which it is granted to?
i am not sure i got the problem correctly ........ but anyhow you can not have duplicate login... but what u can do is you can create script of the existing login and then change only the name and password ... keep all other setting... this is as good as cloning of this login...
BTW ... why you can not change the password
Madhu
Duplicate Text data
Anyone have a method for identifiying dupes in a text field?
coromokes wrote:
> Anyone have a method for identifiying dupes in a text field?
By dupes, you mean the existence of the same text value in more than one
row? If so, you can group on the text column and use a having clause to
test for dupes.
You'll need to convert to a varchar or nvarchar data type first, which
means you'll only get access to teh first 4,000 or 8,0000 characters for
the test. But maybe that's good enough.
Select CAST(TextDataCol as VARCHAR(8000))
From TableName
Group By CAST(TextDataCol as VARCHAR(8000))
Having COUNT(*) > 1
David Gugick
Imceda Software
www.imceda.com
sql
coromokes wrote:
> Anyone have a method for identifiying dupes in a text field?
By dupes, you mean the existence of the same text value in more than one
row? If so, you can group on the text column and use a having clause to
test for dupes.
You'll need to convert to a varchar or nvarchar data type first, which
means you'll only get access to teh first 4,000 or 8,0000 characters for
the test. But maybe that's good enough.
Select CAST(TextDataCol as VARCHAR(8000))
From TableName
Group By CAST(TextDataCol as VARCHAR(8000))
Having COUNT(*) > 1
David Gugick
Imceda Software
www.imceda.com
sql
Duplicate tables in subscriber database
we are replicating a table in sql 2000, all seems to be going well, but there
seem to be twice as many tables in the subscriber database than on the
publisher. For Example: there is talble f0092 that has the owner as dbo &
sys7334. This is the case for each single table, thus my database on the
subscriber is almost twice as large. Can anyone tell me why this happening
and what i need to do to correct this isssue
1. What is the sys7334 user? Does it own the replication?
2. Have you tried 1) drop subscription; 2) delete the tables in the
subscription database; 3) re-add subscription ? Or try creating a new
database and subscribe to your publication from it; does the same thing
happen? Those duplicate tables could be left over from a previous attempt
at replication.
Mike
"Mark Alejandro" <MarkAlejandro@.discussions.microsoft.com> wrote in message
news:36FCE4B3-FDB4-4600-885C-8A4D9F66C9B3@.microsoft.com...
> we are replicating a table in sql 2000, all seems to be going well, but
there
> seem to be twice as many tables in the subscriber database than on the
> publisher. For Example: there is talble f0092 that has the owner as dbo &
> sys7334. This is the case for each single table, thus my database on the
> subscriber is almost twice as large. Can anyone tell me why this happening
> and what i need to do to correct this isssue
seem to be twice as many tables in the subscriber database than on the
publisher. For Example: there is talble f0092 that has the owner as dbo &
sys7334. This is the case for each single table, thus my database on the
subscriber is almost twice as large. Can anyone tell me why this happening
and what i need to do to correct this isssue
1. What is the sys7334 user? Does it own the replication?
2. Have you tried 1) drop subscription; 2) delete the tables in the
subscription database; 3) re-add subscription ? Or try creating a new
database and subscribe to your publication from it; does the same thing
happen? Those duplicate tables could be left over from a previous attempt
at replication.
Mike
"Mark Alejandro" <MarkAlejandro@.discussions.microsoft.com> wrote in message
news:36FCE4B3-FDB4-4600-885C-8A4D9F66C9B3@.microsoft.com...
> we are replicating a table in sql 2000, all seems to be going well, but
there
> seem to be twice as many tables in the subscriber database than on the
> publisher. For Example: there is talble f0092 that has the owner as dbo &
> sys7334. This is the case for each single table, thus my database on the
> subscriber is almost twice as large. Can anyone tell me why this happening
> and what i need to do to correct this isssue
Duplicate tables
Hi
Is there a way for duplicating tables in two databases?
I have a db1 with 3 tables, and I would like to create 3 similar tables in
my db2 (same structure).
Is there a tool to make this easy?
The easiest way, IMO, is just to script the tables using Query Analyzer and
create them in the new database. Right-click on the table in the Object
Browser, select Script Object to New Window As, and click Create. Now just
change databases and apply the script.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:%23pD0Ogc8EHA.3476@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a way for duplicating tables in two databases?
> I have a db1 with 3 tables, and I would like to create 3 similar tables in
> my db2 (same structure).
> Is there a tool to make this easy?
>
|||If you wish to include indexes, constraints, triggers, etc, use SQL
Enterprise Manager, Right Click your database ->All tasks_>Generate SQL
Script
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:%23pD0Ogc8EHA.3476@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a way for duplicating tables in two databases?
> I have a db1 with 3 tables, and I would like to create 3 similar tables in
> my db2 (same structure).
> Is there a tool to make this easy?
>
|||Hi Gonzalo,
Simplest way is using SELECT INTO (check BOL). This will create table
(without index, constraints, foreign keys...) with the data.
Other methods are:
(a) Using BCP tool
(b) Script the table, apply it and then use INSERT INTO
Thanks
GYK
Is there a way for duplicating tables in two databases?
I have a db1 with 3 tables, and I would like to create 3 similar tables in
my db2 (same structure).
Is there a tool to make this easy?
The easiest way, IMO, is just to script the tables using Query Analyzer and
create them in the new database. Right-click on the table in the Object
Browser, select Script Object to New Window As, and click Create. Now just
change databases and apply the script.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:%23pD0Ogc8EHA.3476@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a way for duplicating tables in two databases?
> I have a db1 with 3 tables, and I would like to create 3 similar tables in
> my db2 (same structure).
> Is there a tool to make this easy?
>
|||If you wish to include indexes, constraints, triggers, etc, use SQL
Enterprise Manager, Right Click your database ->All tasks_>Generate SQL
Script
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:%23pD0Ogc8EHA.3476@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a way for duplicating tables in two databases?
> I have a db1 with 3 tables, and I would like to create 3 similar tables in
> my db2 (same structure).
> Is there a tool to make this easy?
>
|||Hi Gonzalo,
Simplest way is using SELECT INTO (check BOL). This will create table
(without index, constraints, foreign keys...) with the data.
Other methods are:
(a) Using BCP tool
(b) Script the table, apply it and then use INSERT INTO
Thanks
GYK
Duplicate tables
Hi
Is there a way for duplicating tables in two databases?
I have a db1 with 3 tables, and I would like to create 3 similar tables in
my DB2 (same structure).
Is there a tool to make this easy?The easiest way, IMO, is just to script the tables using Query Analyzer and
create them in the new database. Right-click on the table in the Object
Browser, select Script Object to New Window As, and click Create. Now just
change databases and apply the script.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:%23pD0Ogc8EHA.3476@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a way for duplicating tables in two databases?
> I have a db1 with 3 tables, and I would like to create 3 similar tables in
> my DB2 (same structure).
> Is there a tool to make this easy?
>|||If you wish to include indexes, constraints, triggers, etc, use SQL
Enterprise Manager, Right Click your database ->All tasks_>Generate SQL
Script
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:%23pD0Ogc8EHA.3476@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a way for duplicating tables in two databases?
> I have a db1 with 3 tables, and I would like to create 3 similar tables in
> my DB2 (same structure).
> Is there a tool to make this easy?
>|||Hi Gonzalo,
Simplest way is using SELECT INTO (check BOL). This will create table
(without index, constraints, foreign keys...) with the data.
Other methods are:
(a) Using BCP tool
(b) Script the table, apply it and then use INSERT INTO
Thanks
GYK
Is there a way for duplicating tables in two databases?
I have a db1 with 3 tables, and I would like to create 3 similar tables in
my DB2 (same structure).
Is there a tool to make this easy?The easiest way, IMO, is just to script the tables using Query Analyzer and
create them in the new database. Right-click on the table in the Object
Browser, select Script Object to New Window As, and click Create. Now just
change databases and apply the script.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:%23pD0Ogc8EHA.3476@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a way for duplicating tables in two databases?
> I have a db1 with 3 tables, and I would like to create 3 similar tables in
> my DB2 (same structure).
> Is there a tool to make this easy?
>|||If you wish to include indexes, constraints, triggers, etc, use SQL
Enterprise Manager, Right Click your database ->All tasks_>Generate SQL
Script
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:%23pD0Ogc8EHA.3476@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a way for duplicating tables in two databases?
> I have a db1 with 3 tables, and I would like to create 3 similar tables in
> my DB2 (same structure).
> Is there a tool to make this easy?
>|||Hi Gonzalo,
Simplest way is using SELECT INTO (check BOL). This will create table
(without index, constraints, foreign keys...) with the data.
Other methods are:
(a) Using BCP tool
(b) Script the table, apply it and then use INSERT INTO
Thanks
GYK
Duplicate tables
Hi
Is there a way for duplicating tables in two databases?
I have a db1 with 3 tables, and I would like to create 3 similar tables in
my db2 (same structure).
Is there a tool to make this easy?The easiest way, IMO, is just to script the tables using Query Analyzer and
create them in the new database. Right-click on the table in the Object
Browser, select Script Object to New Window As, and click Create. Now just
change databases and apply the script.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:%23pD0Ogc8EHA.3476@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a way for duplicating tables in two databases?
> I have a db1 with 3 tables, and I would like to create 3 similar tables in
> my db2 (same structure).
> Is there a tool to make this easy?
>|||If you wish to include indexes, constraints, triggers, etc, use SQL
Enterprise Manager, Right Click your database ->All tasks_>Generate SQL
Script
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:%23pD0Ogc8EHA.3476@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a way for duplicating tables in two databases?
> I have a db1 with 3 tables, and I would like to create 3 similar tables in
> my db2 (same structure).
> Is there a tool to make this easy?
>|||Hi Gonzalo,
Simplest way is using SELECT INTO (check BOL). This will create table
(without index, constraints, foreign keys...) with the data.
Other methods are:
(a) Using BCP tool
(b) Script the table, apply it and then use INSERT INTO
--
Thanks
GYK
Is there a way for duplicating tables in two databases?
I have a db1 with 3 tables, and I would like to create 3 similar tables in
my db2 (same structure).
Is there a tool to make this easy?The easiest way, IMO, is just to script the tables using Query Analyzer and
create them in the new database. Right-click on the table in the Object
Browser, select Script Object to New Window As, and click Create. Now just
change databases and apply the script.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:%23pD0Ogc8EHA.3476@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a way for duplicating tables in two databases?
> I have a db1 with 3 tables, and I would like to create 3 similar tables in
> my db2 (same structure).
> Is there a tool to make this easy?
>|||If you wish to include indexes, constraints, triggers, etc, use SQL
Enterprise Manager, Right Click your database ->All tasks_>Generate SQL
Script
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:%23pD0Ogc8EHA.3476@.TK2MSFTNGP15.phx.gbl...
> Hi
> Is there a way for duplicating tables in two databases?
> I have a db1 with 3 tables, and I would like to create 3 similar tables in
> my db2 (same structure).
> Is there a tool to make this easy?
>|||Hi Gonzalo,
Simplest way is using SELECT INTO (check BOL). This will create table
(without index, constraints, foreign keys...) with the data.
Other methods are:
(a) Using BCP tool
(b) Script the table, apply it and then use INSERT INTO
--
Thanks
GYK
Subscribe to:
Posts (Atom)