Showing posts with label mgmt. Show all posts
Showing posts with label mgmt. Show all posts

Friday, March 23, 2012

newbie question

how do I grant a user permission to a database from sql server mgmt studio
express ?
I used admin to create the database, granted the user smith full access to
the directory and files for the database. I tried grant the login id smith
access by simply smith as well as mypc\smith. both were rejected
how should I go about granting user permission?
Hi
I don;t use SQL Server 2005 Management Studio Express but this describes how
to do the tasks
http://www.microsoft.com/technet/prodtechnol/sql/2005/mgsqlexpwssmse.mspx
You may want use SQLCMD and the CREATE LOGIN/CREATE USER commands if you
have a large number of logins/users to create.
John
"GS" wrote:

> how do I grant a user permission to a database from sql server mgmt studio
> express ?
> I used admin to create the database, granted the user smith full access to
> the directory and files for the database. I tried grant the login id smith
> access by simply smith as well as mypc\smith. both were rejected
> how should I go about granting user permission?
>
>
|||thank you
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:944A0AF9-6167-4698-8610-571B3E8C3148@.microsoft.com...
> Hi
> I don;t use SQL Server 2005 Management Studio Express but this describes
how[vbcol=seagreen]
> to do the tasks
> http://www.microsoft.com/technet/prodtechnol/sql/2005/mgsqlexpwssmse.mspx
> You may want use SQLCMD and the CREATE LOGIN/CREATE USER commands if you
> have a large number of logins/users to create.
> John
> "GS" wrote:
studio[vbcol=seagreen]
to[vbcol=seagreen]
smith[vbcol=seagreen]

newbie question

how do I grant a user permission to a database from sql server mgmt studio
express ?
I used admin to create the database, granted the user smith full access to
the directory and files for the database. I tried grant the login id smith
access by simply smith as well as mypc\smith. both were rejected
how should I go about granting user permission?Hi
I don;t use SQL Server 2005 Management Studio Express but this describes how
to do the tasks
http://www.microsoft.com/technet/pr...lexpwssmse.mspx
You may want use SQLCMD and the CREATE LOGIN/CREATE USER commands if you
have a large number of logins/users to create.
John
"GS" wrote:

> how do I grant a user permission to a database from sql server mgmt studio
> express ?
> I used admin to create the database, granted the user smith full access to
> the directory and files for the database. I tried grant the login id smit
h
> access by simply smith as well as mypc\smith. both were rejected
> how should I go about granting user permission?
>
>|||thank you
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:944A0AF9-6167-4698-8610-571B3E8C3148@.microsoft.com...
> Hi
> I don;t use SQL Server 2005 Management Studio Express but this describes
how[vbcol=seagreen]
> to do the tasks
> http://www.microsoft.com/technet/pr...lexpwssmse.mspx
> You may want use SQLCMD and the CREATE LOGIN/CREATE USER commands if you
> have a large number of logins/users to create.
> John
> "GS" wrote:
>
studio[vbcol=seagreen]
to[vbcol=seagreen]
smith[vbcol=seagreen]

Wednesday, March 21, 2012

newbie question

how do I grant a user permission to a database from sql server mgmt studio
express ?
I used admin to create the database, granted the user smith full access to
the directory and files for the database. I tried grant the login id smith
access by simply smith as well as mypc\smith. both were rejected
how should I go about granting user permission?Hi
I don;t use SQL Server 2005 Management Studio Express but this describes how
to do the tasks
http://www.microsoft.com/technet/prodtechnol/sql/2005/mgsqlexpwssmse.mspx
You may want use SQLCMD and the CREATE LOGIN/CREATE USER commands if you
have a large number of logins/users to create.
John
"GS" wrote:
> how do I grant a user permission to a database from sql server mgmt studio
> express ?
> I used admin to create the database, granted the user smith full access to
> the directory and files for the database. I tried grant the login id smith
> access by simply smith as well as mypc\smith. both were rejected
> how should I go about granting user permission?
>
>|||thank you
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:944A0AF9-6167-4698-8610-571B3E8C3148@.microsoft.com...
> Hi
> I don;t use SQL Server 2005 Management Studio Express but this describes
how
> to do the tasks
> http://www.microsoft.com/technet/prodtechnol/sql/2005/mgsqlexpwssmse.mspx
> You may want use SQLCMD and the CREATE LOGIN/CREATE USER commands if you
> have a large number of logins/users to create.
> John
> "GS" wrote:
> > how do I grant a user permission to a database from sql server mgmt
studio
> > express ?
> >
> > I used admin to create the database, granted the user smith full access
to
> > the directory and files for the database. I tried grant the login id
smith
> > access by simply smith as well as mypc\smith. both were rejected
> > how should I go about granting user permission?
> >
> >
> >

Monday, March 19, 2012

NEWBIE Needs Help automating data from another server

Hi,

I am able to do these actions interactively from SQL 2005 (not developers nor enterprise edition, just using SQL 2005 Mgmt Studio) and want to "script/batch" them so I can have them automatically run at a pre selected time.

First: I am able to delete the table by performing a right click on the table, then click Delete from Mgmt Studio SQL 2005. I verify the table is completely gone with a refresh. (I pulled the code that did this ..... DROP TABLE etc. to Notepad)

2nd: I am able to import the table (again from Mgmt Studio SQL 2005) and have saved this action as a SSIS. Execute the script and "waLa" I have all 17K rows of data. I pulled this create table code into notepad also.

Now I put the code of both of the above actions together (drop table and create table) into one SQL query and execute it. This does not give me the same results of above, instead my table is blank now.

Maybe there is a better way. The business problem I am attempting to solve: I am refreshing the data in a as/400 table weekly. I want that refreshed data to be available in the SQL2005 database without my having to press buttons first thing Monday morning. Can any one help? Thanks in advance.

Below is the Code:

USE [400kas]
GO
/****** Object: Table [dbo].[navar100] Script Date: 09/07/2007 16:09:04 ******/
DROP TABLE [dbo].[navar100]
GO


USE [400kas]
GO
/****** Object: Table [dbo].[Query] Script Date: 09/07/2007 16:12:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[navar100](
[CMPNO] [decimal](3, 0) NOT NULL,
[ARTDT] [datetime] NOT NULL,
[AUDDT] [datetime] NOT NULL,
[ARDDT] [datetime] NOT NULL,
[CCUS#] [decimal](6, 0) NOT NULL,
[CCNAM] [nvarchar](25) NOT NULL,
[CUSNO] [decimal](6, 0) NOT NULL,
[CNAME] [nvarchar](25) NOT NULL,
[SHPNO] [decimal](4, 0) NOT NULL,
[ARRCD] [nvarchar](1) NOT NULL,
[AUDUS] [nvarchar](10) NOT NULL,
[INVNO] [decimal](6, 0) NOT NULL,
[CUSPO] [nvarchar](15) NOT NULL,
[REFNO] [decimal](6, 0) NOT NULL,
[COMNT] [nvarchar](10) NOT NULL,
[SHPPO] [nvarchar](15) NOT NULL,
[AMONT] [decimal](13, 2) NOT NULL,
[AMOUNT] [decimal](24, 8) NOT NULL,
[REMAN] [decimal](13, 2) NOT NULL,
[INREG] [decimal](3, 0) NOT NULL,
[INSAL] [decimal](3, 0) NOT NULL,
[TMCOD] [nvarchar](2) NOT NULL,
[CRHLD] [nvarchar](1) NOT NULL,
[CRLIM] [decimal](13, 0) NOT NULL,
[CRDAY] [decimal](3, 0) NOT NULL,
[TCRCD] [nvarchar](3) NOT NULL,
[TEXRT] [decimal](11, 6) NOT NULL,
[R1RGL] [decimal](13, 2) NOT NULL,
[TAXAM] [decimal](13, 2) NOT NULL,
[TFRTX] [decimal](13, 3) NOT NULL,
[TFRGT] [decimal](13, 2) NOT NULL,
[TSPCH] [decimal](13, 2) NOT NULL,
[SPCST] [decimal](13, 2) NOT NULL,
[IRPFT] [decimal](13, 2) NOT NULL
) ON [PRIMARY]

Instead of dropping and recreating the table, you can just truncate it.

e.g.

Code Snippet

truncate table [400kas];

|||

1) create an ssis package that pulls the the data from the as400 to your table

-execute sql task- truncate table <tableName>

-data flow task to pull data from source to target

2)create a sql server agent job that executes the package, and runs at the time you'd like (ex. everyday at 7am)