Friday, March 30, 2012
How to authorize a user only through an application
we use Windows Authentification with SQL Server 2005 but we want our users
to access to the database only with an application. We don't want our users
to access to the database with an other application.
What are the possibilities ? Does SQL Server recognize an application with a
signature or something like that ?
Thanks
Best regardsCheck in Books On Line about the use of an 'Application Role'.
An 'Application Role' is a special type of login that may work for your
situation.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Jojonews" <Jojonews@.discussions.microsoft.com> wrote in message
news:46345D65-7404-40EE-BECE-BED51AEC45B1@.microsoft.com...
> Hello,
> we use Windows Authentification with SQL Server 2005 but we want our users
> to access to the database only with an application. We don't want our
> users
> to access to the database with an other application.
> What are the possibilities ? Does SQL Server recognize an application with
> a
> signature or something like that ?
> Thanks
> Best regardssql
How to autenticate to local SQL Express server
how to audit local access to sql server
I am looking for a way to audit only local access to sql server 2000.
that is, I don't care about networked clients logging in to database, I
want to know everything that a user does who logs in at the local
console access.
is there a way to do this without buying an agent? can c2 auditing be
specific and ignore all remote access and only log the local sql server
2k interactions? I don't want to get swamped in a deluge of *all*
activity being logged, my application logs all client access to my
satisfaction. I want to now make sure no one can access database
locally and leave me with no log of activity...direct and local db
access...
thx,
rpf
You can set up a rolling serverside trace that filters on the hostname of
the local server
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"RPF" <richard_p_franklin@.yahoo.com> wrote in message
news:1129408525.096989.140790@.f14g2000cwb.googlegr oups.com...
> hello
> I am looking for a way to audit only local access to sql server 2000.
> that is, I don't care about networked clients logging in to database, I
> want to know everything that a user does who logs in at the local
> console access.
> is there a way to do this without buying an agent? can c2 auditing be
> specific and ignore all remote access and only log the local sql server
> 2k interactions? I don't want to get swamped in a deluge of *all*
> activity being logged, my application logs all client access to my
> satisfaction. I want to now make sure no one can access database
> locally and leave me with no log of activity...direct and local db
> access...
> thx,
> rpf
>
|||I'm interested in this also, but can you explain how exactly to do
this? I admin our IIS server, the SQL server was setup by a consultant
that went out of business. I'm not real good with the SQL server and
don't want to break anything.
Also, will this have any impact on the performance of the SQL server?
|||The easiest way to generate the commands for a serverside trace is to use
the Profiler GUI (Start>Run>Profiler.exe). Select File>New>Trace, put in you
server name and then select the events you are interested in and set the
appropriate filters (click on help on the dialog to get details of what the
tabs do). Once you're happy with your selection click on Run and check that
the required events are being captured. If happy then stop the trace and
goto File>Script Trace>For SQL 2000. This will prompt you to save a sql
file. Open this using Query Analyzer and you will have the template for your
trace. In order to set this up on a rolling basis you will need to wrap the
template in a stored procedure in which you generate the filename (usually
based on the date). In order to start it automatically when sql starts you
can use sp_procoption (see BOL for details). I will try and post an
article/code on my site tonight. There can be a performance impact but it
depends on what you trace. As long as you don't trace statement level events
then the performance impact is generally negligible.
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
<brk100@.gmail.com> wrote in message
news:1129473547.688786.109990@.g14g2000cwa.googlegr oups.com...
> I'm interested in this also, but can you explain how exactly to do
> this? I admin our IIS server, the SQL server was setup by a consultant
> that went out of business. I'm not real good with the SQL server and
> don't want to break anything.
> Also, will this have any impact on the performance of the SQL server?
>
how to audit local access to sql server
I am looking for a way to audit only local access to sql server 2000.
that is, I don't care about networked clients logging in to database, I
want to know everything that a user does who logs in at the local
console access.
is there a way to do this without buying an agent? can c2 auditing be
specific and ignore all remote access and only log the local sql server
2k interactions? I don't want to get swamped in a deluge of *all*
activity being logged, my application logs all client access to my
satisfaction. I want to now make sure no one can access database
locally and leave me with no log of activity...direct and local db
access...
thx,
rpfYou can set up a rolling serverside trace that filters on the hostname of
the local server
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"RPF" <richard_p_franklin@.yahoo.com> wrote in message
news:1129408525.096989.140790@.f14g2000cwb.googlegroups.com...
> hello
> I am looking for a way to audit only local access to sql server 2000.
> that is, I don't care about networked clients logging in to database, I
> want to know everything that a user does who logs in at the local
> console access.
> is there a way to do this without buying an agent? can c2 auditing be
> specific and ignore all remote access and only log the local sql server
> 2k interactions? I don't want to get swamped in a deluge of *all*
> activity being logged, my application logs all client access to my
> satisfaction. I want to now make sure no one can access database
> locally and leave me with no log of activity...direct and local db
> access...
> thx,
> rpf
>|||I'm interested in this also, but can you explain how exactly to do
this? I admin our IIS server, the SQL server was setup by a consultant
that went out of business. I'm not real good with the SQL server and
don't want to break anything.
Also, will this have any impact on the performance of the SQL server?|||The easiest way to generate the commands for a serverside trace is to use
the Profiler GUI (Start>Run>Profiler.exe). Select File>New>Trace, put in you
server name and then select the events you are interested in and set the
appropriate filters (click on help on the dialog to get details of what the
tabs do). Once you're happy with your selection click on Run and check that
the required events are being captured. If happy then stop the trace and
goto File>Script Trace>For SQL 2000. This will prompt you to save a sql
file. Open this using Query Analyzer and you will have the template for your
trace. In order to set this up on a rolling basis you will need to wrap the
template in a stored procedure in which you generate the filename (usually
based on the date). In order to start it automatically when sql starts you
can use sp_procoption (see BOL for details). I will try and post an
article/code on my site tonight. There can be a performance impact but it
depends on what you trace. As long as you don't trace statement level events
then the performance impact is generally negligible.
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
<brk100@.gmail.com> wrote in message
news:1129473547.688786.109990@.g14g2000cwa.googlegroups.com...
> I'm interested in this also, but can you explain how exactly to do
> this? I admin our IIS server, the SQL server was setup by a consultant
> that went out of business. I'm not real good with the SQL server and
> don't want to break anything.
> Also, will this have any impact on the performance of the SQL server?
>
how to audit local access to sql server
I am looking for a way to audit only local access to sql server 2000.
that is, I don't care about networked clients logging in to database, I
want to know everything that a user does who logs in at the local
console access.
is there a way to do this without buying an agent? can c2 auditing be
specific and ignore all remote access and only log the local sql server
2k interactions? I don't want to get swamped in a deluge of *all*
activity being logged, my application logs all client access to my
satisfaction. I want to now make sure no one can access database
locally and leave me with no log of activity...direct and local db
access...
thx,
rpfYou can set up a rolling serverside trace that filters on the hostname of
the local server
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"RPF" <richard_p_franklin@.yahoo.com> wrote in message
news:1129408525.096989.140790@.f14g2000cwb.googlegroups.com...
> hello
> I am looking for a way to audit only local access to sql server 2000.
> that is, I don't care about networked clients logging in to database, I
> want to know everything that a user does who logs in at the local
> console access.
> is there a way to do this without buying an agent? can c2 auditing be
> specific and ignore all remote access and only log the local sql server
> 2k interactions? I don't want to get swamped in a deluge of *all*
> activity being logged, my application logs all client access to my
> satisfaction. I want to now make sure no one can access database
> locally and leave me with no log of activity...direct and local db
> access...
> thx,
> rpf
>|||I'm interested in this also, but can you explain how exactly to do
this? I admin our IIS server, the SQL server was setup by a consultant
that went out of business. I'm not real good with the SQL server and
don't want to break anything.
Also, will this have any impact on the performance of the SQL server?|||The easiest way to generate the commands for a serverside trace is to use
the Profiler GUI (Start>Run>Profiler.exe). Select File>New>Trace, put in you
server name and then select the events you are interested in and set the
appropriate filters (click on help on the dialog to get details of what the
tabs do). Once you're happy with your selection click on Run and check that
the required events are being captured. If happy then stop the trace and
goto File>Script Trace>For SQL 2000. This will prompt you to save a sql
file. Open this using Query Analyzer and you will have the template for your
trace. In order to set this up on a rolling basis you will need to wrap the
template in a stored procedure in which you generate the filename (usually
based on the date). In order to start it automatically when sql starts you
can use sp_procoption (see BOL for details). I will try and post an
article/code on my site tonight. There can be a performance impact but it
depends on what you trace. As long as you don't trace statement level events
then the performance impact is generally negligible.
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
<brk100@.gmail.com> wrote in message
news:1129473547.688786.109990@.g14g2000cwa.googlegroups.com...
> I'm interested in this also, but can you explain how exactly to do
> this? I admin our IIS server, the SQL server was setup by a consultant
> that went out of business. I'm not real good with the SQL server and
> don't want to break anything.
> Also, will this have any impact on the performance of the SQL server?
>
how to AttachDbFilename in application's directory
How to Attach MS Access Database to MSDE
Message posted via http://www.sqlmonster.com
You cannot attach Access databse file (*.mdb/*.mde) to SQL Server/MSDE, they
are completely different thing , except for being called "database" and
being from MS. But you can use any available tools you know to transfer the
Access database (structure and/or data) to a database on MSDE. If you have
Access2K or later, open the Access *.mdb file, click menu "Tools->Database
Utilities->Upsizing Wizard...". It will lead you to "Upsize" your Access
database to SQL Server/MSDE database. After running the wizard, you may
still need to do some manual changes on the newly created database on MSDE
to make sure PK/Index, data types are OK, and since Access queries may not
may not be transferred into the database on MSDE, you definitely have
re-write some or all of queries you used in the Access file with views or
stored procedures in MSDE.
"Cedric Boo via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:aa84e44efc594341b542ca374dd4a3df@.SQLMonster.c om...
> I have a program installation setup that comes with a default MS Access
Database. How do I attach this default database into MSDE on my server?
> --
> Message posted via http://www.sqlmonster.com
|||Hello,
the upsizing tool crashed for me with a overflow error. I use MSDE2000a, that doesn't include the dtsrunui tool ,( so any help how i get a access db to msde2000a ? I check dtsrun , but im very confused how to use it. How i get the data from the access db,
which is a file not a server like dtsrun expected.
Message posted via http://www.sqlmonster.com
|||hi Alexander,
Alexander Baumgart via SQLMonster.com wrote:
> Hello,
> the upsizing tool crashed for me with a overflow error. I use
> MSDE2000a, that doesn't include the dtsrunui tool ,( so any help how
> i get a access db to msde2000a ? I check dtsrun , but im very
> confused how to use it. How i get the data from the access db, which
> is a file not a server like dtsrun expected.
regarding Access Upswize Wizard problems, please have a look at
http://support.microsoft.com/default...;EN-US;Q237980
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
how to attach Access database to MSDE
what is the procedure to attach a .MDB databse to MSDE?
I don't care using forms or report from the Access database, I just want to
have tables and queries on MSDE then I will analyze data and arrange comments
to them.
Thanks
Rocco
Hi,
You can not attach a Access database to SQL Server MSDE. This is due to
changes in architecture.Methods to transfer:-
1. SQL Server DTS to copy structure and data
2. Upsizing wizard (
http://www.mssqlcity.com/FAQ/General/MigFromAcc.htm )
Thanks
Hari
SQL Server MVP
"rocco" <rocco@.discussions.microsoft.com> wrote in message
news:0D42E485-DCCC-45E8-A2D4-5AE3A298E71A@.microsoft.com...
> Hello,
> what is the procedure to attach a .MDB databse to MSDE?
> I don't care using forms or report from the Access database, I just want
> to
> have tables and queries on MSDE then I will analyze data and arrange
> comments
> to them.
> Thanks
> Rocco
|||OK. ANy tutorial for the DTS? I have opened and since anything is labelled in
that sort of *MicrosoftCreeepingLanguage* I'm not able to use it.
Maybe is not the MicrosoftCreeping thing, but only that I'm not to good at
that!
"Hari Prasad" wrote:
> Hi,
> You can not attach a Access database to SQL Server MSDE. This is due to
> changes in architecture.Methods to transfer:-
> 1. SQL Server DTS to copy structure and data
> 2. Upsizing wizard (
> http://www.mssqlcity.com/FAQ/General/MigFromAcc.htm )
>
> Thanks
> Hari
> SQL Server MVP
>
> "rocco" <rocco@.discussions.microsoft.com> wrote in message
> news:0D42E485-DCCC-45E8-A2D4-5AE3A298E71A@.microsoft.com...
>
>
|||Hi,
This migration is very simple. Just open the Export and Import utility
wizard from SQL Server program group.
Select the source as Access and destination as SQL Server MSDE and select
dbname.
Now select the tables you need to copy. CLick next.
This wizard will automatically drags you till end and will copy the data to
SQL Server. So easy.
Thanks
Hari
SQL Server MVP
"rocco" <rocco@.discussions.microsoft.com> wrote in message
news:4093596D-D547-460D-B761-3F1373169432@.microsoft.com...[vbcol=seagreen]
> OK. ANy tutorial for the DTS? I have opened and since anything is labelled
> in
> that sort of *MicrosoftCreeepingLanguage* I'm not able to use it.
> Maybe is not the MicrosoftCreeping thing, but only that I'm not to good at
> that!
> "Hari Prasad" wrote:
Friday, March 23, 2012
How to allow use to exec xp_sendmail
The last part of the stored proc sends an email if certain conditions are met.
It appears that users do not have permission to execute xp_sendmail. I guess this is because it is executed on the master database. Is there a way I can give them permission to this stored proc?
The users are getting this message:
EXECUTE permission denied on bject 'xp_sendmail', 'database master', owner 'dbo'.(#229)You can grant a user to execute xp_sendmail by going to properties of xp_sendmail in master database and grant the user permission to execute.
how to Allow Multiple access to data base over network
access the data base at a time on the newtork, If more than one user
try accessing the database, it will frezee until the first to grab the
data base logs out. Please how do I solve this problem. I have sql 2000
enterprise edition running on the server.
Regards
Agboola.1default wrote:
> Hello All, I have a running/ woking database, but only one user can
> access the data base at a time on the newtork, If more than one user
> try accessing the database, it will frezee until the first to grab the
> data base logs out. Please how do I solve this problem. I have sql 2000
> enterprise edition running on the server.
> Regards
> Agboola.
>
First, check the database properties to make sure it's not in
Single-User mode. However, that doesn't sound like your problem.
What exactly freezes up? It sounds like your first user is doing
something that is blocking other users. You can confirm that by
querying the sysprocesses table in the master database, or by issuing
the command 'sp_who2' in Query Analyzer.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Looks like you have the database in restricted or single user mode. But you
should receive messages like these, instead of freezing the session:
Database 'Northwind' is already open and can only have one user at a time.
Database 'Northwind' is in restricted mode. Only the database owner and
members of the dbcreator and sysadmin roles can access it.
Try this first: Using Enterprise Manager, right-click your database,
Properties, select the Options tab and make sure the Restrict access option
is not checked.
Hope this helps,
Ben Nevarez, MCDBA, OCP
Database Administrator
"1default" wrote:
> Hello All, I have a running/ woking database, but only one user can
> access the data base at a time on the newtork, If more than one user
> try accessing the database, it will frezee until the first to grab the
> data base logs out. Please how do I solve this problem. I have sql 2000
> enterprise edition running on the server.
> Regards
> Agboola.
>
how to Allow Multiple access to data base over network
access the data base at a time on the newtork, If more than one user
try accessing the database, it will frezee until the first to grab the
data base logs out. Please how do I solve this problem. I have sql 2000
enterprise edition running on the server.
Regards
Agboola.1default wrote:
> Hello All, I have a running/ woking database, but only one user can
> access the data base at a time on the newtork, If more than one user
> try accessing the database, it will frezee until the first to grab the
> data base logs out. Please how do I solve this problem. I have sql 2000
> enterprise edition running on the server.
> Regards
> Agboola.
>
First, check the database properties to make sure it's not in
Single-User mode. However, that doesn't sound like your problem.
What exactly freezes up? It sounds like your first user is doing
something that is blocking other users. You can confirm that by
querying the sysprocesses table in the master database, or by issuing
the command 'sp_who2' in Query Analyzer.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Looks like you have the database in restricted or single user mode. But you
should receive messages like these, instead of freezing the session:
Database 'Northwind' is already open and can only have one user at a time.
Database 'Northwind' is in restricted mode. Only the database owner and
members of the dbcreator and sysadmin roles can access it.
Try this first: Using Enterprise Manager, right-click your database,
Properties, select the Options tab and make sure the Restrict access option
is not checked.
Hope this helps,
Ben Nevarez, MCDBA, OCP
Database Administrator
"1default" wrote:
> Hello All, I have a running/ woking database, but only one user can
> access the data base at a time on the newtork, If more than one user
> try accessing the database, it will frezee until the first to grab the
> data base logs out. Please how do I solve this problem. I have sql 2000
> enterprise edition running on the server.
> Regards
> Agboola.
>
Wednesday, March 21, 2012
How to allow access to every body
to all the employee to have access to my reports. I don't know why but, some
people can access to the reports. What should I do or stop ?
Thanks !Thought not suggested, you can edit the report properties, grant 'everyone'
browser right.
"MIB" wrote:
> It could be strange, but i would like to know what is the best way to allow
> to all the employee to have access to my reports. I don't know why but, some
> people can access to the reports. What should I do or stop ?
> Thanks !|||I assume you are using active directory to control security....Add a user
called everyone giving them browse, view folders etc.
"MIB" wrote:
> It could be strange, but i would like to know what is the best way to allow
> to all the employee to have access to my reports. I don't know why but, some
> people can access to the reports. What should I do or stop ?
> Thanks !
how to aduit database access?
background: sql2k on win2k3 server
i have an application which no longer has further development on it (so
that means no changes will be done thru front end interface of the
application). but new business policies require the aduit for database
access, such as who accesses the database at when and from where and so
on...(even for just read a table). I had expereinces writing triggers
to track inserts and edits, but not read only access.
is there a way to do so? some examples would be great! thank you.Of course updates and inserts can be easily audited with triggers. However,
if you attempt to audit every occurrance that every user reads from the
database, the size of your audit history will very soon exceed the size of
your database. For example, if a user queries 1000 records from a table,
will you make note of each individual record accessed or just the fact that
they accessed the table? These type events are perhaps better audited at the
application level. For example, User A looked at Purchase Order 122 @.
date/time.
"=== Steve L ===" <steve.lin@.powells.com> wrote in message
news:1117216416.350834.242620@.g47g2000cwa.googlegroups.com...
>
> background: sql2k on win2k3 server
> i have an application which no longer has further development on it (so
> that means no changes will be done thru front end interface of the
> application). but new business policies require the aduit for database
> access, such as who accesses the database at when and from where and so
> on...(even for just read a table). I had expereinces writing triggers
> to track inserts and edits, but not read only access.
> is there a way to do so? some examples would be great! thank you.
>|||"=== Steve L ===" <steve.lin@.powells.com> wrote in message
news:1117216416.350834.242620@.g47g2000cwa.googlegroups.com...
>
> background: sql2k on win2k3 server
> i have an application which no longer has further development on it (so
> that means no changes will be done thru front end interface of the
> application). but new business policies require the aduit for database
> access, such as who accesses the database at when and from where and so
> on...(even for just read a table). I had expereinces writing triggers
> to track inserts and edits, but not read only access.
> is there a way to do so? some examples would be great! thank you.
>
Here's an article discussing auditing in sql server 2k:
http://www.microsoft.com/technet/se...r/sql2kaud.mspx
In particular, the last section speaks to using server-side traces for
auditing. This is particularly attractive in situation where you need fine
grained control over the which activity should be captured.|||thanks for the reply.
i'm only interested in table access audit level, not down to record
level, that will be to much as you indicated. I also agreed that this
kind of audit can easily be done on the app level, but as i said, there
will be no more app development! that's why i'm looking into database
side solution.|||Using SQL Profiler, you can configure a trace events such as object
references or execution of a stored procedure, and the columns returned can
include the user id. The output of the trace can be sent to a database table
or file, and you will need to tweak it so that it returns only the
information you really need. Perhaps you can implement a scheduled job that
periodically purges the table to keep it from getting too large. Of course
SQL Profiler will need be always running for this to work.
"=== Steve L ===" <steve.lin@.powells.com> wrote in message
news:1117220601.221951.53120@.g44g2000cwa.googlegroups.com...
> thanks for the reply.
> i'm only interested in table access audit level, not down to record
> level, that will be to much as you indicated. I also agreed that this
> kind of audit can easily be done on the app level, but as i said, there
> will be no more app development! that's why i'm looking into database
> side solution.
>|||Tracking database activity
http://www.microsoft.com/technet/se...r/sql2kaud.mspx
--
Programmer
"=== Steve L ===" wrote:
>
> background: sql2k on win2k3 server
> i have an application which no longer has further development on it (so
> that means no changes will be done thru front end interface of the
> application). but new business policies require the aduit for database
> access, such as who accesses the database at when and from where and so
> on...(even for just read a table). I had expereinces writing triggers
> to track inserts and edits, but not read only access.
> is there a way to do so? some examples would be great! thank you.
>|||If you are willing to look at 3rd party tools and have the budget there are
several auditing solutions available. www.lumigent.com is one for example.
"=== Steve L ===" <steve.lin@.powells.com> wrote in message
news:1117216416.350834.242620@.g47g2000cwa.googlegroups.com...
>
> background: sql2k on win2k3 server
> i have an application which no longer has further development on it (so
> that means no changes will be done thru front end interface of the
> application). but new business policies require the aduit for database
> access, such as who accesses the database at when and from where and so
> on...(even for just read a table). I had expereinces writing triggers
> to track inserts and edits, but not read only access.
> is there a way to do so? some examples would be great! thank you.
>sql
Monday, March 19, 2012
How to add record thru command button in adp.
In access database project where my tables are linked from MSSQL server, how can I add record from the FORM itself using command button. Bcz it is not like mdb files in access that you can just drag a command button onto the form and take an action like add, delete, print or find rec. I just came to know it from immediate window using following SQL line;
Docmd.RunSql "Insert......
This is ok but how it could be done thru a command button on FORM.
Thanks in advance.
With kind regards,
AshfaqueYou can use RunSQL with an ADP file. Or you can call an INSERT procedure on your SQL Server database.|||Hi blindman,
Bcz I am new to adp, can you please extend your help in more detail. I never used adp and its prodedure. How can I do it. Do I need to create a function / procedure? If so. How..Need to know badly. . Help in this regards will be higly appriciated.
Thanks a lot.
Ashfaque|||In an ADP application, no data is stored in Microsoft Access. It is all stored on the back-end server.
You can put code in the modules or forms in the ADP file, but it should be limited to affecting the behavior of the user interface. Your business logic should be implemented in stored procedures, views, and user-defined functions on your database server.
For an explanation of how to write TSQL code for SQL Server, look up VIEWS and STORED PROCEDURES in Books Online.|||Thanks again blindman,
I will check it.
With regards,
Ashfaque
Friday, March 9, 2012
how to add autonumber (increment) unique ID to sqlserver
I am a newbie learning sql server. I used to use Access table where I set the primary ID (int) as autonumber. Every insert will generate a new ID, which is incremented by 1.
How do I add an INSERT statement to add the incrementing primary ID in sql server. I noticed that you can't set the ID to autonumber as you do in Access. I read that you can set the ID as identity, which can auto increment.
How do I handle this in the INSERT cmd. The only thought is to call a sql cmd with a max on the current id and increment by 1 in vbscript. Afterwards, add the increment ID into the INSERT call.
Is there an easier way to do this?
Thanks,
JohnHi John,
Correct. You can't write to an identity field (and I didn't know you could in Access). You don't write to it, so don't include that field in your insert statement.
If you need the new ID number, return the value from the SQL Server SCOPE_IDENTITY function after you insert the row, either by returning it from your stored procedure or immediately after doing the insert. And you can batch them together so that you have only one round trip to the SQL Server server.
And there are lots of ways to do this, depending on the needs of your application.
Is that enough information? If not, just ask. It's pretty straightforward once you get to know SQL Server a bit.
Don
How to add assembly in GAC to SQL 2005?
I want use Microsoft.Office.Interop.Excel to access excel file my clr. But that assembly is installed in GAC. How could I register it in SQL 2005?
thanks!
You can copy the .dll file out of the GAC and try to register it. I have not tried this assembly, but I would expect that there may be some issues using it within SQL Server. You could give it a shot, of course.Cheers,
-Isaac|||
Hi,
I am also trying to use Microsoft.Office.Interop.Excel within my CLR stored procedure. I added <Reference Include="Microsoft.Office.Interop.Excel" /> as an <ItemGroup> in the project file. That allowed me to have access to the namespace and build the stored procedure successfully. However, when I try to deploy the stored procedure, I get the same error as the initial post "Assembly 'microsoft.office.interop.excel, version=12.0.0.0, culture=neutral, publickeytoken=71e9bce111e9429c.' was not found in the SQL catalog."
So how do you copy the dll from the GAC and register it? Windows Explorer does not give me a copy option. Assuming the Microsoft.Office.Interop.Excel dll can be copied, would you use the "CREATE ASSESSMBLY" command to register it?
Any help is greatly appreciated.
Rocco
|||Rocco Mastrangelo wrote:
So how do you copy the dll from the GAC and register it? Windows Explorer does not give me a copy option. Assuming the Microsoft.Office.Interop.Excel dll can be copied, would you use the "CREATE ASSESSMBLY" command to register it?
Normally interop assemblies (as well as system assemblies) located in the gac also has a location outside the GAC, but I can not find the Excel.dll. If it had a location outside you would then run CREATE ASSEMBLY against it in that location.
As I can't find it you have to do it as Isaac says. Use command line and cd to where the physical location of that assembly in the GAC: windows\assembly\gac\Microsoft.Office.Interop.Excel\12.0.0.0__71e9bce111e9429c
copy it from there to somewhere on your hard-drive and run CREATE ASSEMBLY against it. However, this assembly has dependencies on other assemblies (use ILDASM to view the dependencies) . So you need to copy those as well out of the GAC, unless they are assemblies that SQL Server loads from the GAC (such as mscorlib, System.Data etc) and put them in the same location as your original assembly. Notice that these dependency assemblies can have dependencies on other assemblies too.
Finally, you have to create the assembly with permission set UNSAFE.
Niels
How to add assembly in GAC to SQL 2005?
I want use Microsoft.Office.Interop.Excel to access excel file my clr. But that assembly is installed in GAC. How could I register it in SQL 2005?
thanks!
You can copy the .dll file out of the GAC and try to register it. I have not tried this assembly, but I would expect that there may be some issues using it within SQL Server. You could give it a shot, of course.Cheers,
-Isaac|||
Hi,
I am also trying to use Microsoft.Office.Interop.Excel within my CLR stored procedure. I added <Reference Include="Microsoft.Office.Interop.Excel" /> as an <ItemGroup> in the project file. That allowed me to have access to the namespace and build the stored procedure successfully. However, when I try to deploy the stored procedure, I get the same error as the initial post "Assembly 'microsoft.office.interop.excel, version=12.0.0.0, culture=neutral, publickeytoken=71e9bce111e9429c.' was not found in the SQL catalog."
So how do you copy the dll from the GAC and register it? Windows Explorer does not give me a copy option. Assuming the Microsoft.Office.Interop.Excel dll can be copied, would you use the "CREATE ASSESSMBLY" command to register it?
Any help is greatly appreciated.
Rocco
|||Rocco Mastrangelo wrote:
So how do you copy the dll from the GAC and register it? Windows Explorer does not give me a copy option. Assuming the Microsoft.Office.Interop.Excel dll can be copied, would you use the "CREATE ASSESSMBLY" command to register it?
Normally interop assemblies (as well as system assemblies) located in the gac also has a location outside the GAC, but I can not find the Excel.dll. If it had a location outside you would then run CREATE ASSEMBLY against it in that location.
As I can't find it you have to do it as Isaac says. Use command line and cd to where the physical location of that assembly in the GAC: windows\assembly\gac\Microsoft.Office.Interop.Excel\12.0.0.0__71e9bce111e9429c
copy it from there to somewhere on your hard-drive and run CREATE ASSEMBLY against it. However, this assembly has dependencies on other assemblies (use ILDASM to view the dependencies) . So you need to copy those as well out of the GAC, unless they are assemblies that SQL Server loads from the GAC (such as mscorlib, System.Data etc) and put them in the same location as your original assembly. Notice that these dependency assemblies can have dependencies on other assemblies too.
Finally, you have to create the assembly with permission set UNSAFE.
Niels
Wednesday, March 7, 2012
How to add an image to an SQL Server database
Hi all,
I have a field in the SQL Server database, with 'Image' ad field type.
How can I add a jpeg fiel to it so that I can view it and also access it through a program?
Thanks
Tomy
here
http://www.beansoftware.com/ASP.NET-Tutorials/Images-Database.aspx
Sunday, February 19, 2012
How to access!
I want to know how can I access to SQL Server 7.0 (installed on windows 2000) from Other platforms line Win9X in a visual basic program.
Please tell me complete story,
1) What I have to do on server (windows 2000 - MSSQL 7.0)
2) What I have to do on clients (Windows 9X)
3) Connection string to connect to server from client in VB 6.0 language
Thanks :)Ali,
This is a pretty big topic, and you might be better off talking with VB programmers than Database Gurus.
Your VB documentation should tell you how to go about getting data from outside datasources.
My short answer: ODBC connections.
blindman|||Originally posted by blindman
Ali,
This is a pretty big topic, and you might be better off talking with VB programmers than Database Gurus.
Your VB documentation should tell you how to go about getting data from outside datasources.
My short answer: ODBC connections.
blindman
Just a question:
Is there any configuration nedded on Server and Client system?|||Ali,
This is a pretty big topic, and you might be better off talking with VB programmers than Database Gurus.
Your VB documentation should tell you how to go about getting data from outside datasources.
My short answer: ODBC connections.
Unatratnag
1) What I have to do on server (windows 2000 - MSSQL 7.0)
you have to create the database, and if you're doing odbc, then you'll need to create the odbc on the pc where the application resides
2) What I have to do on clients (Windows 9X)
write the code to connect to the database =P
3) Connection string to connect to server from client in VB 6.0 language
well if you have access to the database files create a .udl file and then double click it and it will allow you to create a connection string through the gui, open it back up in notepad and the connection string is the third line.|||People talking about ODBC are running behind for two Microsoft Data Access generations. After ODBC (related to DAO = Data Access Objects) came ADO (= ActiveX Data Objects) with its collection of OLE DB providers, needing as you asked connectionstrings. Currently, we are living in the ADO.NET age, however, you are working with VB 6, which means you would have to choose ADO.
You don't need any extra installations on your server.
On your Win9x client, you need to start with DCOM98. Furthermore, you need MDAC, preferably the latest version 2.7 SP1a. You may browse the www.keper.com (ftp://dbxprof:dbxprof@.FTP server of my DB Explorer for the installations, and you find some hints in the installation manual.
For a discussion of the connection string in trusted environments, or with DB security see ABLE Consulting (http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForSQLServer). However, you may also want to build a connection string. Herefore, Microsoft utilizes Data Link Property forms, which can be accessed within your application.|||The FTP server link doesn't work. It is DB Explorer (ftp://dbxprof:dbxprof@.213.84.56.3/)|||setup an ADODB connection, use SQLOLEDB as the connection provider.|||I don't think there are Gurus here, just a bunch of people with no life :)
amirnezhad,
The topic may be big, but not the task. What is it you're trying to do? If you want to learn and looking for the way to start, then follow DoktorBlue's links. But if you were given a task to do a specific thing, then post it and someone may give you the whole answer.
P.S.: Since you're from Tehran, how are things looking from there?|||rocheyc: can't figure out the added vaue of your contribution, please help me.
rdjabarov: sounds like you are proposing a new exciting thread about guru properties. Is it really the number of contributions? Or the lack of social life? Or just the nick name? :confused: Maybe the real gurus know ?! ;)|||Originally posted by DoktorBlue
rocheyc: can't figure out the added vaue of your contribution, please help me.
Funny, when I read your post I felt the same way about you!
Originally posted by DoktorBlue
rdjabarov: sounds like you are proposing a new exciting thread about guru properties. Is it really the number of contributions? Or the lack of social life? Or just the nick name? :confused: Maybe the real gurus know ?! ;)
Yes, DoktorBlue the real qurus know.|||Thanks, Paul, you let me see that real gurus don't contribute to the topic, right?
I'd prefer to move further discussions in a new thread, or to keep it private.|||I see the p***ing contest is starting again. Well, I'll be here in the front row watching. Is it time to place bets yet?
How to access Webservice from SQL Server 2000
How to access / invoke a webservice from SQL Server 2000? i.e, from within a
SP i would like to call an existing webservice.
I know using HTTPEndPoints we can do that in SQL 2005. Is there any work
arounds in SQL 2k?
Regards
PradeepI am not too sure whether this is what you are looking for! Anyways just
check this out
http://msdn.microsoft.com/msdnmag/issues/02/05/SQLXML3/ -- Build
Data-Driven Web Services with Updated XML Support for SQL Server 2000
Best Regards
Vadivel
http://vadivel.blogspot.com
"SqlBeginner" wrote:
> Hi All,
> How to access / invoke a webservice from SQL Server 2000? i.e, from within
a
> SP i would like to call an existing webservice.
> I know using HTTPEndPoints we can do that in SQL 2005. Is there any work
> arounds in SQL 2k?
> Regards
> Pradeep|||It's not easy and I'm not sure if you can do it but you may be able to
access a DLL from the sp_OA* OLE automation procs. The DLL would likely
need to have a COM+ wrapper. The DLL would then call the web service. I
haven't tried this, though.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"SqlBeginner" <SqlBeginner@.discussions.microsoft.com> wrote in message
news:9B8A5DE2-08AB-4BCB-9EA7-1557D6CE7541@.microsoft.com...
Hi All,
How to access / invoke a webservice from SQL Server 2000? i.e, from within a
SP i would like to call an existing webservice.
I know using HTTPEndPoints we can do that in SQL 2005. Is there any work
arounds in SQL 2k?
Regards
Pradeep|||Just make sure it doesn't wrap any managed code:
http://support.microsoft.com/defaul...kb;en-us;322884
:-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OvPR%23LyfGHA.2188@.TK2MSFTNGP04.phx.gbl...
> It's not easy and I'm not sure if you can do it but you may be able to
> access a DLL from the sp_OA* OLE automation procs. The DLL would likely
> need to have a COM+ wrapper. The DLL would then call the web service. I
> haven't tried this, though.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> "SqlBeginner" <SqlBeginner@.discussions.microsoft.com> wrote in message
> news:9B8A5DE2-08AB-4BCB-9EA7-1557D6CE7541@.microsoft.com...
> Hi All,
> How to access / invoke a webservice from SQL Server 2000? i.e, from within
a
> SP i would like to call an existing webservice.
> I know using HTTPEndPoints we can do that in SQL 2005. Is there any work
> arounds in SQL 2k?
> Regards
> Pradeep
>|||Well, there ya go. Another reason to move on to SQL 2005. ;-)
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uA0$eYyfGHA.1792@.TK2MSFTNGP03.phx.gbl...
Just make sure it doesn't wrap any managed code:
http://support.microsoft.com/defaul...kb;en-us;322884
:-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OvPR%23LyfGHA.2188@.TK2MSFTNGP04.phx.gbl...
> It's not easy and I'm not sure if you can do it but you may be able to
> access a DLL from the sp_OA* OLE automation procs. The DLL would likely
> need to have a COM+ wrapper. The DLL would then call the web service. I
> haven't tried this, though.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> "SqlBeginner" <SqlBeginner@.discussions.microsoft.com> wrote in message
> news:9B8A5DE2-08AB-4BCB-9EA7-1557D6CE7541@.microsoft.com...
> Hi All,
> How to access / invoke a webservice from SQL Server 2000? i.e, from within
> a
> SP i would like to call an existing webservice.
> I know using HTTPEndPoints we can do that in SQL 2005. Is there any work
> arounds in SQL 2k?
> Regards
> Pradeep
>|||How many web services actually existed in 1999/2000?
ML
http://milambda.blogspot.com/|||Well said.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"ML" <ML@.discussions.microsoft.com> wrote in message
news:DDACAEC9-BF52-48F2-9C9E-5E4E0E27433D@.microsoft.com...
How many web services actually existed in 1999/2000?
ML
http://milambda.blogspot.com/