Showing posts with label system. Show all posts
Showing posts with label system. Show all posts

Tuesday, March 27, 2012

can we delete NT AUTHORITY\SYSTEM in sql server 2005?

Hi Folks,
In our sql server 2005 cluster server, we have a loginuser called
NT AUTHORITY\SYSTEM with sysadmin server role.
What is the purpose of that account?
Can we delete that login?
If we delete that will there be any problems?
We are using separate domain accounts for all sql services.
Please help.
Thank you
--KumarKumar,
Visit following link:
http://support.microsoft.com/kb/263712
NT AUTHORITY\SYSTEM restricts NT ADMIN and help to execute FullText as
FullText need builtin\administrators or NT AUTHORITY\SYSTEM.
Hope this will help.
"Kumar" wrote:
> Hi Folks,
> In our sql server 2005 cluster server, we have a loginuser called
> NT AUTHORITY\SYSTEM with sysadmin server role.
> What is the purpose of that account?
> Can we delete that login?
> If we delete that will there be any problems?
> We are using separate domain accounts for all sql services.
> Please help.
> Thank you
> --Kumarsql

Sunday, March 25, 2012

Can We assign DataSet object to Object Type

Hi Friends,

I am having a Package scope variable DS of type system.object .In the Script Component which accept this variable as ReadWrite type I am Making the following assignment.

Public Overrides Sub PostExecute()

Variables.DsReport = DsReport // DsReport is a Data Set Object Created and Populated inside the script Component

End Sub

I am getting error while doing this sort of assignment.

Please help me to solve this problem

Regards,

Mahe

Which error do you get?

-Tom

Can we alter system views in SQL Server 2005?

Hi, all experts here,

Thank you for your kind attention.

Would please anyoneh ere give me any advices about if we can alter system views in SQL Server 2005 ?

With best regards,

modifying system objects is no longer allowed in sql2k5...|||Can you let us know of your scenario which requires you to alter the system views ?|||

Hi, Asvin,

Thank you very much for your kind attention.

The original reason for me to wonder if it is possible to alter system objects was that since in SQL Server 2005 we got a INFORMATION_SCHEMA.COLUMNS view which collects the information about all the columns within the database, but what I think will be helpful is the description for the columns. Since I am currently having a large database with up to serveral hundred tables which got a large number of columns without any explanation for what are those columns about, as a result, it's been very difficult to understand the whole database to have further analysis based on it.

If database designer could put description for each column within the database, and at the same time add a column_descpription column into the INFORMATION_SCHEMA.COLUMNS within the system view, it will be very helpful for other users rather than database designers to understand the data well.

Hope my explanation above clear what my question is and thank you very much in advance for your further advices and guidance.

With best regards,

Yours sincerely,

|||

If that is your intent I would suggest that you add extended properties on the table columns. Take a look at this feature at http://msdn2.microsoft.com/en-us/library/ms190243.aspx.

or look it up in books online.

In short, extended properties let you add a description to any object in the database such as tables, views, schemas, columns etc.

e.g.

To add an extended property to a column of a table you could do something like

sp_addextendedproperty 'property_name','your description','schema','schema_name_of_table','table','table_name','column','column_name'

and then to retrieve it you can use the function fn_listextendedpropety or the catalog view sys.extended_properties.

select * from sys.fn_listextendedproperty('property_name','schema','schema_name_of_table','table','table_name','column','column_name') will return 'your description'.

Hope this helps and is a good starting point to solve your problem.

Please do not attempt to modify or change the system views in sql server. It will leave the database in a corrupt state.

Can we alter system views in SQL Server 2005?

Hi, all experts here,

Thank you for your kind attention.

Would please anyoneh ere give me any advices about if we can alter system views in SQL Server 2005 ?

With best regards,

modifying system objects is no longer allowed in sql2k5...|||Can you let us know of your scenario which requires you to alter the system views ?|||

Hi, Asvin,

Thank you very much for your kind attention.

The original reason for me to wonder if it is possible to alter system objects was that since in SQL Server 2005 we got a INFORMATION_SCHEMA.COLUMNS view which collects the information about all the columns within the database, but what I think will be helpful is the description for the columns. Since I am currently having a large database with up to serveral hundred tables which got a large number of columns without any explanation for what are those columns about, as a result, it's been very difficult to understand the whole database to have further analysis based on it.

If database designer could put description for each column within the database, and at the same time add a column_descpription column into the INFORMATION_SCHEMA.COLUMNS within the system view, it will be very helpful for other users rather than database designers to understand the data well.

Hope my explanation above clear what my question is and thank you very much in advance for your further advices and guidance.

With best regards,

Yours sincerely,

|||

If that is your intent I would suggest that you add extended properties on the table columns. Take a look at this feature at http://msdn2.microsoft.com/en-us/library/ms190243.aspx.

or look it up in books online.

In short, extended properties let you add a description to any object in the database such as tables, views, schemas, columns etc.

e.g.

To add an extended property to a column of a table you could do something like

sp_addextendedproperty 'property_name','your description','schema','schema_name_of_table','table','table_name','column','column_name'

and then to retrieve it you can use the function fn_listextendedpropety or the catalog view sys.extended_properties.

select * from sys.fn_listextendedproperty('property_name','schema','schema_name_of_table','table','table_name','column','column_name') will return 'your description'.

Hope this helps and is a good starting point to solve your problem.

Please do not attempt to modify or change the system views in sql server. It will leave the database in a corrupt state.

sql

Tuesday, March 20, 2012

Can this be solved with replication.

Hi,
I have 5 offices accross the US. At the HQ we have a legacy system (unix)
with customer data. I want the customer data to be replicated to the offices
SQL servers (MSDE) automatically. The legacy system does not support
replication so I was thinking of running a DTS task nightly to copy the
entire table (there is no time stamp on legacy ststem table) to a SQL server
at the HQ and then replicate but what I am not sure of is I have to truncate
the customer table from the HQ SQL Server before running the DTS task. How
would this affect the replication to the offices? I am dealing with 8000 rows
here.
A truncate table does not get replicated, so if this were your loading
strategy, it would work once and then subsequent cycles would throw a pile
of errors. However, you could accomplish this with snapshot replication as
long as you can overwrite each subscriber each night.
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:C1BE2F0C-0342-404D-B1F7-1345027F44EE@.microsoft.com...
> Hi,
> I have 5 offices accross the US. At the HQ we have a legacy system (unix)
> with customer data. I want the customer data to be replicated to the
> offices
> SQL servers (MSDE) automatically. The legacy system does not support
> replication so I was thinking of running a DTS task nightly to copy the
> entire table (there is no time stamp on legacy ststem table) to a SQL
> server
> at the HQ and then replicate but what I am not sure of is I have to
> truncate
> the customer table from the HQ SQL Server before running the DTS task. How
> would this affect the replication to the offices? I am dealing with 8000
> rows
> here.
|||How long would the snapshot take for 5 sites? Also can this be done at a
scheduled time or can I have the DTS execute the replication after the new
customer data has been imported?
Thanks
"Michael Hotek" wrote:

> A truncate table does not get replicated, so if this were your loading
> strategy, it would work once and then subsequent cycles would throw a pile
> of errors. However, you could accomplish this with snapshot replication as
> long as you can overwrite each subscriber each night.
> --
> Mike
> http://www.solidqualitylearning.com
> Disclaimer: This communication is an original work and represents my sole
> views on the subject. It does not represent the views of any other person
> or entity either by inference or direct reference.
>
> "Chris" <Chris@.discussions.microsoft.com> wrote in message
> news:C1BE2F0C-0342-404D-B1F7-1345027F44EE@.microsoft.com...
>
>
|||Both. DTS can kick it off and it can also be scheduled. As for how long,
no idea. That would depend upon thevolume of data, connectivity between
each site, amount of available network bandwidth, if the servers are doing
anything else, and lots of other factors.
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:2735F953-D4F3-41F2-A3B9-69AF71A132AF@.microsoft.com...[vbcol=seagreen]
> How long would the snapshot take for 5 sites? Also can this be done at a
> scheduled time or can I have the DTS execute the replication after the new
> customer data has been imported?
> Thanks
> "Michael Hotek" wrote:
|||8000 rows is not that much (assuming the rows are not 'extra-wide').
An snapshot for that is probably smaller than 1mb or so (depending on your
structure, of course). So, the snapshot should be built really fast, and
downloaded in a few minutes (tops).
BTW: the snapshot is taken at the publisher, and it is only one unless you
are using dynamic snapshot/filters (merge).
You can have the DTS execute the snapshot after finishing. Of course, the
data in the sites is going to be wiped out every single time you do this.
That shouldn't be a problem (since it seems to be what you want).
Jos.
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:2735F953-D4F3-41F2-A3B9-69AF71A132AF@.microsoft.com...[vbcol=seagreen]
> How long would the snapshot take for 5 sites? Also can this be done at a
> scheduled time or can I have the DTS execute the replication after the new
> customer data has been imported?
> Thanks
> "Michael Hotek" wrote:
|||In these situations, I dump the table from the foreign system into sql
(publisher) periodically, then *compare the table* to an identical,
replicated table, except for the rowguid of course, then only delete,ins,
upd are replicated
I've made generic compare sp's to handle any number of tables
"Jos Araujo" <josea@.mcrinc.com> wrote in message
news:%23sOTAz$KGHA.3424@.TK2MSFTNGP12.phx.gbl...
> 8000 rows is not that much (assuming the rows are not 'extra-wide').
> An snapshot for that is probably smaller than 1mb or so (depending on your
> structure, of course). So, the snapshot should be built really fast, and
> downloaded in a few minutes (tops).
> BTW: the snapshot is taken at the publisher, and it is only one unless you
> are using dynamic snapshot/filters (merge).
> You can have the DTS execute the snapshot after finishing. Of course, the
> data in the sites is going to be wiped out every single time you do this.
> That shouldn't be a problem (since it seems to be what you want).
> Jos.
> "Chris" <Chris@.discussions.microsoft.com> wrote in message
> news:2735F953-D4F3-41F2-A3B9-69AF71A132AF@.microsoft.com...
>
|||Thanks lads!
"Chris" wrote:

> Hi,
> I have 5 offices accross the US. At the HQ we have a legacy system (unix)
> with customer data. I want the customer data to be replicated to the offices
> SQL servers (MSDE) automatically. The legacy system does not support
> replication so I was thinking of running a DTS task nightly to copy the
> entire table (there is no time stamp on legacy ststem table) to a SQL server
> at the HQ and then replicate but what I am not sure of is I have to truncate
> the customer table from the HQ SQL Server before running the DTS task. How
> would this affect the replication to the offices? I am dealing with 8000 rows
> here.
|||Hi,
The Snapshot replications works fine. Thanks again!
"Chris" wrote:

> Hi,
> I have 5 offices accross the US. At the HQ we have a legacy system (unix)
> with customer data. I want the customer data to be replicated to the offices
> SQL servers (MSDE) automatically. The legacy system does not support
> replication so I was thinking of running a DTS task nightly to copy the
> entire table (there is no time stamp on legacy ststem table) to a SQL server
> at the HQ and then replicate but what I am not sure of is I have to truncate
> the customer table from the HQ SQL Server before running the DTS task. How
> would this affect the replication to the offices? I am dealing with 8000 rows
> here.
|||Hi,
How do I set snapshot to overwrite the the subscriber? Or this does
automatically?
Thanks
"Michael Hotek" wrote:

> A truncate table does not get replicated, so if this were your loading
> strategy, it would work once and then subsequent cycles would throw a pile
> of errors. However, you could accomplish this with snapshot replication as
> long as you can overwrite each subscriber each night.
> --
> Mike
> http://www.solidqualitylearning.com
> Disclaimer: This communication is an original work and represents my sole
> views on the subject. It does not represent the views of any other person
> or entity either by inference or direct reference.
>
> "Chris" <Chris@.discussions.microsoft.com> wrote in message
> news:C1BE2F0C-0342-404D-B1F7-1345027F44EE@.microsoft.com...
>
>

Thursday, March 8, 2012

Can SQL Server7.0 be installed in XP Professional O/S

I would appreciate to know, Is it possibale to install
SQL Server7.0 or 2000 Server Components in XP Professioal
operating system. I have SP1 installed.
I want both the Server and Client components to be
installed on the same machine running XP Professional. Is
there any way...please let me know.
Thanks,
Sivatechnically, yes. it is however crippled. I had installed it (SQL2000) on my
laptop to test at home but it is missing some managment utils and you will
be limited to 10 connections inbound. it's not useful though and really just
drags you system down. (not worth the license).
Neil MacMurchy
"Siva" <vssivakumar33@.yahoo.com> wrote in message
news:1b4c01c3fc0f$0b876f00$a301280a@.phx.gbl...
> I would appreciate to know, Is it possibale to install
> SQL Server7.0 or 2000 Server Components in XP Professioal
> operating system. I have SP1 installed.
> I want both the Server and Client components to be
> installed on the same machine running XP Professional. Is
> there any way...please let me know.
> Thanks,
> Siva|||Hi Siva.
Yes - they can, as long as you're installing the correct EDITION of SQL
Server for XP.
There's a list of which editions can be installed on which O/Ss here:
http://www.microsoft.com/sql/evaluation/sysreqs/2000/default.asp
Short answer though is that you probably want Developer Edition if you're
developing databases, stored procs etc. It is cheap too - approx $50 I
believe..
HTH
Regards,
Greg Linwood
SQL Server MVP
"Siva" <vssivakumar33@.yahoo.com> wrote in message
news:1b4c01c3fc0f$0b876f00$a301280a@.phx.gbl...
> I would appreciate to know, Is it possibale to install
> SQL Server7.0 or 2000 Server Components in XP Professioal
> operating system. I have SP1 installed.
> I want both the Server and Client components to be
> installed on the same machine running XP Professional. Is
> there any way...please let me know.
> Thanks,
> Siva

Can SQL Server7.0 be installed in XP Professional O/S

I would appreciate to know, Is it possibale to install
SQL Server7.0 or 2000 Server Components in XP Professioal
operating system. I have SP1 installed.
I want both the Server and Client components to be
installed on the same machine running XP Professional. Is
there any way...please let me know.
Thanks,
Sivatechnically, yes. it is however crippled. I had installed it (SQL2000) on my
laptop to test at home but it is missing some managment utils and you will
be limited to 10 connections inbound. it's not useful though and really just
drags you system down. (not worth the license).
Neil MacMurchy
"Siva" <vssivakumar33@.yahoo.com> wrote in message
news:1b4c01c3fc0f$0b876f00$a301280a@.phx.gbl...
> I would appreciate to know, Is it possibale to install
> SQL Server7.0 or 2000 Server Components in XP Professioal
> operating system. I have SP1 installed.
> I want both the Server and Client components to be
> installed on the same machine running XP Professional. Is
> there any way...please let me know.
> Thanks,
> Siva|||Hi Siva.
Yes - they can, as long as you're installing the correct EDITION of SQL
Server for XP.
There's a list of which editions can be installed on which O/Ss here:
http://www.microsoft.com/sql/evalua...000/default.asp
Short answer though is that you probably want Developer Edition if you're
developing databases, stored procs etc. It is cheap too - approx $50 I
believe..
HTH
Regards,
Greg Linwood
SQL Server MVP
"Siva" <vssivakumar33@.yahoo.com> wrote in message
news:1b4c01c3fc0f$0b876f00$a301280a@.phx.gbl...
> I would appreciate to know, Is it possibale to install
> SQL Server7.0 or 2000 Server Components in XP Professioal
> operating system. I have SP1 installed.
> I want both the Server and Client components to be
> installed on the same machine running XP Professional. Is
> there any way...please let me know.
> Thanks,
> Siva

can sql server allow to read record ramdomly?

anyone have the solution or work around?

my system need to select x% ramdom record from a batch of data from sql server for validation. is this posible?

any sql statement allow to select the record ramdomly? let say total record is around 1000, example record that i need to select is:-

record no 5,48,49,50,147,148,256,257,258,411,412,413,414,415,..... so and so

can i use cursor to move around the record to read it?

if we view on performance of the system. how can i make this at max speed? is that clone this table into local access database will make this more faster?

regards

terence chua

How do you intend to use this data ? If you won't display it in tabular form, you could read the entire DataTable, then use random number generation to access different rows in random order ?

|||

actually this is a system to receive customer feedback.

and now i want to basic on the total transaction to take out the % of transaction to collect customer contact information. then i will create a new contact list to allow the system to send out sms to customer to say thanks and request them to reply. just to make sure the customer did feedback to us but not our own staff key in the feedback.

this sms list will also be a report to show to top management. regarding how many sms we send out everyday.

regard

terence chua

|||

You can use TABLESAMPLE (nnn PERCENT) or TABLESAMPLE (nnn ROWS) in your SELECT statement. But be carefully - TABLESAMPLE extracts not exactly nnn percent or nnn rows, i.e. two executions of, for example, 'select * from Person.Contact tablesample (10 percent)' will have thow different rowcounts. See BOL for details.

WBR, Evergray -- Words mean nothing...|||

YOu could use something like this:

SELECT TOP 10 *

FROM

SomeTable

Order by NEWID()

HTH, jens Suessmeyer.

|||

Yes, this kind of query will return exactly specified number of records, but by cost of performance (in common case). Query with 'tablesample' will read random number of table pages (and, yeah, may even return 0 records or double expected count) while query with 'order by newid()' should scan entire table or index and compute newid() for each record to properly sort them and select top(n). The second type of queries may be better (in performance) only with highly selective (or covered) queries with appropriate indexes for support them (and, again, always more accurate :-)). Or, if table has an 'uniqueidentifier' or 'rowguid' column (indexed) - this is may be case, too.

If the main goal is performance of such a query (as I've understand from the first post), and the query is not very selective and not covered by any index, the choice is tablesampling. Inaccuracy of this clause may be eliminated by doing tablesampling twice (or more), for example:

select top 10 percent * from
(select * from sometable
tablesample (10 percent)
where x=y
union
select * from sometable
tablesample (10 percent)
where x=y
) a

will be more accurate with percentage than one sample. Anyway, you should compare performance of queries of both types to select the better one for your needs.

This data may be used to fill out temporary table (directly or by using table variable - the last will be better choice) to process it on server side (sms via Database Mail?). But, if you doing processing in an external application, sure you can (maybe even should) extract data from server in any store which is local for that application so server will be free from take a care of it.

Good luck!

WBR, Evergray
--
Words mean nothing...|||Hi Everygray,
what your mean is using more then 1 time tablesampling to make sure the record more accurate?
to make sure what i understand is correct in ur sample, "a" is temporary table? is the "tablesample(10 percent)" is the syntax for the query?
below is the code for single tablesampling?
--
select * from sometable
tablesample (10 percent)
where x=y
--
so let say my table name call "Answers" then my query should be like this?
select top 30 percent * from
(select * from Answers
tablesample (10 percent)
where date >= yesterday
union
select * from Answers
tablesample (10 percent)
where date >= yesterday
) a
now my system should able to take out the contact information and pass to external system to process and send out the sms. so the output should be in either .txt or .dat file or something else like .xml.
btw are you having any better idea or better way to done the job with sms the data directly out to my customer phone without export the data out? because now my company planing to corporate with a communication provided company to send out sms. so them may request the customer list in a txt, dat or xml file. tat's y i looking for the solution now before my management want it to be implement.
regards
terence chua
|||

Terence Chua wrote:

Hi Everygray,

what your mean is using more then 1 time tablesampling to make sure the record more accurate?

see below...

Terence Chua wrote:


to make sure what i understand is correct in ur sample, "a" is temporary table?

No, it's called 'derived table' (named subquery)

Terence Chua wrote:

is the "tablesample(10 percent)" is the syntax for the query?

below is the code for single tablesampling?
--
select * from sometable
tablesample (10 percent)
where x=y
--


Yes

Terence Chua wrote:

so let say my table name call "Answers" then my query should be like this?

select top 30 percent * from
(select * from Answers
tablesample (10 percent)
where date >= yesterday
union
select * from Answers
tablesample (10 percent)
where date >= yesterday
) a


Ok, maybe I've been not clear enough about sampling. Tablesample reads random number of PAGES, not ROWS. If you specify "tablesample (10 percent)" in your query, server will randomly select approximately 10 percent of pages on which table data is stored (let's say, 10 of 100 total) and return ALL rows from each selected page. If your table is big enough and rows are evenly distributed on data pages, resulting count of rows will be close to 10 percent. But, if, for example, your table is quite small (for example, 5 pages), 10% of total number of pages is zero, so query will result no rows at all. Or, if some of data pages in your table has small count of rows (e.g. 2-3), and some - big (e.g. 20-30), the resulting count will depend on which pages were selected (e.g. your query may return 3 rows or 300 on the same data). Or, if you specify "tablesample (10 rows)" for table which contains 300 rows at all, which are stored on 15 pages, the result again be 0 rows (10 rows from 300 are 3%, and 3% from 15 pages are 0 pages). So, if the same query executed several times against the same data returns very different results (e.g. 0, 30, 300, 100....) we may think about 'equalizing' these results. Your query above should return number of records closer to 6% of total rows than simple 'select * .. tablesample 6%'.


Terence Chua wrote:

now my system should able to take out the contact information and pass to external system to process and send out the sms. so the output should be in either .txt or .dat file or something else like .xml.

btw are you having any better idea or better way to done the job with sms the data directly out to my customer phone without export the data out? because now my company planing to corporate with a communication provided company to send out sms. so them may request the customer list in a txt, dat or xml file. tat's y i looking for the solution now before my management want it to be implement.

regards
terence chua

If number of messages to send is low, you may use sp_send_dbmail stored proc to send them through your smtp server (little emails to xxxxxxx@.mobile.operator.com or so). But this is not likely your case, because it is resource consuming task (all messages are stored in a queue on the server, mailing program executes here too), at least, you should't use the same SQL Server instance for it.

As for export - there are MANY different ways to export data in any format - using linked servers (in any external database or plaintext file), simply executing query with sqlcmd and storing results (maybe using FOR XML) in plaintext file, create webservice which will return such data in desired format to your partner and so on... Again, what the goal is? Which restrictions are? ;-)

WBR, Evergray
--
Words mean nothing...|||

Hi Evergray,

Thanks for your help, but when i try the sql statement in sql server Enterprise Manager, at the view. i get this error.

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'PERCENT'.

below is the code i test on hard code the date at 26th Jan 2006 and get the answer between a range.

SELECT TOP 30 PERCENT *
FROM (SELECT *
FROM Answers tablesample(10 PERCENT)
WHERE (iMinutes BETWEEN 570 AND 1020) AND (MONTH(dtAnswer) = 1) AND (YEAR(dtAnswer) = 2006) AND (iTemplateId = 1) AND (fDiscard = 0)
AND (fIncomplete = 0) AND (DAY(dtAnswer) = 26)
UNION
SELECT *
FROM Answers tablesample(10 PERCENT)
WHERE (iMinutes BETWEEN 570 AND 1020) AND (MONTH(dtAnswer) = 1) AND (YEAR(dtAnswer) = 2006) AND (iTemplateId = 1) AND (fDiscard = 0) AND
(fIncomplete = 0) AND (DAY(dtAnswer) = 26))

|||

The first, you should add an alias for your inner query, such as

select top 30 percent *
from (...) somealias

The second... the error message you refer to... Looks like you are using SQL Server 2000 or your database compatibility level is not 9.0, as required for tablesample to work... If this is the case, you should use Jens's suggestion because tablesampling is unavailable for you.

The third. If your Answers table has an index on dtAnswer column, you'd better use two DateTime constants and BETWEEN clause in you query rather than using these Day(), Year() etc., because your query doesn't benefit from such index, always doing fullscan of table.

WBR, Evergray
--
Words mean nothing....

Wednesday, March 7, 2012

Can SQL Server 2005 Evaluation be used to upgrade a system?

I have multiple development SQL Servers running Enterprise edition that I want to upgrade for application testing before upgrading our production system. All of the servers meet the hardware and software requirements for SQL Server 2005 Enterprise edition. However, when I try to install to use the SQL Server 2005 Evaluation Edition to upgrade the servers in place, I get the blocked upgrade message:

Name: Microsoft SQL Server 2000 Reason: Your upgrade is blocked. For more information about upgrade support, see the "Version and Edition Upgrades" and "Hardware and Software Requirements" topics in SQL Server 2005 Setup Help or SQL Server 2005 Books Online. Edition check: Your upgrade is blocked because of edition upgrade rules. For more information about edition upgrades, see the Version and Edition Upgrades topic in SQL Server 2005 Setup Help or SQL Server 2005 Books Online.

Can the Evaluation Edition be used to upgrade these servers or do you need the full blown version?

thanks

Sorry, upgrades are prohibited *to* the Eval edition.|||I am getting this error now myself and I don't know why. I installed the trial SQL Server Express for my boss. He then asked if I would install the trial SQL Server 2005 becuase it has more capabilities he would like to try out. So I installed 2005. He noticed that there was no management studio installed and needed. So I uninstalled it and am trying to reinstall it and am getting this error. I haven't even used the software yet! I don't know what to do!|||

I was able to continue the installation but just before I click OK to install, I see this in a window

The following components that you selected will not be changed:

Client Components

that might be why I had my original problem. That problem was the Management Studio was never installed which prompted me to reinstall the system alltogether thinking I must have not checked that installation option.

Ahh!!!

Can SQL Server 2005 Evaluation be used to upgrade a system?

I have multiple development SQL Servers running Enterprise edition that I want to upgrade for application testing before upgrading our production system. All of the servers meet the hardware and software requirements for SQL Server 2005 Enterprise edition. However, when I try to install to use the SQL Server 2005 Evaluation Edition to upgrade the servers in place, I get the blocked upgrade message:

Name: Microsoft SQL Server 2000

Reason: Your upgrade is blocked. For more information about upgrade support, see the "Version and Edition Upgrades" and "Hardware and Software Requirements" topics in SQL Server 2005 Setup Help or SQL Server 2005 Books Online.

Edition check:

Your upgrade is blocked because of edition upgrade rules. For more information about edition upgrades, see the Version and Edition Upgrades topic in SQL Server 2005 Setup Help or SQL Server 2005 Books Online.

Can the Evaluation Edition be used to upgrade these servers or do you need the full blown version?

thanks

Sorry, upgrades are prohibited *to* the Eval edition.|||I am getting this error now myself and I don't know why. I installed the trial SQL Server Express for my boss. He then asked if I would install the trial SQL Server 2005 becuase it has more capabilities he would like to try out. So I installed 2005. He noticed that there was no management studio installed and needed. So I uninstalled it and am trying to reinstall it and am getting this error. I haven't even used the software yet! I don't know what to do!|||

I was able to continue the installation but just before I click OK to install, I see this in a window

The following components that you selected will not be changed:

Client Components

that might be why I had my original problem. That problem was the Management Studio was never installed which prompted me to reinstall the system alltogether thinking I must have not checked that installation option.

Ahh!!!

Can SQL find duplicates within a "range" of numbers?

We have an SQL server and keep records of paper numbers used. Our system pulls from a table of available numbers.

The fields are: LOW, HIGH, NEXT, CLOSED.

LOW = the low number in the paper batch.
HIGH = the high number in the paper batch.
NEXT = the next number. Auto-increments when we print.
CLOSED = Batch is closed when NEXT equals HIGH. No more paper avail.

We want to be able to check if there are any duplicates when adding a new row. If we have a LOW of 10 and HIGH of 50 with an ENDING of 30, and we want to add a new row, what SQL statement can be written to check if there are no numbers BETWEEN 10 and 50 for LOW or HIGH? There are no physical rows to show these numbers.

I know how to check if 10 or 50 exists, but i need to know how to get every number in between and check them.

Thanks,
EricSample data and desired results, please.|||Data:

LOCATION BEG# END# NEXT# OPEN?
CENTRAL 23515518 23515525 23515525 N
CENTRAL 23515620 23515635 23515635 N
CENTRAL 23515670 23515676 23515676 N
CENTRAL 23515714 23515716 23515716 N
CENTRAL 23515849 23515853 23515853 N
CENTRAL 23516034 23516046 23516046 N
CENTRAL 23516289 23516294 23516294 N
CENTRAL 23516555 23516562 23516562 N
CENTRAL 23516646 23516650 23516651 N

Output from query: I just want to know if a row exists. So, something like

DIM DUPLICATE
DUPLICATE = (Select ROWID from TABLE where BEG# "is already used")

Then I would say if DUPLICATE <> 0 then msgbox "You have entered number which has already been used"

The part where I am stuck is the "is already used" in the select statement.|||SELECT Beg FROM Table As 't' WHERE Beg = (SELECT Beg FROM Table WHERE Beg = t.Beg)

HHmm, that doesn't look right... Someone correct me please :)|||You're mixing terminology. So my first question is whether LOW = Begin and HIGH = End? Also, you are using "BEG#" in multiple contexts.

I believe you just want to do regular interval overlap tests, right? The following query assumes that "start" is the begin of the interval that should not overlap with any other interval in the table, and "stop" is the end of that interval. If you are only interested in a single value, you have a point interval, i.e. start = stop. The assumption is that we have always start <= stop and begin <= end.

SELECT COUNT(*)
FROM yourTable AS n
WHERE n.begin <= stop AND n.end >= start

If the query returns a value largen than 0, you have an overlap. Alternatively, you can use "SELECT *" or whatever.

Note: there is no ROWID in your table and standardized SQL doesn't define such a constructor. That's why you can't use this in general - only on your specific DBMS.

For point intervals, you could actually write this as well:

SELECT ...
FROM yourTable AS n
WHERE point BETWEEN n.beg AND n.end

Friday, February 24, 2012

can someone login as "NT AUTHORITY\SYSTEM "

Using SS2000 SP4. Can someone login as either NT AUTHORITY\SYSTEM or NT
AUTHORITY\NETWORK SERVICE? I'm trying to figure out how someone got access to
one of our servers. I log both the failed and successful logins and both of
the above logins were used recently. Do they have passwords that can be set?
What would be the implications if I removed both of them from
"security/logins"? I'm running both the server service and agent service with
a different login so it wouldn't affect the jobs.
Thanks,
Dan D.
Hi Dan
These are the name of the accounts when you specify local system or network
service as the accounts in which a service runs under see
http://msdn2.microsoft.com/en-us/library/ms191543.aspx
John
"Dan D." wrote:

> Using SS2000 SP4. Can someone login as either NT AUTHORITY\SYSTEM or NT
> AUTHORITY\NETWORK SERVICE? I'm trying to figure out how someone got access to
> one of our servers. I log both the failed and successful logins and both of
> the above logins were used recently. Do they have passwords that can be set?
> What would be the implications if I removed both of them from
> "security/logins"? I'm running both the server service and agent service with
> a different login so it wouldn't affect the jobs.
> Thanks,
> --
> Dan D.
|||I came across an article today about how someone could log in as NT AUTHORITY
through the cmd window using the task scheduler and I got a little concerned.
Thanks for the article.
Dan D.
"John Bell" wrote:
[vbcol=seagreen]
> Hi Dan
> These are the name of the accounts when you specify local system or network
> service as the accounts in which a service runs under see
> http://msdn2.microsoft.com/en-us/library/ms191543.aspx
> John
> "Dan D." wrote:
|||Hi Dan
Could you can post a link to the article?
John
"Dan D." wrote:
[vbcol=seagreen]
> I came across an article today about how someone could log in as NT AUTHORITY
> through the cmd window using the task scheduler and I got a little concerned.
> Thanks for the article.
> --
> Dan D.
>
> "John Bell" wrote:
|||Sometimes the page doesn't render correctly. You may have to scroll down to
see the beginning of the article.
http://www.ozzu.com/ftopic1337.html
Dan D.
"John Bell" wrote:
[vbcol=seagreen]
> Hi Dan
> Could you can post a link to the article?
> John
> "Dan D." wrote:
|||Hi Dan
The article is talking about a vunerability highlighted in
http://support.microsoft.com/?kbid=823980 that can be exploited by a specific
worm, rather than something actually logging in a the account. You should
make sure that your system is patched to a level which does not have this
issue. Tools like Microsoft Baseline Security Advisor will help you configure
your systems check out http://msdn2.microsoft.com/en-us/library/aa302360.aspx
John
"Dan D." wrote:
[vbcol=seagreen]
> Sometimes the page doesn't render correctly. You may have to scroll down to
> see the beginning of the article.
> http://www.ozzu.com/ftopic1337.html
> --
> Dan D.
>
> "John Bell" wrote:
|||Thanks. I do run the Baseline Security Analyzer.
Dan D.
"John Bell" wrote:
[vbcol=seagreen]
> Hi Dan
> The article is talking about a vunerability highlighted in
> http://support.microsoft.com/?kbid=823980 that can be exploited by a specific
> worm, rather than something actually logging in a the account. You should
> make sure that your system is patched to a level which does not have this
> issue. Tools like Microsoft Baseline Security Advisor will help you configure
> your systems check out http://msdn2.microsoft.com/en-us/library/aa302360.aspx
> John
> "Dan D." wrote:
|||Hi Dan
Hopefully you have patched this, make sure that you keep your MBSA up to date.
John
"Dan D." wrote:
[vbcol=seagreen]
> Thanks. I do run the Baseline Security Analyzer.
> --
> Dan D.
>
> "John Bell" wrote:

can someone login as "NT AUTHORITY\SYSTEM "

Using SS2000 SP4. Can someone login as either NT AUTHORITY\SYSTEM or NT
AUTHORITY\NETWORK SERVICE? I'm trying to figure out how someone got access to
one of our servers. I log both the failed and successful logins and both of
the above logins were used recently. Do they have passwords that can be set?
What would be the implications if I removed both of them from
"security/logins"? I'm running both the server service and agent service with
a different login so it wouldn't affect the jobs.
Thanks,
--
Dan D.Hi Dan
These are the name of the accounts when you specify local system or network
service as the accounts in which a service runs under see
http://msdn2.microsoft.com/en-us/library/ms191543.aspx
John
"Dan D." wrote:
> Using SS2000 SP4. Can someone login as either NT AUTHORITY\SYSTEM or NT
> AUTHORITY\NETWORK SERVICE? I'm trying to figure out how someone got access to
> one of our servers. I log both the failed and successful logins and both of
> the above logins were used recently. Do they have passwords that can be set?
> What would be the implications if I removed both of them from
> "security/logins"? I'm running both the server service and agent service with
> a different login so it wouldn't affect the jobs.
> Thanks,
> --
> Dan D.|||I came across an article today about how someone could log in as NT AUTHORITY
through the cmd window using the task scheduler and I got a little concerned.
Thanks for the article.
--
Dan D.
"John Bell" wrote:
> Hi Dan
> These are the name of the accounts when you specify local system or network
> service as the accounts in which a service runs under see
> http://msdn2.microsoft.com/en-us/library/ms191543.aspx
> John
> "Dan D." wrote:
> > Using SS2000 SP4. Can someone login as either NT AUTHORITY\SYSTEM or NT
> > AUTHORITY\NETWORK SERVICE? I'm trying to figure out how someone got access to
> > one of our servers. I log both the failed and successful logins and both of
> > the above logins were used recently. Do they have passwords that can be set?
> >
> > What would be the implications if I removed both of them from
> > "security/logins"? I'm running both the server service and agent service with
> > a different login so it wouldn't affect the jobs.
> >
> > Thanks,
> > --
> > Dan D.|||Hi Dan
Could you can post a link to the article?
John
"Dan D." wrote:
> I came across an article today about how someone could log in as NT AUTHORITY
> through the cmd window using the task scheduler and I got a little concerned.
> Thanks for the article.
> --
> Dan D.
>
> "John Bell" wrote:
> > Hi Dan
> >
> > These are the name of the accounts when you specify local system or network
> > service as the accounts in which a service runs under see
> > http://msdn2.microsoft.com/en-us/library/ms191543.aspx
> >
> > John
> >
> > "Dan D." wrote:
> >
> > > Using SS2000 SP4. Can someone login as either NT AUTHORITY\SYSTEM or NT
> > > AUTHORITY\NETWORK SERVICE? I'm trying to figure out how someone got access to
> > > one of our servers. I log both the failed and successful logins and both of
> > > the above logins were used recently. Do they have passwords that can be set?
> > >
> > > What would be the implications if I removed both of them from
> > > "security/logins"? I'm running both the server service and agent service with
> > > a different login so it wouldn't affect the jobs.
> > >
> > > Thanks,
> > > --
> > > Dan D.|||Sometimes the page doesn't render correctly. You may have to scroll down to
see the beginning of the article.
http://www.ozzu.com/ftopic1337.html
--
Dan D.
"John Bell" wrote:
> Hi Dan
> Could you can post a link to the article?
> John
> "Dan D." wrote:
> > I came across an article today about how someone could log in as NT AUTHORITY
> > through the cmd window using the task scheduler and I got a little concerned.
> > Thanks for the article.
> > --
> > Dan D.
> >
> >
> > "John Bell" wrote:
> >
> > > Hi Dan
> > >
> > > These are the name of the accounts when you specify local system or network
> > > service as the accounts in which a service runs under see
> > > http://msdn2.microsoft.com/en-us/library/ms191543.aspx
> > >
> > > John
> > >
> > > "Dan D." wrote:
> > >
> > > > Using SS2000 SP4. Can someone login as either NT AUTHORITY\SYSTEM or NT
> > > > AUTHORITY\NETWORK SERVICE? I'm trying to figure out how someone got access to
> > > > one of our servers. I log both the failed and successful logins and both of
> > > > the above logins were used recently. Do they have passwords that can be set?
> > > >
> > > > What would be the implications if I removed both of them from
> > > > "security/logins"? I'm running both the server service and agent service with
> > > > a different login so it wouldn't affect the jobs.
> > > >
> > > > Thanks,
> > > > --
> > > > Dan D.|||Hi Dan
The article is talking about a vunerability highlighted in
http://support.microsoft.com/?kbid=823980 that can be exploited by a specific
worm, rather than something actually logging in a the account. You should
make sure that your system is patched to a level which does not have this
issue. Tools like Microsoft Baseline Security Advisor will help you configure
your systems check out http://msdn2.microsoft.com/en-us/library/aa302360.aspx
John
"Dan D." wrote:
> Sometimes the page doesn't render correctly. You may have to scroll down to
> see the beginning of the article.
> http://www.ozzu.com/ftopic1337.html
> --
> Dan D.
>
> "John Bell" wrote:
> > Hi Dan
> >
> > Could you can post a link to the article?
> >
> > John
> >
> > "Dan D." wrote:
> >
> > > I came across an article today about how someone could log in as NT AUTHORITY
> > > through the cmd window using the task scheduler and I got a little concerned.
> > > Thanks for the article.
> > > --
> > > Dan D.
> > >
> > >
> > > "John Bell" wrote:
> > >
> > > > Hi Dan
> > > >
> > > > These are the name of the accounts when you specify local system or network
> > > > service as the accounts in which a service runs under see
> > > > http://msdn2.microsoft.com/en-us/library/ms191543.aspx
> > > >
> > > > John
> > > >
> > > > "Dan D." wrote:
> > > >
> > > > > Using SS2000 SP4. Can someone login as either NT AUTHORITY\SYSTEM or NT
> > > > > AUTHORITY\NETWORK SERVICE? I'm trying to figure out how someone got access to
> > > > > one of our servers. I log both the failed and successful logins and both of
> > > > > the above logins were used recently. Do they have passwords that can be set?
> > > > >
> > > > > What would be the implications if I removed both of them from
> > > > > "security/logins"? I'm running both the server service and agent service with
> > > > > a different login so it wouldn't affect the jobs.
> > > > >
> > > > > Thanks,
> > > > > --
> > > > > Dan D.|||Thanks. I do run the Baseline Security Analyzer.
--
Dan D.
"John Bell" wrote:
> Hi Dan
> The article is talking about a vunerability highlighted in
> http://support.microsoft.com/?kbid=823980 that can be exploited by a specific
> worm, rather than something actually logging in a the account. You should
> make sure that your system is patched to a level which does not have this
> issue. Tools like Microsoft Baseline Security Advisor will help you configure
> your systems check out http://msdn2.microsoft.com/en-us/library/aa302360.aspx
> John
> "Dan D." wrote:
> > Sometimes the page doesn't render correctly. You may have to scroll down to
> > see the beginning of the article.
> >
> > http://www.ozzu.com/ftopic1337.html
> >
> > --
> > Dan D.
> >
> >
> > "John Bell" wrote:
> >
> > > Hi Dan
> > >
> > > Could you can post a link to the article?
> > >
> > > John
> > >
> > > "Dan D." wrote:
> > >
> > > > I came across an article today about how someone could log in as NT AUTHORITY
> > > > through the cmd window using the task scheduler and I got a little concerned.
> > > > Thanks for the article.
> > > > --
> > > > Dan D.
> > > >
> > > >
> > > > "John Bell" wrote:
> > > >
> > > > > Hi Dan
> > > > >
> > > > > These are the name of the accounts when you specify local system or network
> > > > > service as the accounts in which a service runs under see
> > > > > http://msdn2.microsoft.com/en-us/library/ms191543.aspx
> > > > >
> > > > > John
> > > > >
> > > > > "Dan D." wrote:
> > > > >
> > > > > > Using SS2000 SP4. Can someone login as either NT AUTHORITY\SYSTEM or NT
> > > > > > AUTHORITY\NETWORK SERVICE? I'm trying to figure out how someone got access to
> > > > > > one of our servers. I log both the failed and successful logins and both of
> > > > > > the above logins were used recently. Do they have passwords that can be set?
> > > > > >
> > > > > > What would be the implications if I removed both of them from
> > > > > > "security/logins"? I'm running both the server service and agent service with
> > > > > > a different login so it wouldn't affect the jobs.
> > > > > >
> > > > > > Thanks,
> > > > > > --
> > > > > > Dan D.|||Hi Dan
Hopefully you have patched this, make sure that you keep your MBSA up to date.
John
"Dan D." wrote:
> Thanks. I do run the Baseline Security Analyzer.
> --
> Dan D.
>
> "John Bell" wrote:
> > Hi Dan
> >
> > The article is talking about a vunerability highlighted in
> > http://support.microsoft.com/?kbid=823980 that can be exploited by a specific
> > worm, rather than something actually logging in a the account. You should
> > make sure that your system is patched to a level which does not have this
> > issue. Tools like Microsoft Baseline Security Advisor will help you configure
> > your systems check out http://msdn2.microsoft.com/en-us/library/aa302360.aspx
> >
> > John
> >
> > "Dan D." wrote:
> >
> > > Sometimes the page doesn't render correctly. You may have to scroll down to
> > > see the beginning of the article.
> > >
> > > http://www.ozzu.com/ftopic1337.html
> > >
> > > --
> > > Dan D.
> > >
> > >
> > > "John Bell" wrote:
> > >
> > > > Hi Dan
> > > >
> > > > Could you can post a link to the article?
> > > >
> > > > John
> > > >
> > > > "Dan D." wrote:
> > > >
> > > > > I came across an article today about how someone could log in as NT AUTHORITY
> > > > > through the cmd window using the task scheduler and I got a little concerned.
> > > > > Thanks for the article.
> > > > > --
> > > > > Dan D.
> > > > >
> > > > >
> > > > > "John Bell" wrote:
> > > > >
> > > > > > Hi Dan
> > > > > >
> > > > > > These are the name of the accounts when you specify local system or network
> > > > > > service as the accounts in which a service runs under see
> > > > > > http://msdn2.microsoft.com/en-us/library/ms191543.aspx
> > > > > >
> > > > > > John
> > > > > >
> > > > > > "Dan D." wrote:
> > > > > >
> > > > > > > Using SS2000 SP4. Can someone login as either NT AUTHORITY\SYSTEM or NT
> > > > > > > AUTHORITY\NETWORK SERVICE? I'm trying to figure out how someone got access to
> > > > > > > one of our servers. I log both the failed and successful logins and both of
> > > > > > > the above logins were used recently. Do they have passwords that can be set?
> > > > > > >
> > > > > > > What would be the implications if I removed both of them from
> > > > > > > "security/logins"? I'm running both the server service and agent service with
> > > > > > > a different login so it wouldn't affect the jobs.
> > > > > > >
> > > > > > > Thanks,
> > > > > > > --
> > > > > > > Dan D.

can someone login as "NT AUTHORITY\SYSTEM "

Using SS2000 SP4. Can someone login as either NT AUTHORITY\SYSTEM or NT
AUTHORITY\NETWORK SERVICE? I'm trying to figure out how someone got access t
o
one of our servers. I log both the failed and successful logins and both of
the above logins were used recently. Do they have passwords that can be set?
What would be the implications if I removed both of them from
"security/logins"? I'm running both the server service and agent service wit
h
a different login so it wouldn't affect the jobs.
Thanks,
--
Dan D.Hi Dan
These are the name of the accounts when you specify local system or network
service as the accounts in which a service runs under see
http://msdn2.microsoft.com/en-us/library/ms191543.aspx
John
"Dan D." wrote:

> Using SS2000 SP4. Can someone login as either NT AUTHORITY\SYSTEM or NT
> AUTHORITY\NETWORK SERVICE? I'm trying to figure out how someone got access
to
> one of our servers. I log both the failed and successful logins and both o
f
> the above logins were used recently. Do they have passwords that can be se
t?
> What would be the implications if I removed both of them from
> "security/logins"? I'm running both the server service and agent service w
ith
> a different login so it wouldn't affect the jobs.
> Thanks,
> --
> Dan D.|||I came across an article today about how someone could log in as NT AUTHORIT
Y
through the cmd window using the task scheduler and I got a little concerned
.
Thanks for the article.
--
Dan D.
"John Bell" wrote:
[vbcol=seagreen]
> Hi Dan
> These are the name of the accounts when you specify local system or networ
k
> service as the accounts in which a service runs under see
> http://msdn2.microsoft.com/en-us/library/ms191543.aspx
> John
> "Dan D." wrote:
>|||Hi Dan
Could you can post a link to the article?
John
"Dan D." wrote:
[vbcol=seagreen]
> I came across an article today about how someone could log in as NT AUTHOR
ITY
> through the cmd window using the task scheduler and I got a little concern
ed.
> Thanks for the article.
> --
> Dan D.
>
> "John Bell" wrote:
>|||Sometimes the page doesn't render correctly. You may have to scroll down to
see the beginning of the article.
http://www.ozzu.com/ftopic1337.html
Dan D.
"John Bell" wrote:
[vbcol=seagreen]
> Hi Dan
> Could you can post a link to the article?
> John
> "Dan D." wrote:
>|||Hi Dan
The article is talking about a vunerability highlighted in
http://support.microsoft.com/?kbid=823980 that can be exploited by a specifi
c
worm, rather than something actually logging in a the account. You should
make sure that your system is patched to a level which does not have this
issue. Tools like Microsoft Baseline Security Advisor will help you configur
e
your systems check out [url]http://msdn2.microsoft.com/en-us/library/aa302360.aspx[/url
]
John
"Dan D." wrote:
[vbcol=seagreen]
> Sometimes the page doesn't render correctly. You may have to scroll down t
o
> see the beginning of the article.
> http://www.ozzu.com/ftopic1337.html
> --
> Dan D.
>
> "John Bell" wrote:
>|||Thanks. I do run the Baseline Security Analyzer.
--
Dan D.
"John Bell" wrote:
[vbcol=seagreen]
> Hi Dan
> The article is talking about a vunerability highlighted in
> http://support.microsoft.com/?kbid=823980 that can be exploited by a speci
fic
> worm, rather than something actually logging in a the account. You should
> make sure that your system is patched to a level which does not have this
> issue. Tools like Microsoft Baseline Security Advisor will help you config
ure
> your systems check out [url]http://msdn2.microsoft.com/en-us/library/aa302360.aspx[/u
rl]
> John
> "Dan D." wrote:
>|||Hi Dan
Hopefully you have patched this, make sure that you keep your MBSA up to dat
e.
John
"Dan D." wrote:
[vbcol=seagreen]
> Thanks. I do run the Baseline Security Analyzer.
> --
> Dan D.
>
> "John Bell" wrote:
>

Sunday, February 19, 2012

Can SA be dropped

Is it possible at all to remove the SA login or deny "System Administrator" from it by loggin as another user who has sa previledges
thanksno

Set a password like

asdf09asdgjlag70agraeur

Save it and put it in a safe...

and use the other id that's set as sysadmin

Tuesday, February 14, 2012

Can only see system tables

Hello,

I have created a linked server XYZ that is linked to server ABC. I am tying to view the tables via XYZ but I'm unable to do so. I can only see the system tables. When I run a select statement, I get the correct results. That means I have the access to the tables, yet why am I not able to see the tables.

Please assist

That highly depends on the type of linked server you are accessing. Which server are you accessing ?

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

Can not Update in DataGrid - C#

Here is my code :

string connstring = System.Configuration.ConfigurationSettings.AppSettings["myconn"];
string selectquery = "Select * from nhacungcap";
protected System.Web.UI.WebControls.DataGrid DataGrid1;
string insertquery = "Insert into nhacungcap(mancc,tenncc,diachi,dienthoai) values(@.mancc1,@.tenncc1,@.diachi1,@.dienthoai1)";

string updatequery = "Update nhacungcap set mancc=@.mancc, tenncc=@.tenncc, diachi=@.diachi, dienthoai=@.dienthoai where (mancc=@.mancc)";
myconnection.Open();

SqlCommand updatecommand = new SqlCommand(updatequery,myconnection);
// sua truong mancc
updatecommand.Parameters.Add(new SqlParameter("@.mancc",SqlDbType.VarChar,10));
updatecommand.Parameters["@.mancc"].Value = DataGrid1.DataKeys[e.Item.ItemIndex];

// sua truong tenncc
updatecommand.Parameters.Add(new SqlParameter("@.tenncc",SqlDbType.NVarChar,50));
updatecommand.Parameters["@.tenncc"].Value = ((TextBox) e.Item.Cells[3].Controls[0]).Text;
// sua truong diachi
updatecommand.Parameters.Add(new SqlParameter("@.diachi",SqlDbType.NVarChar,200));
updatecommand.Parameters["@.diachi"].Value = ((TextBox) e.Item.Cells[4].Controls[0]).Text;
// sua truong dienthoai
updatecommand.Parameters.Add(new SqlParameter("@.dienthoai",SqlDbType.Char,10));
updatecommand.Parameters["@.dienthoai"].Value = ((TextBox) e.Item.Cells[5].Controls[0]).Text;
// kiem tra lenh thuc thi
int result1 = updatecommand.ExecuteNonQuery();
myconnection.Close();
// dieu kien kiem tra
if (result1 > 0 )
{
lbcheck.Text = "C?p Nh?t Thành công !";
}
// hien thi du lieu
hienthidulieu();

And my error appear, when I edit value in datagrid, I only update all value fields, without value@.mancc .Hu hu hu, I don't know what i must do with it.

help me please

Sunday, February 12, 2012

can not remove rowguid currently replicated

After losing my publishing server, I re-built on a new server.
The databases had replication remnants so I ran cleanup scripts
(Replication system Objects, indexes and rowguids)
I then re-built replication
I find that I have a column (rowguid) left over that I can not remove.
The error message is "Can not Alter table, ... rowguid currently replicated"
how do I remove this column?
Haven't seen this error personally, but please have a look at the solutions
proposed in this thread for some ideas to take advantage of:
http://www.webservertalk.com/showthread.php?t=902849
HTH,
Paul Ibison
|||Hi Paul;
This is what I have done so far
Problem:
Open EM
Open Agency Table
Delete Column
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]
ALTER TABLE DROP COLUMN failed because 'rowguid' is currently replicated.
Approaches:
Drop replicated column - sp_repldropcolumn
Drop subscription - sp_dropsubscription
drop publication - sp_droppublication
disable publishing and distributor - sp_removedbreplication
exec sp_repldropcolumn @.source_object = 'Agency'
, @.column = 'rowguid'
, @.force_reinit_subscription = 1
Server: Msg 21246, Level 16, State 1, Procedure sp_repldropcolumn, Line 212
This step failed because table 'Agency' is not part of any publication.
sp_dropsubscription @.publication = 'IsoprepArchive'
, @.subscriber = 'SQLDEV'
, @.destination_db = 'Archivedisopreps'
sp_droppublication @.publication = 'IsoprepArchive'
exec sp_removedbreplication 'Isoprep'
-- Unmark table for replication
SELECT 'exec sp_MSUnmarkReplInfo ' + '''' + Name + '''' + Char(13)
+ ' GO ' + Char(13)
+ 'ALTER TABLE ' + Name + CHAR(13)
+ 'DROP CONSTRAINT DF_' + Name + '_rowguid' + Char(13)
+ ' GO ' + CHAR(13)
+ 'ALTER TABLE ' + Name + CHAR(13)
+ 'DROP COLUMN ROWGUID' + Char(13)
+ ' GO ' + Char(13) + Char(13)
FROM sysobjects
WHERE xtype = 'U'
-- return replinfo flag
SELECT 'Print ' + '''' + Name + '''' + Char(13) + ' GO '
+ Char(13)
+ 'SELECT replinfo' + Char(13)
+ 'FROM sysobjects' + Char(13)
+ ' WHERE name = ' + '''' + name + '''' + Char(13)
FROM sysobjects
WHERE xtype = 'U'

exec sp_MSUnmarkReplInfo 'ErrorLog'
GO
ALTER TABLE ErrorLog
DROP CONSTRAINT DF_ErrorLog_rowguid
GO
ALTER TABLE ErrorLog
DROP COLUMN ROWGUID
GO
Warning: The table 'ErrorLog' has been created but its maximum row size
(9416)
exceeds the maximum number of bytes per row (8060).
INSERT or UPDATE of a row in this table will fail if the resulting row
length exceeds 8060 bytes.
Server: Msg 4932, Level 16, State 1, Line 1
ALTER TABLE DROP COLUMN failed because 'ROWGUID' is currently replicated.
Warning: The table 'ErrorLog' has been created but its maximum row size
(9416)
exceeds the maximum number of bytes per row (8060).
INSERT or UPDATE of a row in this table will fail if the resulting row
length exceeds 8060 bytes.
Thanks
MJS
"Paul Ibison" wrote:

> Haven't seen this error personally, but please have a look at the solutions
> proposed in this thread for some ideas to take advantage of:
> http://www.webservertalk.com/showthread.php?t=902849
> HTH,
> Paul Ibison
>
|||Quite By Accident, I found the following:
open EM
Open Design view of table
open constraint tab
Look for replication constraints
I found a constraint that looked like:
"repl_identity_range_sub_B0BB3703_3C1D_4648_9DCA_B F47DE69E485"
execute the following to build an alter table statement that will
remove the constraints.
SELECT 'ALTER TABLE ' + U.name + CHAR(13)
+ 'DROP CONSTRAINT ' + C.name + CHAR(13)
+ CHAR(13) + 'GO' + CHAR(13)
FROM sysobjects C
, sysobjects U
WHERE C.parent_Obj = U.Id
AND C.xtype = 'C'
AND C.name like 'repl_identity_range_sub_%'
Thanks
MJ
"mj" wrote:
[vbcol=seagreen]
> Hi Paul;
> This is what I have done so far
> Problem:
> Open EM
> Open Agency Table
> Delete Column
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]
> ALTER TABLE DROP COLUMN failed because 'rowguid' is currently replicated.
> Approaches:
> Drop replicated column - sp_repldropcolumn
> Drop subscription - sp_dropsubscription
> drop publication - sp_droppublication
> disable publishing and distributor - sp_removedbreplication
>
> exec sp_repldropcolumn @.source_object = 'Agency'
> , @.column = 'rowguid'
> , @.force_reinit_subscription = 1
> Server: Msg 21246, Level 16, State 1, Procedure sp_repldropcolumn, Line 212
> This step failed because table 'Agency' is not part of any publication.
> sp_dropsubscription @.publication = 'IsoprepArchive'
> , @.subscriber = 'SQLDEV'
> , @.destination_db = 'Archivedisopreps'
> sp_droppublication @.publication = 'IsoprepArchive'
> exec sp_removedbreplication 'Isoprep'
> -- Unmark table for replication
> SELECT 'exec sp_MSUnmarkReplInfo ' + '''' + Name + '''' + Char(13)
> + ' GO ' + Char(13)
> + 'ALTER TABLE ' + Name + CHAR(13)
> + 'DROP CONSTRAINT DF_' + Name + '_rowguid' + Char(13)
> + ' GO ' + CHAR(13)
> + 'ALTER TABLE ' + Name + CHAR(13)
> + 'DROP COLUMN ROWGUID' + Char(13)
> + ' GO ' + Char(13) + Char(13)
> FROM sysobjects
> WHERE xtype = 'U'
> -- return replinfo flag
> SELECT 'Print ' + '''' + Name + '''' + Char(13) + ' GO '
> + Char(13)
> + 'SELECT replinfo' + Char(13)
> + 'FROM sysobjects' + Char(13)
> + ' WHERE name = ' + '''' + name + '''' + Char(13)
> FROM sysobjects
> WHERE xtype = 'U'
>
> ----
> exec sp_MSUnmarkReplInfo 'ErrorLog'
> GO
> ALTER TABLE ErrorLog
> DROP CONSTRAINT DF_ErrorLog_rowguid
> GO
> ALTER TABLE ErrorLog
> DROP COLUMN ROWGUID
> GO
> Warning: The table 'ErrorLog' has been created but its maximum row size
> (9416)
> exceeds the maximum number of bytes per row (8060).
> INSERT or UPDATE of a row in this table will fail if the resulting row
> length exceeds 8060 bytes.
> Server: Msg 4932, Level 16, State 1, Line 1
> ALTER TABLE DROP COLUMN failed because 'ROWGUID' is currently replicated.
> Warning: The table 'ErrorLog' has been created but its maximum row size
> (9416)
> exceeds the maximum number of bytes per row (8060).
> INSERT or UPDATE of a row in this table will fail if the resulting row
> length exceeds 8060 bytes.
>
> Thanks
> MJS
> ----
> "Paul Ibison" wrote: