Another SQL script question.

Hey all,

How do i make sure that the local machine aspnet user account has privilages after installing my sql script on a local machine. ( this script gets run during my vb.net setup project. )
i was thinking about adding the user to the sql script its self. but i am unsure how to do this.
if anyone could help i would be greatly appreciative.
TIA
-Chris-
I am one of those!
0
Sc00by
11/19/2003 1:47:24 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

3 Replies
741 Views

Similar Articles

[PageSpeed] 54
Get it on Google Play
Get it on Apple App Store

Check out this link.

The link is for MSDE but applies to Sql Server too. It shows the syntax for adding new users to a database server and granting them access to specific databases.
0
McMurdoStation
11/19/2003 5:06:35 PM
Thanks for you reply.

the syntax for adding a user assumes you know the full nt user account info. correct?
domain\user account.
what i would like to do is add the local machine\aspnet account. without knowing what the name of the local machine is.
if you have suggestion, please let me know.
TIA
Chris.

I am one of those!
0
Sc00by
11/19/2003 6:56:15 PM
I've gotten around that problem by using Sql Server authentication instead of a trusted connection. 


-- Create Sql authentication login for 'SomeName'
EXEC sp_addlogin @loginame='SomeName',@passwd='SomePassword',@defdb=N'SomeDefaultDb'
-- and making sure you are executing from 'SomeDatabase' grant access to 'SomeName' to the database 'SomeDatabase'
EXEC sp_grantdbaccess 'SomeName'

There is probably some server side property or method you can call that will tell you who the ASPNET user is running as (e.g., domain\ASPNET) which would allow you to use the other syntax to create a trusted connection.
0
McMurdoStation
11/19/2003 8:59:17 PM
Reply:

Similar Artilces:

calling a sql script from another sql script
Hi, does anyone know how to call a sql script (Note: not a stored procedure) from another sql script in sybase? In oracle, you just put @ before the script name. I haven't been able to find out how to do it in sybase. Any help will be greatly appreciated. -Yilin Yilin Cai wrote: > > Hi, does anyone know how to call a sql script (Note: not a stored > procedure) from > another sql script in sybase? In oracle, you just put @ before the > script name. > I haven't been able to find out how to do it in sybase. Any help will be > greatly > app...

Syntax to call a t-sql script from another t-sql script
I need to know how to call a t-sql script from another t-sql script. In Oracle I can add a line: @tce_load_company.sql to a sql command file, and it will run that file. This allows me to have a single "master" file that has all of my lower level table initialization values. What is the syntax for doing this in SQLServer? Thanks, Chris Emerson "Christopher A. Emerson" wrote: > I need to know how to call a t-sql script from another t-sql script. > > In Oracle I can add a line: @tce_load_company.sql to a sql command file, and it > will r...

Sql Server Script File(.sql) Execution by Vb.net Code
I have a problem. I m working on "light weight sql server"  project.   and i want to execute .sql file through vb.net code with the help of sqldmo library and sqlns namespace. but i donot know any method to directly execute the .sql file. i am successfully making the full script of select database of sql server.   please help me.... thanks.... Hi, You can use SQL-DMO object in your .net projects by referencing Sqldmo.dll  file which is in  C:\Program Files\Microsoft SQL Server\80\Tools\Binn  folder is default installation parameters are used. I...

GENERAL SQL SERVER: Question about the Script that setups the SQL Server Database.
This is the first time I have created a script for Sql Server 2000, and I have run into a few syntax ereas that I am not familar with. Bellow is a section of the script from the Portal server packages. At the end of the sample, is "ON [PRIMARY], Can anyone explain to me what this does and why the primary key isnt setup inside the code itself? I am basically trying to take parts of the script and incorrporate it into my own script and hate added syntax that I dont understand, makes debugging a real pain in the future. CREATE TABLE [dbo].[Portal_Announcements] ( [ItemID] [in...

Converting a gridView using an Sql Datasource to a gridview who is not using an SQL DataSource
How can i rewrite this page so that i doesnt make use of an SqlDataSource?  <%@ Control Language="C#" AutoEventWireup="true" CodeFile="LoginHistory.ascx.cs" Inherits="Private_UserControls_WebUserControl" %> <html> <head> <%--<link rel="stylesheet" href="BaldwinPortal.css" mce_href="BaldwinPortal.css" type="text/css" />--%> <title>Login History</title> </head> <body style="margin:0 0 0 0;padding:0 0 0 0"> ...

Using SQL to create a SQL script
I have a table containing table names and I want to create a SQL file using SQL select statement as below to cycle through the target table and create a file for example: select 'drop table '||table_name||'' from test_table where table_name like "test%" This will produce something like : drop table test_01 drop table test_01 etc. in the output file And the problem is ... what? I'm guessing that you want "go" interspersed throughout. So add on an identity column as you "select into", say, #temp1. Then "select text, (2...

view sql script from SQL PLUS
I want to view sql script of a function() in oracle database from sql plus command prompt. how? thanks in advancefeed the creative machine I got it, select text from all_source where name = 'object name' and type 'FUNCTION' order by line; thanksfeed the creative machine...

Another SQL tool: SQL Maestro
Hi Folks http://savage.net.au/Ron/html/drawing-tools.html -- Ron Savage ron@savage.net.au http://savage.net.au/ ...

generating sql scripts from SQL Anywhere
Is it possible to generate SQL scripts from Sybase Central? If not, what's the best way to do that? Thank you That depends on what you want those scripts to do. For example, the UNLOAD wizard creates a SQL script that completely reloads a database. -- Paul Horan[TeamSybase] "Jim" <jimsjbox@yahoo.com> wrote in message news:41b4e51f@forums-1-dub... > Is it possible to generate SQL scripts from Sybase Central? > > If not, what's the best way to do that? > > Thank you > > I just want to generate a CREATE script for a...

Another SQL Question
I am creating an ASP page and connecting to SQL Server. I am using Visual Studio. When I click on the Server Explorer to add a Data Connection It prompts me to input the server name and then select whether it will use Windows NT Security or a specific user name and password. Lastly, it has me select the database that I am connecting to on the server. No problems here. When I put in all of the information and hit Test Connection it says succesful. However, when I click on the advanced tab it gives me the Connect Timout box as well as Access permissions. This is where the issue is, it ...

Another SQL Question
How do I select data from a table in a format where I can BCP it. The columns have to be separated by colons Thanks I want a query that will retrieve columns from a table in a format where I can BCP it into another table. The columns should be separated by colons: Thanks > How do I select data from a table in a format where I can > BCP it. The columns have to be separated by colons > > Thanks Use bcp with the -t option to specify a different column delimiter. You can also create a view and then bcp out the view and use the -t option on the bcp. Bob On 2...

SQL in .NET question
How do i use the LIKE and the wildcards in a search in .NET (using c#) example in straight SQL: SELECT * FROM myDB WHERE LastName LIKE '%Jo%' if i try and use it in .NET like follows: SELECT * FROM myDB WHERE LastName LIKE %@MyVar% I get an error. Try: SELECT * FROM myDB WHERE LastName LIKE @MyVar and then prepend and append '%' characters to the string you are passing in.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog Wow, I didn't know you could do that. I usually do this which works as well (no prepending of...

Another SQL tool: WWW SQL Designer
Hi Folks http://savage.net.au/Ron/html/drawing-tools.html ...

Exporting SQL Express Database to SQL Script
Hello there, i want to move my database onto my webserver and to do so i need to create a database on my web server and then import the data into this database using a SQL script file.I know this is fairly simple using SQL Server 2005, however annoyingly i don't have that and i'm just using SQL Express, so is there any way to export the data from this database into a SQL Script file?Thanks.  Since you want to restore databasae with data in live server. The best way is Backing up the database then upload backup file into server.In server create a database with same name & t...