Thursday, March 22, 2012
Adding users
I want to programatically attach a DB to an instance of MSDE, and then
create the user, and give permissions to the DB I've just attached.
I can successfully attach the DB, but cannot get the permissions correct
Which sequence of T-SQL commands should I be calling to:
a). create the login in the instance of MSDE
b). associate the login with the newly attached DB
I have played around with:
sp_attach_single_file_db
sp_addlogin
sp_grantdbaccess
sp_grantlogin
but I cannot get a successful logon with the new account, even though the
T-SQL commands run successfully.
Thanks
Hi Paul,
Is there any chance the users already exist in the database you're
attaching? If so, you get into a weird situation because you have users with
the same name but different SID's. If you download a copy of MSDE Manager
from our site (free for personal use), it's got a menu option that lets you
list and fix security ID problems. Might well help.
To avoid these, we normally create the users on the target system by
supplying the sid parameter.
HTH,
Greg Low [MVP]
MSDE Manager SQL Tools
www.whitebearconsulting.com
"Paul Aspinall" <paul@.aspy.co.uk> wrote in message
news:m%IUd.241292$K7.73273@.fe2.news.blueyonder.co. uk...
> Hi
> I want to programatically attach a DB to an instance of MSDE, and then
> create the user, and give permissions to the DB I've just attached.
> I can successfully attach the DB, but cannot get the permissions correct
> Which sequence of T-SQL commands should I be calling to:
> a). create the login in the instance of MSDE
> b). associate the login with the newly attached DB
> I have played around with:
> sp_attach_single_file_db
> sp_addlogin
> sp_grantdbaccess
> sp_grantlogin
> but I cannot get a successful logon with the new account, even though the
> T-SQL commands run successfully.
> Thanks
>
>
|||Hi Greg,
I was reading Paul message and experienced the same problems setting up MSDE.
I installed the MSDE on a machine i was using for the server.
Used (local)netSDK for instance as in the documentation .
Then I accessed the database NorthWind using the SQLClient.
The samples in VB.net now work ok when ran from the server where I installed
MSDE.
However, I then got very bold, and tried to access the NorthWind database
from another computer that was setup on our network.
I added a login name, added a role and a member, granted premission.
Then in the vb.net program I tried to open the database with the same code
from the program on the server. I did change the server name to the Name of
the computer that MSDE was installed on. I also tried the IP address as the
server.
I kept getting the error "Server not found or do not have premission.
WHAT AM I DOING WRONG?
Best regards,
Dave
"Greg Low [MVP]" wrote:
> Hi Paul,
> Is there any chance the users already exist in the database you're
> attaching? If so, you get into a weird situation because you have users with
> the same name but different SID's. If you download a copy of MSDE Manager
> from our site (free for personal use), it's got a menu option that lets you
> list and fix security ID problems. Might well help.
> To avoid these, we normally create the users on the target system by
> supplying the sid parameter.
> HTH,
> --
> Greg Low [MVP]
> MSDE Manager SQL Tools
> www.whitebearconsulting.com
> "Paul Aspinall" <paul@.aspy.co.uk> wrote in message
> news:m%IUd.241292$K7.73273@.fe2.news.blueyonder.co. uk...
>
>
Monday, March 19, 2012
adding SQL Server licenses to existing system
bought an extra 5 CALs for it. How do I apply the new
CALs to the existing SQL Server?
The only reference to licensing I can find is in Control
Panel->SQL Server 2000 Licensing Setup. This opens the
Choose Licensing Mode form where you can change the number
of devices. This is all well and good, but after changing
this value to 10, I don't have to enter the license number
for the new CALs. Surely this isn't the proper method for
this as the system has no proof that I have more then 5
CALs.
Thanks,
Merle
Perhaps this article would help --
870617 How to add or modify licenses in SQL Server 2000
http://support.microsoft.com/?id=870617
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
Tuesday, March 6, 2012
Adding many templates at once
I can’t find out how to put SQL 2000 templates that I’ve already created into SQL 2005, en masse. I don’t want to put them in one at a time. I’ve got 40 or 50 of them.
Can you please direct me to the location I can paste them in and have them show up.
I’ve tried this location, where the ones built-in exist:
C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlworkbenchprojectitems\Sql
When I put my own folder in there with my custom templates, they don’t show up and there is no REFRESH button on the Template View.
When I saw that existing ones had the .sql extension, I renamed them from .tql to .sql, but that did not make any difference.
Thanks for any help.
I found that when I closed SSMS and then opened it, all my templates appeared as expected.
I suggest adding a refresh button to the templates.
Thursday, February 16, 2012
Adding Data from a form to a database
Very basic question here but I need to add a form to a page so it adds content, its as simple as that. I've done this kind of using a <asp.Formview> tag and it works, but becuase I think I've used a form view I have to click add to insert data first. Should I be using the <asp:formview> tag or is it a problem with the templates?
<asp:FormView ID="FormView1" runat="server" DataKeyNames="ContentID" DataSourceID="ObjectDataSource1">
<InsertItemTemplate>
Resource :<asp:DropDownList ID="ResourceIDTextBox" runat="server" Text='<%# Bind("ResourceID") %>' DataSourceID="ObjectDataSource2"
DataTextField="Resource" DataValueField="ResourceID">
</asp:DropDownList><br />
Headline:
<asp:TextBox ID="HeadlineTextBox" runat="server" Text='<%# Bind("Headline") %>' Width="451px"></asp:TextBox><br />
Date:
<asp:TextBox ID="DateTextBox" runat="server" Text='<%# Bind("Date") %>'>
</asp:TextBox><br />
Body:
<FTB:FreeTextBox id="FreeTextBox1" runat="Server" Text='<%# Bind("Body") %>' Width="542px" />
<br />
ImageURL:
<asp:TextBox ID="ImageURLTextBox" runat="server" Text='<%# Bind("ImageURL") %>'>
</asp:TextBox><br />
OpeningPara:
<asp:TextBox ID="OpeningParaTextBox" runat="server" Text='<%# Bind("OpeningPara") %>'>
</asp:TextBox><br />
Ret:
<asp:TextBox ID="RetTextBox" runat="server" Text='<%# Bind("Ret") %>'>
</asp:TextBox><br />
Man:
<asp:TextBox ID="ManTextBox" runat="server" Text='<%# Bind("Man") %>'>
</asp:TextBox><br />
Pro:
<asp:TextBox ID="ProTextBox" runat="server" Text='<%# Bind("Pro") %>'>
</asp:TextBox><br />
Com:
<asp:TextBox ID="ComTextBox" runat="server" Text='<%# Bind("Com") %>'>
</asp:TextBox><br />
IndustryID:
<asp:TextBox ID="IndustryIDTextBox" runat="server" Text='<%# Bind("IndustryID") %>'>
</asp:TextBox><br />
ContentTitle:
<asp:TextBox ID="ContentTitleTextBox" runat="server" Text='<%# Bind("ContentTitle") %>'>
</asp:TextBox><br />
Status:
<asp:TextBox ID="StatusTextBox" runat="server" Text='<%# Bind("Status") %>'>
</asp:TextBox><br />
Pub:
<asp:TextBox ID="PubTextBox" runat="server" Text='<%# Bind("Pub") %>'>
</asp:TextBox><br />
Fin:
<asp:TextBox ID="FinTextBox" runat="server" Text='<%# Bind("Fin") %>'>
</asp:TextBox><br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
</InsertItemTemplate
<ItemTemplate>
<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New"
Text="Click here to Add New Content">
</asp:LinkButton>
</ItemTemplate
</asp:FormView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"
InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="ContentADDMethod"
TypeName="DataSet2TableAdapters.ContentADDAdapter" UpdateMethod="Update">
<DeleteParameters>
<asp:Parameter Name="Original_ContentID" Type="Int32" />
</DeleteParameters
<UpdateParameters>
<asp:Parameter Name="ResourceID" Type="Int32" />
<asp:Parameter Name="Headline" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Body" Type="String" />
<asp:Parameter Name="ImageURL" Type="String" />
<asp:Parameter Name="OpeningPara" Type="String" />
<asp:Parameter Name="Ret" Type="String" />
<asp:Parameter Name="Man" Type="String" />
<asp:Parameter Name="Pro" Type="String" />
<asp:Parameter Name="Com" Type="String" />
<asp:Parameter Name="IndustryID" Type="Int32" />
<asp:Parameter Name="ContentTitle" Type="String" />
<asp:Parameter Name="Status" Type="String" />
<asp:Parameter Name="Pub" Type="String" />
<asp:Parameter Name="Fin" Type="String" />
<asp:Parameter Name="Original_ContentID" Type="Int32" />
<asp:Parameter Name="ContentID" Type="Int32" />
</UpdateParameters
<InsertParameters>
<asp:Parameter Name="ResourceID" Type="Int32" />
<asp:Parameter Name="Headline" Type="String" />
<asp:Parameter Name="Date" Type="String" />
<asp:Parameter Name="Body" Type="String" />
<asp:Parameter Name="ImageURL" Type="String" />
<asp:Parameter Name="OpeningPara" Type="String" />
<asp:Parameter Name="Ret" Type="String" />
<asp:Parameter Name="Man" Type="String" />
<asp:Parameter Name="Pro" Type="String" />
<asp:Parameter Name="Com" Type="String" />
<asp:Parameter Name="IndustryID" Type="Int32" />
<asp:Parameter Name="ContentTitle" Type="String" />
<asp:Parameter Name="Status" Type="String" />
<asp:Parameter Name="Pub" Type="String" />
<asp:Parameter Name="Fin" Type="String" />
</InsertParameters
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" InsertMethod="Insert"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="DataSet2TableAdapters.ResourcesTableAdapter">
<InsertParameters>
<asp:Parameter Name="Resource" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
I'm sorry, but what is your complaint? You have to click an add button in order to add a new record?
Monday, February 13, 2012
Adding column to article on *susbcriber* side
I've got a unidirectional transactional replication (on sql 2000) and
I want to add a column to a table on the subscriber's side, the column
allows nulls and is going to be updated on the subscriber.
I thought of creating the table, than adding the publication and when
I add this specific article, tell it to truncate the table if it
exists rather than to drop it.
Is there any flaw in this?
Thanks in advance,
R. Green
It should work. This is the normal way of carrying out what you are trying
to accomplish.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Ronald Green" <zzzbla@.gmail.com> wrote in message
news:1172407317.380240.255030@.t69g2000cwt.googlegr oups.com...
> Hi,
> I've got a unidirectional transactional replication (on sql 2000) and
> I want to add a column to a table on the subscriber's side, the column
> allows nulls and is going to be updated on the subscriber.
> I thought of creating the table, than adding the publication and when
> I add this specific article, tell it to truncate the table if it
> exists rather than to drop it.
> Is there any flaw in this?
> Thanks in advance,
> R. Green
>
|||Thanks a lot!
On Feb 25, 3:01 pm, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
> It should work. This is the normal way of carrying out what you are trying
> to accomplish.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTShttp://www.indexserverfaq.com
> "Ronald Green" <zzz...@.gmail.com> wrote in message
> news:1172407317.380240.255030@.t69g2000cwt.googlegr oups.com...
>
>
>
>
> - Show quoted text -
|||Hi,
I ran a little test, and it failed on delivering the snapshot because
of that extra column on the subscriber side. So the moral of the story
is to add the column in a post snapshot script which is not always the
best idea (if you already have your schema deployed and something is
dependant on this column), OR you can change the SYNC view on the
publisher and add a blank column to it prior to running the snapshot
agent.
R. Green
On Feb 25, 3:01 pm, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
> It should work. This is the normal way of carrying out what you are trying
> to accomplish.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTShttp://www.indexserverfaq.com
> "Ronald Green" <zzz...@.gmail.com> wrote in message
> news:1172407317.380240.255030@.t69g2000cwt.googlegr oups.com...
>
>
>
>
> - Show quoted text -
|||Arghhh!!!!!!!!!!!! Somehow I was assuming you would be doing a no-sync.
Yes, this could be accomplished via a post snapshot script.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Ronald Green" <zzzbla@.gmail.com> wrote in message
news:1172412186.310429.11430@.k78g2000cwa.googlegro ups.com...
> Hi,
> I ran a little test, and it failed on delivering the snapshot because
> of that extra column on the subscriber side. So the moral of the story
> is to add the column in a post snapshot script which is not always the
> best idea (if you already have your schema deployed and something is
> dependant on this column), OR you can change the SYNC view on the
> publisher and add a blank column to it prior to running the snapshot
> agent.
> R. Green
>
> On Feb 25, 3:01 pm, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
>