Showing posts with label remote. Show all posts
Showing posts with label remote. Show all posts

Friday, March 23, 2012

reset IDENTITY after table data import?

I have a remote DB I am wokring with at present. The DBA has provided me with a non owner LOGIN so I can't copy tables from the live to the staged DB as objects I can only copy tables and data.

The PKEY and IDENTITY COLUMNS get reset to just regular columns on each table. I can restore the PKEY constraint and have come across the DBCC CHECKIDENT to get the new ident value. I just can't figure out how to set a column to be an identity. The ALTER TABLE command isn't having any of it.

I am obviously missing the right bit on Books online

any suggestions?

many thanks

SteveThere isn't any way I know to add the IDENTITY property to an existing column. I'm pretty sure that it must be done at the time of the table creation.

My advice would be to script the table from the production DB, change the script to use IDENTITY, then copy the data from production to your working table.

-PatP

Tuesday, February 21, 2012

Repost - Linked server security - Help!

I have 2 questions.
1. Can I map a local NT group (not a user) to a remote login (SQL account)?
(local server is SQL7, remote server is SQL 2K)
2. I kept add new login mappings from the security tab. Then I clicked OK
and closed it. No error messages. Next time when I opened the tab, it only
shows the first mapping I did. The rest disappears. I used
sp_helplinkedsrvlogin, which still does NOT show the rest. Is this a bug?
Can anyone help?
Thank you!
Hi
Is this a SQL 7 instance linked to SQL 2000 or vice versa? Which version of
EM are you using to do this?
Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
John
"Min" <Min@.discussions.microsoft.com> wrote in message
news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
>I have 2 questions.
> 1. Can I map a local NT group (not a user) to a remote login (SQL
> account)?
> (local server is SQL7, remote server is SQL 2K)
> 2. I kept add new login mappings from the security tab. Then I clicked OK
> and closed it. No error messages. Next time when I opened the tab, it only
> shows the first mapping I did. The rest disappears. I used
> sp_helplinkedsrvlogin, which still does NOT show the rest. Is this a bug?
> Can anyone help?
> Thank you!
>
|||Local server is sql 7. linked server is sql 2k. I checked the version of the
EM, which is 8.0
"John Bell" wrote:

> Hi
> Is this a SQL 7 instance linked to SQL 2000 or vice versa? Which version of
> EM are you using to do this?
> Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
> John
> "Min" <Min@.discussions.microsoft.com> wrote in message
> news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
>
>
|||Yes. I can use sp_addlinkedsrvlogin to add login, although EM still did not
show it. If I add thru EM, it will only show the first mapping. Even
sp_helplinkedsrvlogin will not show it. I have done test to prove that the
mapping was added. However neither thru EM or SP, I can see it.

> Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
> John
> "Min" <Min@.discussions.microsoft.com> wrote in message
> news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
>
>
|||Hi
You may want to check on a system that has the SQL 7 tools.
John
"Min" <Min@.discussions.microsoft.com> wrote in message
news:7290F8F4-58AD-4FFC-A4B6-E9600767D23C@.microsoft.com...[vbcol=seagreen]
> Yes. I can use sp_addlinkedsrvlogin to add login, although EM still did
> not
> show it. If I add thru EM, it will only show the first mapping. Even
> sp_helplinkedsrvlogin will not show it. I have done test to prove that the
> mapping was added. However neither thru EM or SP, I can see it.
|||Thanks! I will check. Do you know the asnwer to my first question?
1. Can I map a local NT group (not a user) to a remote login (SQL account)?
(local server is SQL7, remote server is SQL 2K)
Thanks again.
"John Bell" wrote:

> Hi
> You may want to check on a system that has the SQL 7 tools.
> John
> "Min" <Min@.discussions.microsoft.com> wrote in message
> news:7290F8F4-58AD-4FFC-A4B6-E9600767D23C@.microsoft.com...
>
>
|||Hi
You should be able to do this, but I don't have a system I can check it on!
In general my preference is to use NT groups wherever possible then when a
new user comes along it is part of the NT administration to set them up
(without touching the databases!).
John
"Min" <Min@.discussions.microsoft.com> wrote in message
news:80ACE6F9-9F60-471C-8E2C-A1A2D3E47534@.microsoft.com...[vbcol=seagreen]
> Thanks! I will check. Do you know the asnwer to my first question?
> 1. Can I map a local NT group (not a user) to a remote login (SQL
> account)?
> (local server is SQL7, remote server is SQL 2K)
> Thanks again.
> "John Bell" wrote:
|||Thanks for the reply. I tried. It was mapped OK but did not work. A user
belongs to the NT group connects to the remote server as the generic account
I have (which is for everyone not in the mapping table). After couple tests,
it seems that I can only map a NT user to a remote SQL account.
"John Bell" wrote:

> Hi
> You should be able to do this, but I don't have a system I can check it on!
> In general my preference is to use NT groups wherever possible then when a
> new user comes along it is part of the NT administration to set them up
> (without touching the databases!).
> John
> "Min" <Min@.discussions.microsoft.com> wrote in message
> news:80ACE6F9-9F60-471C-8E2C-A1A2D3E47534@.microsoft.com...
>
>

Repost - Linked server security - Help!

I have 2 questions.
1. Can I map a local NT group (not a user) to a remote login (SQL account)?
(local server is SQL7, remote server is SQL 2K)
2. I kept add new login mappings from the security tab. Then I clicked OK
and closed it. No error messages. Next time when I opened the tab, it only
shows the first mapping I did. The rest disappears. I used
sp_helplinkedsrvlogin, which still does NOT show the rest. Is this a bug?
Can anyone help?
Thank you!Hi
Is this a SQL 7 instance linked to SQL 2000 or vice versa? Which version of
EM are you using to do this?
Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
John
"Min" <Min@.discussions.microsoft.com> wrote in message
news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
>I have 2 questions.
> 1. Can I map a local NT group (not a user) to a remote login (SQL
> account)?
> (local server is SQL7, remote server is SQL 2K)
> 2. I kept add new login mappings from the security tab. Then I clicked OK
> and closed it. No error messages. Next time when I opened the tab, it only
> shows the first mapping I did. The rest disappears. I used
> sp_helplinkedsrvlogin, which still does NOT show the rest. Is this a bug?
> Can anyone help?
> Thank you!
>|||Local server is sql 7. linked server is sql 2k. I checked the version of the
EM, which is 8.0
"John Bell" wrote:
> Hi
> Is this a SQL 7 instance linked to SQL 2000 or vice versa? Which version of
> EM are you using to do this?
> Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
> John
> "Min" <Min@.discussions.microsoft.com> wrote in message
> news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
> >I have 2 questions.
> >
> > 1. Can I map a local NT group (not a user) to a remote login (SQL
> > account)?
> > (local server is SQL7, remote server is SQL 2K)
> >
> > 2. I kept add new login mappings from the security tab. Then I clicked OK
> > and closed it. No error messages. Next time when I opened the tab, it only
> > shows the first mapping I did. The rest disappears. I used
> > sp_helplinkedsrvlogin, which still does NOT show the rest. Is this a bug?
> >
> > Can anyone help?
> >
> > Thank you!
> >
>
>|||Yes. I can use sp_addlinkedsrvlogin to add login, although EM still did not
show it. If I add thru EM, it will only show the first mapping. Even
sp_helplinkedsrvlogin will not show it. I have done test to prove that the
mapping was added. However neither thru EM or SP, I can see it.
> Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
> John
> "Min" <Min@.discussions.microsoft.com> wrote in message
> news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
> >I have 2 questions.
> >
> > 1. Can I map a local NT group (not a user) to a remote login (SQL
> > account)?
> > (local server is SQL7, remote server is SQL 2K)
> >
> > 2. I kept add new login mappings from the security tab. Then I clicked OK
> > and closed it. No error messages. Next time when I opened the tab, it only
> > shows the first mapping I did. The rest disappears. I used
> > sp_helplinkedsrvlogin, which still does NOT show the rest. Is this a bug?
> >
> > Can anyone help?
> >
> > Thank you!
> >
>
>|||Hi
You may want to check on a system that has the SQL 7 tools.
John
"Min" <Min@.discussions.microsoft.com> wrote in message
news:7290F8F4-58AD-4FFC-A4B6-E9600767D23C@.microsoft.com...
> Yes. I can use sp_addlinkedsrvlogin to add login, although EM still did
> not
> show it. If I add thru EM, it will only show the first mapping. Even
> sp_helplinkedsrvlogin will not show it. I have done test to prove that the
> mapping was added. However neither thru EM or SP, I can see it.
>> Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
>> John
>> "Min" <Min@.discussions.microsoft.com> wrote in message
>> news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
>> >I have 2 questions.
>> >
>> > 1. Can I map a local NT group (not a user) to a remote login (SQL
>> > account)?
>> > (local server is SQL7, remote server is SQL 2K)
>> >
>> > 2. I kept add new login mappings from the security tab. Then I clicked
>> > OK
>> > and closed it. No error messages. Next time when I opened the tab, it
>> > only
>> > shows the first mapping I did. The rest disappears. I used
>> > sp_helplinkedsrvlogin, which still does NOT show the rest. Is this a
>> > bug?
>> >
>> > Can anyone help?
>> >
>> > Thank you!
>> >
>>|||Thanks! I will check. Do you know the asnwer to my first question?
1. Can I map a local NT group (not a user) to a remote login (SQL account)?
(local server is SQL7, remote server is SQL 2K)
Thanks again.
"John Bell" wrote:
> Hi
> You may want to check on a system that has the SQL 7 tools.
> John
> "Min" <Min@.discussions.microsoft.com> wrote in message
> news:7290F8F4-58AD-4FFC-A4B6-E9600767D23C@.microsoft.com...
> > Yes. I can use sp_addlinkedsrvlogin to add login, although EM still did
> > not
> > show it. If I add thru EM, it will only show the first mapping. Even
> > sp_helplinkedsrvlogin will not show it. I have done test to prove that the
> > mapping was added. However neither thru EM or SP, I can see it.
> >
> >> Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
> >>
> >> John
> >>
> >> "Min" <Min@.discussions.microsoft.com> wrote in message
> >> news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
> >> >I have 2 questions.
> >> >
> >> > 1. Can I map a local NT group (not a user) to a remote login (SQL
> >> > account)?
> >> > (local server is SQL7, remote server is SQL 2K)
> >> >
> >> > 2. I kept add new login mappings from the security tab. Then I clicked
> >> > OK
> >> > and closed it. No error messages. Next time when I opened the tab, it
> >> > only
> >> > shows the first mapping I did. The rest disappears. I used
> >> > sp_helplinkedsrvlogin, which still does NOT show the rest. Is this a
> >> > bug?
> >> >
> >> > Can anyone help?
> >> >
> >> > Thank you!
> >> >
> >>
> >>
> >>
>
>|||Hi
You should be able to do this, but I don't have a system I can check it on!
In general my preference is to use NT groups wherever possible then when a
new user comes along it is part of the NT administration to set them up
(without touching the databases!).
John
"Min" <Min@.discussions.microsoft.com> wrote in message
news:80ACE6F9-9F60-471C-8E2C-A1A2D3E47534@.microsoft.com...
> Thanks! I will check. Do you know the asnwer to my first question?
> 1. Can I map a local NT group (not a user) to a remote login (SQL
> account)?
> (local server is SQL7, remote server is SQL 2K)
> Thanks again.
> "John Bell" wrote:
>> Hi
>> You may want to check on a system that has the SQL 7 tools.
>> John
>> "Min" <Min@.discussions.microsoft.com> wrote in message
>> news:7290F8F4-58AD-4FFC-A4B6-E9600767D23C@.microsoft.com...
>> > Yes. I can use sp_addlinkedsrvlogin to add login, although EM still did
>> > not
>> > show it. If I add thru EM, it will only show the first mapping. Even
>> > sp_helplinkedsrvlogin will not show it. I have done test to prove that
>> > the
>> > mapping was added. However neither thru EM or SP, I can see it.
>> >
>> >> Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
>> >>
>> >> John
>> >>
>> >> "Min" <Min@.discussions.microsoft.com> wrote in message
>> >> news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
>> >> >I have 2 questions.
>> >> >
>> >> > 1. Can I map a local NT group (not a user) to a remote login (SQL
>> >> > account)?
>> >> > (local server is SQL7, remote server is SQL 2K)
>> >> >
>> >> > 2. I kept add new login mappings from the security tab. Then I
>> >> > clicked
>> >> > OK
>> >> > and closed it. No error messages. Next time when I opened the tab,
>> >> > it
>> >> > only
>> >> > shows the first mapping I did. The rest disappears. I used
>> >> > sp_helplinkedsrvlogin, which still does NOT show the rest. Is this a
>> >> > bug?
>> >> >
>> >> > Can anyone help?
>> >> >
>> >> > Thank you!
>> >> >
>> >>
>> >>
>> >>
>>|||Thanks for the reply. I tried. It was mapped OK but did not work. A user
belongs to the NT group connects to the remote server as the generic account
I have (which is for everyone not in the mapping table). After couple tests,
it seems that I can only map a NT user to a remote SQL account.
"John Bell" wrote:
> Hi
> You should be able to do this, but I don't have a system I can check it on!
> In general my preference is to use NT groups wherever possible then when a
> new user comes along it is part of the NT administration to set them up
> (without touching the databases!).
> John
> "Min" <Min@.discussions.microsoft.com> wrote in message
> news:80ACE6F9-9F60-471C-8E2C-A1A2D3E47534@.microsoft.com...
> > Thanks! I will check. Do you know the asnwer to my first question?
> >
> > 1. Can I map a local NT group (not a user) to a remote login (SQL
> > account)?
> > (local server is SQL7, remote server is SQL 2K)
> >
> > Thanks again.
> >
> > "John Bell" wrote:
> >
> >> Hi
> >>
> >> You may want to check on a system that has the SQL 7 tools.
> >>
> >> John
> >>
> >> "Min" <Min@.discussions.microsoft.com> wrote in message
> >> news:7290F8F4-58AD-4FFC-A4B6-E9600767D23C@.microsoft.com...
> >> > Yes. I can use sp_addlinkedsrvlogin to add login, although EM still did
> >> > not
> >> > show it. If I add thru EM, it will only show the first mapping. Even
> >> > sp_helplinkedsrvlogin will not show it. I have done test to prove that
> >> > the
> >> > mapping was added. However neither thru EM or SP, I can see it.
> >> >
> >> >> Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
> >> >>
> >> >> John
> >> >>
> >> >> "Min" <Min@.discussions.microsoft.com> wrote in message
> >> >> news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
> >> >> >I have 2 questions.
> >> >> >
> >> >> > 1. Can I map a local NT group (not a user) to a remote login (SQL
> >> >> > account)?
> >> >> > (local server is SQL7, remote server is SQL 2K)
> >> >> >
> >> >> > 2. I kept add new login mappings from the security tab. Then I
> >> >> > clicked
> >> >> > OK
> >> >> > and closed it. No error messages. Next time when I opened the tab,
> >> >> > it
> >> >> > only
> >> >> > shows the first mapping I did. The rest disappears. I used
> >> >> > sp_helplinkedsrvlogin, which still does NOT show the rest. Is this a
> >> >> > bug?
> >> >> >
> >> >> > Can anyone help?
> >> >> >
> >> >> > Thank you!
> >> >> >
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>

Repost - Linked server security - Help!

I have 2 questions.
1. Can I map a local NT group (not a user) to a remote login (SQL account)?
(local server is SQL7, remote server is SQL 2K)
2. I kept add new login mappings from the security tab. Then I clicked OK
and closed it. No error messages. Next time when I opened the tab, it only
shows the first mapping I did. The rest disappears. I used
sp_helplinkedsrvlogin, which still does NOT show the rest. Is this a bug?
Can anyone help?
Thank you!Hi
Is this a SQL 7 instance linked to SQL 2000 or vice versa? Which version of
EM are you using to do this?
Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
John
"Min" <Min@.discussions.microsoft.com> wrote in message
news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
>I have 2 questions.
> 1. Can I map a local NT group (not a user) to a remote login (SQL
> account)?
> (local server is SQL7, remote server is SQL 2K)
> 2. I kept add new login mappings from the security tab. Then I clicked OK
> and closed it. No error messages. Next time when I opened the tab, it only
> shows the first mapping I did. The rest disappears. I used
> sp_helplinkedsrvlogin, which still does NOT show the rest. Is this a bug?
> Can anyone help?
> Thank you!
>|||Local server is sql 7. linked server is sql 2k. I checked the version of the
EM, which is 8.0
"John Bell" wrote:

> Hi
> Is this a SQL 7 instance linked to SQL 2000 or vice versa? Which version o
f
> EM are you using to do this?
> Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
> John
> "Min" <Min@.discussions.microsoft.com> wrote in message
> news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
>
>|||Yes. I can use sp_addlinkedsrvlogin to add login, although EM still did not
show it. If I add thru EM, it will only show the first mapping. Even
sp_helplinkedsrvlogin will not show it. I have done test to prove that the
mapping was added. However neither thru EM or SP, I can see it.

> Can you use Query Analyser (sp_addlinkedsrvlogin) to add this login?
> John
> "Min" <Min@.discussions.microsoft.com> wrote in message
> news:97B19B1E-B858-4433-8642-F9DE841DB341@.microsoft.com...
>
>|||Hi
You may want to check on a system that has the SQL 7 tools.
John
"Min" <Min@.discussions.microsoft.com> wrote in message
news:7290F8F4-58AD-4FFC-A4B6-E9600767D23C@.microsoft.com...[vbcol=seagreen]
> Yes. I can use sp_addlinkedsrvlogin to add login, although EM still did
> not
> show it. If I add thru EM, it will only show the first mapping. Even
> sp_helplinkedsrvlogin will not show it. I have done test to prove that the
> mapping was added. However neither thru EM or SP, I can see it.
>|||Thanks! I will check. Do you know the asnwer to my first question?
1. Can I map a local NT group (not a user) to a remote login (SQL account)?
(local server is SQL7, remote server is SQL 2K)
Thanks again.
"John Bell" wrote:

> Hi
> You may want to check on a system that has the SQL 7 tools.
> John
> "Min" <Min@.discussions.microsoft.com> wrote in message
> news:7290F8F4-58AD-4FFC-A4B6-E9600767D23C@.microsoft.com...
>
>|||Hi
You should be able to do this, but I don't have a system I can check it on!
In general my preference is to use NT groups wherever possible then when a
new user comes along it is part of the NT administration to set them up
(without touching the databases!).
John
"Min" <Min@.discussions.microsoft.com> wrote in message
news:80ACE6F9-9F60-471C-8E2C-A1A2D3E47534@.microsoft.com...[vbcol=seagreen]
> Thanks! I will check. Do you know the asnwer to my first question?
> 1. Can I map a local NT group (not a user) to a remote login (SQL
> account)?
> (local server is SQL7, remote server is SQL 2K)
> Thanks again.
> "John Bell" wrote:
>|||Thanks for the reply. I tried. It was mapped OK but did not work. A user
belongs to the NT group connects to the remote server as the generic account
I have (which is for everyone not in the mapping table). After couple tests,
it seems that I can only map a NT user to a remote SQL account.
"John Bell" wrote:

> Hi
> You should be able to do this, but I don't have a system I can check it on
!
> In general my preference is to use NT groups wherever possible then when a
> new user comes along it is part of the NT administration to set them up
> (without touching the databases!).
> John
> "Min" <Min@.discussions.microsoft.com> wrote in message
> news:80ACE6F9-9F60-471C-8E2C-A1A2D3E47534@.microsoft.com...
>
>