Showing posts with label idea. Show all posts
Showing posts with label idea. Show all posts

Sunday, March 25, 2012

Creating a User Help!

I want to create a New user using SqlDmo through a VB 6.0
Any Idea?
Anybody can send me a code snippet?
ThanksTry:
Dim oUser as New SQLDMO.User
oUser.Login = "JoeUser"
oDatabase.Users.Add (oUser)
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
.
"Nando_uy" <Nandouy@.discussions.microsoft.com> wrote in message
news:DBA816C1-62C5-46D2-9BA6-2DF40862D6E9@.microsoft.com...
I want to create a New user using SqlDmo through a VB 6.0
Any Idea?
Anybody can send me a code snippet?
Thanks

Monday, March 19, 2012

Creating a primary key in a trigger

I'd like to create a primary key value (incremental) within a trigger and set it in a primary key column.

Any idea anyone? Do I define my trigger as a On INSERT, Instead of INSERT? I tried both but it doesn't seem I'm doing things right.

You can use the identity column. Is there any different logic you are using for incremnetal primary key?

|||

Not quite sure what you're trying to do here- are you not able to use IDENTITY as your auto-incrementing primary key field?

I think if you *really* want to do this you may do something like this:

Code Snippet

create trigger bbbb on bb
instead of insert
as

declare @.int int

select @.int = MAX(col1) from bb

insert into bb (col1, col2, col3)
select @.int+1, col2, col3

from inserted

HTH!

Sunday, March 11, 2012

creating a newsgroup database with mssql

Need some idea about designing a model for newsgroup databaseI reccomend you start by learning normalization, lots of links out there, here's one that may help. http://www.sims.berkeley.edu/courses/is202/f98/Lecture12/sld001.htm

Might not be the answer you were looking for but will help you in the long run.

HTH|||Originally posted by rhigdon
I reccomend you start by learning normalization, lots of links out there, here's one that may help. http://www.sims.berkeley.edu/courses/is202/f98/Lecture12/sld001.htm

Might not be the answer you were looking for but will help you in the long run.

HTH

Thank you for the link