Friday, March 30, 2012
Newbie question on replication failiure
Replication to a MS-access database fails last week.
It has always been working, but now I get this message:
DISTRIBUTION AGENT ERROR
Error : The process could not connect to Subscriber 'MAB-EC-NW'.
Error information: Microsoft JET Database Engine (number = -534709256)
The Microsoft Jet database engine cannot open the file
'\\Server\Ok2\MA\SQL-SERVER\MABDAT-EC.mdb'. It is already opened
exclusively by another user, or you need permission to view its data.
I am working on a single server with 1 SQL-database:
I does replication to a MS-Access dababase on the server.
The SQL-server (2000) is running on a NT-server.
It seems to me that the problem is could be caused by 2 reasons:
a lock by another user: but ik can open the file MABDAT-EC.mdb' using
MS-Access.
a problem with the permissions on the server, but what kind of permissions
and where to check.
SQL-server is new to me, and I just started my job in this company, so all
help I can get is welcome.
Thank in advance.
Johan
Hi Johan
Pls check the user permission in the sql server users tab.
Regards
Nirvan Biswas
"Johan" wrote:
> Hi,
>
> Replication to a MS-access database fails last week.
> It has always been working, but now I get this message:
>
> DISTRIBUTION AGENT ERROR
> Error : The process could not connect to Subscriber 'MAB-EC-NW'.
>
> Error information: Microsoft JET Database Engine (number = -534709256)
>
> The Microsoft Jet database engine cannot open the file
> '\\Server\Ok2\MA\SQL-SERVER\MABDAT-EC.mdb'. It is already opened
> exclusively by another user, or you need permission to view its data.
>
> I am working on a single server with 1 SQL-database:
> I does replication to a MS-Access dababase on the server.
> The SQL-server (2000) is running on a NT-server.
>
> It seems to me that the problem is could be caused by 2 reasons:
> a lock by another user: but ik can open the file MABDAT-EC.mdb' using
> MS-Access.
> a problem with the permissions on the server, but what kind of permissions
> and where to check.
>
> SQL-server is new to me, and I just started my job in this company, so all
> help I can get is welcome.
>
> Thank in advance.
> Johan
>
>
>
|||Nirvan,
Thanks for the reply,
The problem seems to be that the administrator password was changed on the
server.
When removing the password from the administrator account on the server (NT)
replication does work. When a password is set on the administrator account,
replication fails, so it seems that authentation is the problem.
After changing the administrator password on the server, SQL-server didn't
start up. So i temporary removed the administrator password to start
SQL-server and placed the password back.
Where do I have to make changes in SQL interprise manager, to solve the
problem with the administrator password?
Regards
Johan
"Nirvan Biswas" <yourdisplayname@.discussions.microsoft.com> schreef in
bericht news:642517C8-9614-4706-9256-4345DFBCA58A@.microsoft.com...[vbcol=seagreen]
> Hi Johan
>
> Pls check the user permission in the sql server users tab.
> Regards
> Nirvan Biswas
> "Johan" wrote:
permissions[vbcol=seagreen]
all[vbcol=seagreen]
Monday, March 26, 2012
Newbie Question
Hi
I'm working with SQL Express, and this is my first experience with DB, so I'm still learning. I made a rather stupid mistake, and I'm not quite sure how to get out of it. In the process of trying to fix a problem, I changed the default DB in my account to one that it can no longer connect to - for a reason unknown to me. (once I get this cleared up, I'll ask about that.) Now I can't login properly to SQL Express, b/c it can't connect properly.
please help
thanx
Jeffery
hi,
yiu should be able to connect via a system administrator login, bot WinNT trusted authenticated (login in in Windows as a local administrator) or standard SQL Server authenticated (if you enabled mixed security) providing sa login's credentials (userid and password)...
once you connect to SQLExpress, you can modify (via SSMSX) the default database property of the faling login object in the general tab or, executing the
ALTER LOGIN login_name
WITH DEFAULT_DATABASE = new_default_db;
Transact-SQL statement..
regards
|||Thanx...Duh! - to me - I should have thought of creating another local Admin account.
Thanx - it worked.
Friday, March 23, 2012
Newbie Question
architect never got it working correctly, so he turned off the second node
and just left it running of the primary. We've been having reporting errors
in our application so I checked to see if everything was up-to-date and the
SQL Installation was still at the RTM level, no SPs at all (no wonder he had
problems). Because it's the end of the year and we needed to fix the problem
ASAP I evicted the second node and ran SP3a on the primary node to get our
reports on time.
Now what I'd like to do is set the thing up correctly, but am unsure of how
to approach bringing the evicted node back online as a failover node and get
it up to SP3a.
I'd be happy to hire an expert for a few hours if one of you MVPs lives in
Southern California, or wants to do a conference call and thinks that my
situation is too messed up to fix via newsgroup. If there is a good book I
can read on SQL clustering I'd like to hear about that as well.
Thanks.
Patrick Rouse
Microsoft MVP - Terminal Server
http://www.workthin.com
I think I may have found my answer here?
http://www.microsoft.com/windowsserv...5-d622b5b61369
&mid=8665605b-5a16-452f-8183-02b06b312b7f
"Patrick Rouse" wrote:
> I inherited a 2000 Advanced Server SQL 2000 Ent, Active-Passive setup. The
> architect never got it working correctly, so he turned off the second node
> and just left it running of the primary. We've been having reporting errors
> in our application so I checked to see if everything was up-to-date and the
> SQL Installation was still at the RTM level, no SPs at all (no wonder he had
> problems). Because it's the end of the year and we needed to fix the problem
> ASAP I evicted the second node and ran SP3a on the primary node to get our
> reports on time.
> Now what I'd like to do is set the thing up correctly, but am unsure of how
> to approach bringing the evicted node back online as a failover node and get
> it up to SP3a.
> I'd be happy to hire an expert for a few hours if one of you MVPs lives in
> Southern California, or wants to do a conference call and thinks that my
> situation is too messed up to fix via newsgroup. If there is a good book I
> can read on SQL clustering I'd like to hear about that as well.
> Thanks.
> --
> Patrick Rouse
> Microsoft MVP - Terminal Server
> http://www.workthin.com
|||Yep.. That is the correct procedure. See 'Maintaining a Failover Cluster'
in BOL for a detailed version. Pretend your second node has failed
completely.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Patrick Rouse" <PatrickRouse@.discussions.microsoft.com> wrote in message
news:12DFE27E-534D-4B31-94B3-03E15EFD3AA9@.microsoft.com...
> I think I may have found my answer here?
>
http://www.microsoft.com/windowsserv...5-d622b5b61369
&mid=8665605b-5a16-452f-8183-02b06b312b7f[vbcol=seagreen]
>
> "Patrick Rouse" wrote:
The[vbcol=seagreen]
node[vbcol=seagreen]
errors[vbcol=seagreen]
the[vbcol=seagreen]
had[vbcol=seagreen]
problem[vbcol=seagreen]
our[vbcol=seagreen]
how[vbcol=seagreen]
get[vbcol=seagreen]
in[vbcol=seagreen]
book I[vbcol=seagreen]
Newbie question
The question is how to accomplish that number 1 is shown like this 0001
(with zeros in front) in the databse.
Thanks.
That's really a job for the front-end. However, you can try:
select
replace (str (MyCol, 4), ' ', '0')
from
MyTable
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
..
"Morx" <morx@.gawab.com> wrote in message news:cgche5$lv4$1@.ls219.htnet.hr...
I have built a database and VB.net app and it's working great...
The question is how to accomplish that number 1 is shown like this 0001
(with zeros in front) in the databse.
Thanks.
Newbie question
The question is how to accomplish that number 1 is shown like this 0001
(with zeros in front) in the databse.
Thanks.That's really a job for the front-end. However, you can try:
select
replace (str (MyCol, 4), ' ', '0')
from
MyTable
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
.
"Morx" <morx@.gawab.com> wrote in message news:cgche5$lv4$1@.ls219.htnet.hr...
I have built a database and VB.net app and it's working great...
The question is how to accomplish that number 1 is shown like this 0001
(with zeros in front) in the databse.
Thanks.
Newbie question
The question is how to accomplish that number 1 is shown like this 0001
(with zeros in front) in the databse.
Thanks.That's really a job for the front-end. However, you can try:
select
replace (str (MyCol, 4), ' ', '0')
from
MyTable
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
.
"Morx" <morx@.gawab.com> wrote in message news:cgche5$lv4$1@.ls219.htnet.hr...
I have built a database and VB.net app and it's working great...
The question is how to accomplish that number 1 is shown like this 0001
(with zeros in front) in the databse.
Thanks.sql
Monday, March 19, 2012
Newbie Needs Help ;)
I'm new to replication. I have got a subscriber, publisher
ans distributer working ok, so now does the snapshot
replication, then the transactional ones.
It was working fine for 5 minutes then I had the following
error
Cannot update identity column 'ID'.
{CALL sp_MSupd_tblPerson
(NULL,0,NULL,NULL,NULL,NULL,NULL,' ',1,0,7146,0x82
03)}
ID is a primary key with an Identity setting get to 'Yes
but not for replication'.
Any pointers please
Peter
Peter,
are you using transactional with queued updating subscribers? If it is
standard transactional or transactional with updating subscribers, then on
the subscriber there should be no identity property, as the publisher will
manage the values.
Regards,
Paul Ibison
|||run this script on your subscriber.
sp_configure 'allow updates', 1
GO
reconfigure with override
GO
update syscolumns set colstat = colstat | 0x0008 where colstat & 0x0001 <> 0
and colstat & 0x0008 = 0
GO
sp_configure 'allow updates', 0
GO
reconfigure with override
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:eCvcKcGNEHA.2704@.TK2MSFTNGP10.phx.gbl...
> Peter,
> are you using transactional with queued updating subscribers? If it is
> standard transactional or transactional with updating subscribers, then on
> the subscriber there should be no identity property, as the publisher will
> manage the values.
> Regards,
> Paul Ibison
>
|||If you want to do this ( ie: keeping identify columns on the subscribers
)_INS
you can do this:sp_MSupd_tblPerson
edit
this proc:
sp_MSupd_tblPerson
and remove the case where the pk_key column is updated ( ths will never
happen anyway )
and this proc:
sp_MSins_tblPerson
add
SET IDENTITY_INSERT "sp_MSins_tblPerson" on
here, replace the insert statement with something like
insert into "tblPerson" ("col1",... ) VALUES (@.param1, ... )
SET IDENTITY_INSERT "sp_MSins_tblPerson" off
Peter wrote:
> Hello,
> I'm new to replication. I have got a subscriber, publisher
> ans distributer working ok, so now does the snapshot
> replication, then the transactional ones.
> It was working fine for 5 minutes then I had the following
> error
> Cannot update identity column 'ID'.
> {CALL sp_MSupd_tblPerson
> (NULL,0,NULL,NULL,NULL,NULL,NULL,' ',1,0,7146,0x82
> 03)}
> ID is a primary key with an Identity setting get to 'Yes
> but not for replication'.
> Any pointers please
> Peter
|||while I agree that using set identity_insert in your insert procs will solve
this problem, you would be better to partition using different seeds and
probably increments on your publisher and subscriber, and put the Not For
Replication option on your identity columns on the Subscriber.
The primary key's are sometimes updated - normally this is a sign of poor
database design, however it is the default behavior of the datagrid control.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Olivier" <olivierwarez@.netscape.net> wrote in message
news:0Xcnc.43829$zm5.21011@.nntpserver.swip.net...
> If you want to do this ( ie: keeping identify columns on the subscribers
> )_INS
> you can do this:sp_MSupd_tblPerson
> edit
> this proc:
> sp_MSupd_tblPerson
> and remove the case where the pk_key column is updated ( ths will never
> happen anyway )
> and this proc:
> sp_MSins_tblPerson
> add
> SET IDENTITY_INSERT "sp_MSins_tblPerson" on
> here, replace the insert statement with something like
> insert into "tblPerson" ("col1",... ) VALUES (@.param1, ... )
> SET IDENTITY_INSERT "sp_MSins_tblPerson" off
>
>
> Peter wrote:
>
|||
> while I agree that using set identity_insert in your insert procs will solve
> this problem, you would be better to partition using different seeds and
> probably increments on your publisher and subscriber, and put the Not For
> Replication option on your identity columns on the Subscriber.
In this case there is one publisher and one subscriber, and the 'not for
replication' is set
> The primary key's are sometimes updated - normally this is a sign of poor
> database design, however it is the default behavior of the datagrid control.
It is not possible to update the identity column. Usually the identity
column is the primary key one
By the, what does
update syscolumns set colstat = colstat | 0x0008 where colstat & 0x0001 <> 0
and colstat & 0x0008 = 0
do exactly?
Monday, March 12, 2012
newbie IIS & MS SQL connection problem ;-(
and a dsn, which is working fine in Dreamweaver. So far so good.
When I run the page on IIS I get the following:-
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database
requested in login 'MenuPlanner'. Login fails.
I think it's permissions - anyone got any clues as to where to look?
TIA
GrantBuzby wrote:
> Have successfully installed MS SQL on my Win XP Pro machine, created
tables,
> and a dsn, which is working fine in Dreamweaver. So far so good.
> When I run the page on IIS I get the following:-
> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database
> requested in login 'MenuPlanner'. Login fails.
> I think it's permissions - anyone got any clues as to where to look?
You could see if the login MenuPlanner has got permissions to the
database you are logging in to. That would be a start.
--
David Rowland
For a good user and performance monitor, check DBMonitor
http://dbmonitor.tripod.com
> TIA
> Grant|||"dbmonitor" <dbmonitor_support@.hotmail.com> wrote in message
news:1107519068.678569.226760@.o13g2000cwo.googlegr oups.com...
> Buzby wrote:
>> Have successfully installed MS SQL on my Win XP Pro machine, created
> tables,
>> and a dsn, which is working fine in Dreamweaver. So far so good.
>>
>> When I run the page on IIS I get the following:-
>>
>> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
>> [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database
>> requested in login 'MenuPlanner'. Login fails.
>>
>> I think it's permissions - anyone got any clues as to where to look?
> You could see if the login MenuPlanner has got permissions to the
> database you are logging in to. That would be a start.
This is what has got me - permissions are set up. I've created a dsn, which
I can run queries in Dreamweaver and filter results just fine. I'm having
trouble when running the page on my webserver (IIS which is working fine)
Stumped ;-(|||Buzby wrote:
> "dbmonitor" <dbmonitor_support@.hotmail.com> wrote in message
> news:1107519068.678569.226760@.o13g2000cwo.googlegr oups.com...
> > Buzby wrote:
> >> Have successfully installed MS SQL on my Win XP Pro machine,
created
> > tables,
> >> and a dsn, which is working fine in Dreamweaver. So far so good.
> >>
> >> When I run the page on IIS I get the following:-
> >>
> >> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
> >> [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open
database
> >> requested in login 'MenuPlanner'. Login fails.
> >>
> >> I think it's permissions - anyone got any clues as to where to
look?
> > You could see if the login MenuPlanner has got permissions to the
> > database you are logging in to. That would be a start.
> This is what has got me - permissions are set up. I've created a dsn,
which
> I can run queries in Dreamweaver and filter results just fine. I'm
having
> trouble when running the page on my webserver (IIS which is working
fine)
> Stumped ;-(
Is MenuPlanner the database name or the login name?
If it is the database name, are you connecting to the database via a
userid/password or are you connecting with Windows interactive UserID?
--
David Rowland
For a good user and performance monitor, check DBMonitor
http://dbmonitor.tripod.com|||Buzby (gb@.pumpupthe.net) writes:
> Have successfully installed MS SQL on my Win XP Pro machine, created
> tables, and a dsn, which is working fine in Dreamweaver. So far so
> good.
> When I run the page on IIS I get the following:-
> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database
> requested in login 'MenuPlanner'. Login fails.
> I think it's permissions - anyone got any clues as to where to look?
Sounds like the login has a default db which does not exist, or the login
does have access to. Use sp_helplogins to check, use sp_defaultdb to change.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||On 2/4/05 5:37 PM, in article Xns95F3F003A2514Yazorman@.127.0.0.1, "Erland
Sommarskog" <esquel@.sommarskog.se> wrote:
> Buzby (gb@.pumpupthe.net) writes:
>> Have successfully installed MS SQL on my Win XP Pro machine, created
>> tables, and a dsn, which is working fine in Dreamweaver. So far so
>> good.
>>
>> When I run the page on IIS I get the following:-
>>
>> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
>> [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database
>> requested in login 'MenuPlanner'. Login fails.
>>
>> I think it's permissions - anyone got any clues as to where to look?
> Sounds like the login has a default db which does not exist, or the login
> does have access to. Use sp_helplogins to check, use sp_defaultdb to change.
Yea, but a DSN is being used so we have to believe that MenuPlanner is the
name of the DSN Connection. I am assuming that the DSN was created on the
IIS server and connects successfully when you "test connection" in the ODBC
dialog.
I highly recommend using a DSN-less connection in your ASP pages. There is
lots of documentation on ADODB.
If you need some sample connection strings let me know.|||Gregory Dean (gdean@.datapex.com) writes:
> On 2/4/05 5:37 PM, in article Xns95F3F003A2514Yazorman@.127.0.0.1, "Erland
> Sommarskog" <esquel@.sommarskog.se> wrote:
>> Buzby (gb@.pumpupthe.net) writes:
>>> Have successfully installed MS SQL on my Win XP Pro machine, created
>>> tables, and a dsn, which is working fine in Dreamweaver. So far so
>>> good.
>>>
>>> When I run the page on IIS I get the following:-
>>>
>>> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
>>> [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database
>>> requested in login 'MenuPlanner'. Login fails.
>>>
>>> I think it's permissions - anyone got any clues as to where to look?
>>
>> Sounds like the login has a default db which does not exist, or the
>> login does have access to. Use sp_helplogins to check, use sp_defaultdb
>> to change.
> Yea, but a DSN is being used so we have to believe that MenuPlanner is
> the name of the DSN Connection. I am assuming that the DSN was created
> on the IIS server and connects successfully when you "test connection"
> in the ODBC dialog.
Not sure what you mean, but since SQL Server does not know what a DSN
is, MenuPlanner cannot be the name of the DNS. But it can be the
login name specified in the DSN.
> I highly recommend using a DSN-less connection in your ASP pages.
I echo that. DSN is a concept that I never understood the point with.
An extra layer that only causes hassle.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks one and all - it turned out it was an IIS permissions issue - however
I've taken on board what you have suggested and dsn less is the way we are
going!
Cheers
Buzby
Newbie help On Sql string form vb
I was trying the code:
SqlQuery = "SELECT TblEmpAttendance.Date, TblEmpAttendance.Value," & _
"TblEmployees.TotalPoints, TblEmployees.DaysWorked FROM TblEmployees RIGHT JOIN TblEmpAttendance ON TblEmployees.EmployeeID WHERE TblEmpAttendance.EmployeeID" & _
"= TblEmpAttendance.EmployeeID AND TblAttendance.EmployeeID=" & EmpID
Any help would be appreciated.
Thanks
-Greg S.Oops I already posted it but ill dbl chk anyhow. I got it to work using:
SqlQuery = "SELECT TblEmpAttendance.EmployeeID, TblEmpAttendance.Date, TblEmpAttendance.Value," & _
"TblEmployees.TotalPoints, TblEmployees.DaysWorked FROM TblEmployees RIGHT JOIN TblEmpAttendance ON TblEmployees.EmployeeID = TblEmpAttendance.EmployeeID WHERE TblEmployees.EmployeeID = " & EmpID
Is their anyhting that could cause problems with this statement?
Thanks
-Greg S
Wednesday, March 7, 2012
Newbie : Wharehousing Basic Question under SQL Server
Currently, I'm working on a SQL Server DWH.
I work on a snowflake Schema. Let say that I've on product table wich is
linked using a FK on a product grouping key to a product group label.
If I update my product refrential, this works but ...
in the real life, if a new product appears and if this grouping code doesn't
existing my loading fails.
Do you have any idea/tricks in order to load the into the product
referential adding dynamicly a new key into the grouping referential
(setting product group to a defalut value)
thk's in advance,
Renaud Harduin
Paris - France
<Renaud Harduin> wrote in message
news:4085820c$0$24993$afc38c87@.news.easynet.fr...
> Do you have any idea/tricks in order to load the into the product
> referential adding dynamicly a new key into the grouping referential
> (setting product group to a defalut value)
Default is the only way to solve this issue (other than properly
determining a product group at import time, which would be preferable).
Create an "Unknown" default group and set that as the default on your group
FK column.
|||Thk's
Renaud Harduin
"Adam Machanic" <amachanic@.air-worldwide.nospamallowed.com> a crit dans le
message de news:OYhbvx%23JEHA.2704@.TK2MSFTNGP10.phx.gbl...
> <Renaud Harduin> wrote in message
> news:4085820c$0$24993$afc38c87@.news.easynet.fr...
> Default is the only way to solve this issue (other than properly
> determining a product group at import time, which would be preferable).
> Create an "Unknown" default group and set that as the default on your
group
> FK column.
>
Newbie : Wharehousing Basic Question under SQL Server
Currently, I'm working on a SQL Server DWH.
I work on a snowflake Schema. Let say that I've on product table wich is
linked using a FK on a product grouping key to a product group label.
If I update my product refrential, this works but ...
in the real life, if a new product appears and if this grouping code doesn't
existing my loading fails.
Do you have any idea/tricks in order to load the into the product
referential adding dynamicly a new key into the grouping referential
(setting product group to a defalut value)
thk's in advance,
Renaud Harduin
Paris - France<Renaud Harduin> wrote in message
news:4085820c$0$24993$afc38c87@.news.easynet.fr...
> Do you have any idea/tricks in order to load the into the product
> referential adding dynamicly a new key into the grouping referential
> (setting product group to a defalut value)
Default is the only way to solve this issue (other than properly
determining a product group at import time, which would be preferable).
Create an "Unknown" default group and set that as the default on your group
FK column.|||Thk's
Renaud Harduin
"Adam Machanic" <amachanic@.air-worldwide.nospamallowed.com> a crit dans le
message de news:OYhbvx%23JEHA.2704@.TK2MSFTNGP10.phx.gbl...
> <Renaud Harduin> wrote in message
> news:4085820c$0$24993$afc38c87@.news.easynet.fr...
> Default is the only way to solve this issue (other than properly
> determining a product group at import time, which would be preferable).
> Create an "Unknown" default group and set that as the default on your
group
> FK column.
>
Newbie - Student - Help
ng the "Northwind database write the following SQL statements to be executed
against on of the tables within the "Northwind database"
a.) Alter a table and add a column
b.) Alter a table and add a constraint
c.) Alter a table and add an index
What I have so far is:
USE Northwind
ALTER TABLE Employees ADD COLUMN TerminationDate DateTime NULL
Server: Msg 156, Level 15, State 1, Line 3
I keep getting "Incorrect syntax near the keyword 'COLUMN'"
What am I doing wrong? If I can not get part 'a' then I will never get the
rest of the assignment.
Thanks in advance,
Deanna
UoP Student
deannac24@.cableone.netI am using SQL Query Analyzer
--
Deanna
UoP Student
deannac24@.cableone.net
"Deanna Cusic" <deannac24@.cableone.net> wrote in message news:11lh29913e9ngd
5@.corp.supernews.com...
I am working on an assignment that was due at midnight. The question is usi
ng the "Northwind database write the following SQL statements to be executed
against on of the tables within the "Northwind database"
a.) Alter a table and add a column
b.) Alter a table and add a constraint
c.) Alter a table and add an index
What I have so far is:
USE Northwind
ALTER TABLE Employees ADD COLUMN TerminationDate DateTime NULL
Server: Msg 156, Level 15, State 1, Line 3
I keep getting "Incorrect syntax near the keyword 'COLUMN'"
What am I doing wrong? If I can not get part 'a' then I will never get the
rest of the assignment.
Thanks in advance,
Deanna
UoP Student
deannac24@.cableone.net|||Deanna Cusic skrev:
> What I have so far is:
> USE Northwind
> ALTER TABLE Employees ADD COLUMN TerminationDate DateTime NULL
>
> Server: Msg 156, Level 15, State 1, Line 3
> I keep getting "Incorrect syntax near the keyword 'COLUMN'"
>
Have you checked Books online, the help that comes with SQL Server?
Using that you should be able to work the syntax out! Or check eg.
http://msdn.microsoft.com/library/d...
server2000.asp
if you don't have access to BOL.
Other than that, try losing the 'COLUMN' part.
/impslayer, aka Birger Johansson|||"impslayer" <impslayer@.hotmail.com> wrote in message
news:1129876626.682799.308040@.f14g2000cwb.googlegroups.com...
> Deanna Cusic skrev:
>
> Have you checked Books online, the help that comes with SQL Server?
> Using that you should be able to work the syntax out! Or check eg.
> http://msdn.microsoft.com/library/d...lserver2000.asp
> if you don't have access to BOL.
> Other than that, try losing the 'COLUMN' part.
> /impslayer, aka Birger Johansson
>
Thank you, all I did is take out 'COLUMN' and it works. I have been
wracking my brain for hours over this.
Deanna
UoP Student
deannac24@.cableone.net|||OK, thanks for your help so far but now I am stuck on the final one. I am
trying to add an index. So far I have:
use Northwind
ALTER TABLE Employees ADD [idxAddress] nvarchar(60), Address nvarchar(60)
the error I get is
Server: Msg 2705, level 16, State 4, Line 3
Column names in each table must be unique. Column name 'Address' in table
'Employees' is specified more than once.
I have tried this on many different fields including the primary keys and
still get this same error. I have even pulled up the data to check for
replication and did not find any. I am lost. I finally, thanks to help,
have part a and b, however I need part c. When I get that I can actually
get some sleep before the sun, and my children, get up ;-)
--
Deanna
"Deanna Cusic" <deannac24@.cableone.net> wrote in message
news:11lh4epilg52q9b@.corp.supernews.com...
> "impslayer" <impslayer@.hotmail.com> wrote in message
> news:1129876626.682799.308040@.f14g2000cwb.googlegroups.com...
> Thank you, all I did is take out 'COLUMN' and it works. I have been
> wracking my brain for hours over this.
> Deanna
> UoP Student
> deannac24@.cableone.net
>|||Deanna Cusic skrev:
> OK, thanks for your help so far but now I am stuck on the final one. I am
> trying to add an index. So far I have:
> use Northwind
> ALTER TABLE Employees ADD [idxAddress] nvarchar(60), Address nvarchar(60)
>
You should look for help on creating an index, not 'ALTER TABLE'...
The assignment question seemed to indicate an 'ALTER TABLE', but
you should really search for help on 'index' instead, that would
give you your desired answer!
Without Books online, you might check out:
http://msdn.microsoft.com/library/d...r />
_64l4.asp
/impslayer, aka Birger Johansson
Saturday, February 25, 2012
newbie - DEBUG MODE?
I have a query I'm working on in the Query Analyzer. My query has
variables...I wanted to know if there is a way to track the variable and
see its value (I.e. step through) is there a debug mode in the Query
Analyzer?
Thanks in advance.You can use SQL Debbuger.
From Query Analyzer, right-click on the stored procedure in the Object
Browser and select Debug. That will open SQL Debuuger.
"Fab" wrote:
> Hello,
> I have a query I'm working on in the Query Analyzer. My query has
> variables...I wanted to know if there is a way to track the variable and
> see its value (I.e. step through) is there a debug mode in the Query
> Analyzer?
> Thanks in advance.
>
>|||COOL THANKS JACK!
"Jack" <Jack@.discussions.microsoft.com> wrote in message
news:7BCCA5CF-34FC-44B7-820D-29D35A68F263@.microsoft.com...
> You can use SQL Debbuger.
> From Query Analyzer, right-click on the stored procedure in the Object
> Browser and select Debug. That will open SQL Debuuger.
> "Fab" wrote:
>
Monday, February 20, 2012
Newbie - ? on MsSQL
I had ms sql server 2000 in my PC. I am very new to ASP.NET as i have been working on PHP n MySQL for the past 3 years. Now i am moving to .NET framework 2. I installed visual studio express 2005 and then sql server 2005.
But now that i run sql 2000, it does connect me to localhost. but on sql 2005 i cant. can some one shade some light to this.
I have not used SQL server before and am just starting to learn it with ASP.NET 2. I am programmer that likes to code each and every line of codes but ASP.NET is a bit different. Well anyway, cheers
Newb question regarding cluster load balancing
I am currently working on creating a Windows 2003 server cluster (3 nodes)
with the intent that it serve our web app which requires multiple SQL
databases. The question I have is this: How can I configure load balancing
for this? It seems that clustering services only allows 1 of the nodes to
access the DB at any given time (which is logical). If this is true, how
will I be able to leverage the processing power of the other two nodes if
they are idle while the node that is hosting the DB does all the work?
Any help would be appreciated.
Michael
You can install multiple instances of SQL Server on a failover cluster. You
cannot natively load-balance the workload between these multiple instances.
They act as independent SQL servers. SQL Clustering is a failover
technology and does not natively load balance.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Michael Weyant" <mweyant@.themarlincompany.com> wrote in message
news:OshvlPrGGHA.312@.TK2MSFTNGP09.phx.gbl...
> Hello to all,
> I am currently working on creating a Windows 2003 server cluster (3 nodes)
> with the intent that it serve our web app which requires multiple SQL
> databases. The question I have is this: How can I configure load balancing
> for this? It seems that clustering services only allows 1 of the nodes to
> access the DB at any given time (which is logical). If this is true, how
> will I be able to leverage the processing power of the other two nodes if
> they are idle while the node that is hosting the DB does all the work?
> Any help would be appreciated.
> Michael
>
|||Thanks Geoff for the information. I thought as much but hoped otherwise.
"Geoff N. Hiten" <SQLCraftsman@.gmail.com> wrote in message
news:e9dbmVrGGHA.3856@.TK2MSFTNGP12.phx.gbl...
> You can install multiple instances of SQL Server on a failover cluster.
> You cannot natively load-balance the workload between these multiple
> instances. They act as independent SQL servers. SQL Clustering is a
> failover technology and does not natively load balance.
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
> "Michael Weyant" <mweyant@.themarlincompany.com> wrote in message
> news:OshvlPrGGHA.312@.TK2MSFTNGP09.phx.gbl...
>