Showing posts with label friends. Show all posts
Showing posts with label friends. Show all posts

Tuesday, March 27, 2012

Accessing Global Cursor

hi friends,

Here is the stored procedures that I used.

--------------------------
create procedure globalCursor
AS
DECLARE abc CURSOR GLOBAL FOR
select * from sales
OPEN abc

create procedure globalCursorTest
AS
DECLARE @.sdate datetime
DECLARE @.sperson varchar(15)
DECLARE @.sregion varchar(15)
DECLARE @.sales int
EXECUTE globalCursor
FETCH NEXT FROM abc INTO @.sdate, @.sperson, @.sregion, @.sales
print @.sdate
print @.sperson
print @.sregion
print @.sales
--------------------------

When I execute globalCursorTest using SQL Query Analyser, it says

--------------------------
Server: Msg 16915, Level 16, State 1, Procedure globalCursor, Line 4
A cursor with the name 'abc' already exists.
Server: Msg 16905, Level 16, State 1, Procedure globalCursor, Line 5
The cursor is already open.
--------------------------

how to solve this? or in other words, how to simply create the procedure in the database without executing it, as i can see the execution of the first procedure globalCursor causes this problem.

JakeLooks like the abc cursor is not closed/deallocated. Does either one of the procedures perform these actions?|||Ummm...

Do you have an Oracle background?

To my knowledge it doesn't work that way, though I'll go test it out...

And yes, as Kaiowas points out you need to

CLOSE ABC
DEALLOCATE ABC

But still, it looks like you're trying to mimic reference CURSORs like Oracle has...|||hi brett,

I'm new to database and doing DB2 to SQL server migration tool project.
In DB2, one procedure can access the cursors opened by another procedure, after calling it. The called procedure will not return the cursor and it will not even have the cursor as the output parameter. But it will just open the cursor at the end of the procedure and the cursor is specially declared with the clause 'WITH RETURN TO CALLER/CLIENT'.

The calling procedure just allocate cursors to the result sets opened by the called procedure, in the order.

I thought I can achieve this using Global cursor in sql server, but i'm not sure. That's what I am trying.

Yes, I agree that I missed to put CLOSE abc & DEALLOCATE abc at the end of the second procedure.
but that will not solve my problem.
I like to know how to just create the procedure in the sql server database without executing it, as i can guess the cause of the problem 'cursor already opened' is due to the execution of the first procedure while I try to create it in the database.

Appreciate your he
Jake

Originally posted by Brett Kaiser
Ummm...

Do you have an Oracle background?

To my knowledge it doesn't work that way, though I'll go test it out...

And yes, as Kaiowas points out you need to

CLOSE ABC
DEALLOCATE ABC

But still, it looks like you're trying to mimic reference CURSORs like Oracle has...|||anybody know about this....

Originally posted by Jake K
hi brett,

I'm new to database and doing DB2 to SQL server migration tool project.
In DB2, one procedure can access the cursors opened by another procedure, after calling it. The called procedure will not return the cursor and it will not even have the cursor as the output parameter. But it will just open the cursor at the end of the procedure and the cursor is specially declared with the clause 'WITH RETURN TO CALLER/CLIENT'.

The calling procedure just allocate cursors to the result sets opened by the called procedure, in the order.

I thought I can achieve this using Global cursor in sql server, but i'm not sure. That's what I am trying.

Yes, I agree that I missed to put CLOSE abc & DEALLOCATE abc at the end of the second procedure.
but that will not solve my problem.
I like to know how to just create the procedure in the sql server database without executing it, as i can guess the cause of the problem 'cursor already opened' is due to the execution of the first procedure while I try to create it in the database.

Appreciate your he
Jake|||"In DB2, one procedure can access the cursors opened by another procedure, after calling it."

Sounds like a recipe for scope disaster to me. As if cursors weren't bad enougth to begin with.|||I guess my best suggestion would be to rewrite your cursor procedure as a table function.|||hi,

it's definitely not scope disaster!!! By default, the cursors opened in a procedure could not be accessed from another procedure. If one wants this kind of feature, the cursor has to be specially declared with the option "WITH RETURN TO CALLER/CLIENT". It's like Sequel's local & global cursor concept. In global cursor, the cursor can be accessed from outside where it is declared.

Jake

Originally posted by blindman
"In DB2, one procedure can access the cursors opened by another procedure, after calling it."

Sounds like a recipe for scope disaster to me. As if cursors weren't bad enougth to begin with.|||thanks for your suggestion. as of now, i don't know about table function. I will try it out...
but i have another way of achieving this. the procedure that i attached in the starting mail is working fine, of course after including close & disallocate stmts at the end of the second procedure, globalCursorTest.
previously i used SQL Query Analyser GUI which will compile & execute the procedure at one shot. Thus the globalCursor procedure executed twice, which caused the 'cursor already opened' error.
As I mentioned in my earlier mails, i search for a mechanism which will only compile & create the procedure into the db without executing it. I find isql command line tool creates the procedure into the db without executing it.
After creating both the procedures, i executed second procedure, globalCursorTest. It works fine.

friends, Thanks for your time.

Jake

Originally posted by blindman
I guess my best suggestion would be to rewrite your cursor procedure as a table function.

Sunday, March 25, 2012

accessing database problem

Hello friends when I am working in VWD and accessing sql data this error came?

I am using asp.net visual web developer edition and sql server 2005 expressedition.

plz check it out and help me.

The log scan number (588:85:1) passed to log scan in database 'D:\GCAP\APP_DATA\GRIET_IT.MDF' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
Could not open new database 'D:\GCAP\APP_DATA\GRIET_IT.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file D:\GCAP\App_Data\GRIET_IT.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: The log scan number (588:85:1) passed to log scan in database 'D:\GCAP\APP_DATA\GRIET_IT.MDF' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
Could not open new database 'D:\GCAP\APP_DATA\GRIET_IT.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file D:\GCAP\App_Data\GRIET_IT.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): The log scan number (588:85:1) passed to log scan in database 'D:\GCAP\APP_DATA\GRIET_IT.MDF' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
Could not open new database 'D:\GCAP\APP_DATA\GRIET_IT.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file D:\GCAP\App_Data\GRIET_IT.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +171
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2406
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +34
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +223
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +371
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +184
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +193
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +501
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +429
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +70
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +510
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +89
System.Data.SqlClient.SqlConnection.Open() +159
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +118
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +82
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1653
System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +82
System.Web.UI.WebControls.ListControl.PerformSelect() +18
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61
System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26
System.Web.UI.Control.PreRenderRecursiveInternal() +88
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5684



Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

Hi radhekrishna,

The error message indicates that either the database file you are trying to attached has already been attached in sql express or there is data corruption in your database file(.mdf file) , thus the db file could not be attached. I would suggest you connect to your sql express server through management studio to make a verification (Note here that since Sql Express use customer instance, in management studio, you must login using the same account as the one you used in your application). If that db file has been attached, detach it and take another try.

If there is no such file attached already in your sql express, I would suggest you first attach that mdf file to your database. If you still get this error, it means that the mdf file is data corrupted (information in ldf file and mdf file does not match) and cannot be used anymore--You need to restore it then.

Hope my suggestion helps

accessing data related to current week from list of all weeks

hi friends,

I m new to asp.net... actually i have an application where the data for current week needs to be displayed from all the data present in different weeks.actually i want to retrieve the syllabus of current week from all weeks

i used the below query but itz not working

sqlString = "SELECT DATEPART(ww,sylWeeKID)AS Week FROM SylWeeks WHERE SyllabusIDFK= " & SylId & " GROUP BY DATEPART(ww,sylWeeKID) "

..can anyone suggest me how to retrieve data for current week , for a related item

thanks in advance

i need urgent help.

select begin_of_week = dateadd(week, datediff(week, 0, getdate()), 0),
end_of_week = dateadd(week, datediff(week, 0, getdate()) + 1, -1)|||

You can try the following:

SELECT *FROM SylWeeksWHERE sylWeeKID>=dateadd(wk,datediff(wk, 0,getdate()), -1)AND sylWeeKID<dateadd(wk,datediff(wk, 0,getdate())+1, -1)
|||

could you try following

select * from tablename where datepart(wk, datefiled) = datepart(wk,getdate())

thanks,

satish.

|||

Hi khtan,

Thanks alot for your help,

actually the query that u sent helped me with little modification...actually i wanted to select sylweeksid

condition 1: where syllabusIdfk="& sylId & ",which is a foreign key

condition 2: sylweekid should return only current week criteria...that worked...which uu suggested

but i wanted to have condition 1 also in it...it is not working in any respect ??

i did following:

sqlString = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ") AND (startdate=dateadd(week,datediff(week,0,getdate()),-1))AND (Enddate=dateadd(week,datediff(week,0,getdate())+1,-1)) "

but its not working

can u help.

thanks

overview:

tablename1: sylweeks----fields--sylweekid(primary key),sylweekcode,syllabusidfk(foreign key) ,sortorder--startdate,enddate

tablename2: syllabus--fields syllabusid(primary key),ImeIdfk(foreign key),course id

|||

Hi limno,

Thanks alot for your help,

actually the query that u sent helped me with little modification...actually i wanted to select sylweeksid

condition 1: where syllabusIdfk="& sylId & ",which is a foreign key

condition 2: sylweekid should return only current week criteria...that worked...which uu suggested

but i wanted to have condition 1 also in it...it is not working in any respect ??

i did following:

sqlString = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ") AND (startdate=dateadd(week,datediff(week,0,getdate()),-1))AND (Enddate=dateadd(week,datediff(week,0,getdate())+1,-1)) "

but its not working

can u help.

thanks

overview:

tablename1: sylweeks----fields--sylweekid(primary key),sylweekcode,syllabusidfk(foreign key) ,sortorder--startdate,enddate

tablename2: syllabus--fields syllabusid(primary key),ImeIdfk(foreign key),course id

|||

Hi limno,

Thanks alot for your help,

can u check my query in one of the replies, i m not able to duplicate it.

thanks

|||

hi satish

thanks for your help,

can u check my query ,i m not able to duplicate it.

thanks

amanat

|||

sqlString = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ") AND (startdate>=dateadd(week,datediff(week,0,getdate()),-1))AND (Enddate<dateadd(week,datediff(week,0,getdate())+1,-1)) "

|||

Hi limno,

Thanks alot it worked...

thank u so much

amanat

i dont know how to give points at this time...but will surely

thanks alot

|||

Hi Limno,

I wan to add another query

Sqlstring1 = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ")order by sortorder"

which state that if there is no week that matches current date then first week present in database should be executed ..

please guide me where i should fix it

Public

OverloadsSharedFunction getFirstWeekId(ByVal SylIdAs Int32)AsInteger'this function returns the ID of the first week of the sylbi'It is used to seed the sylabus detail page when the page first loadsDim connAs SqlConnectionDim cmdAs SqlCommandDim countAs Int32Dim sqlStringAsString'Dim Sqlstring1 As StringDim drAs SqlDataReader

conn =

New SqlConnection

cmd =

New SqlCommand'the query

sqlString = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ") AND (startdate>=dateadd(week,datediff(week,0,getdate()),-1))AND (Enddate<dateadd(week,datediff(week,0,getdate())+1,-1)) "

conn.ConnectionString = ConfigurationSettings.AppSettings("ConnStr")

cmd.CommandType = CommandType.Text

cmd.CommandText = sqlString

Try

cmd.Connection = conn

IfNot conn.State = ConnectionState.OpenThen

conn.Open()

EndIf

dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)

If dr.HasRows =TrueThen

dr.Read()

ReturnCInt(dr.Item(0))EndIf

Catch exAs ExceptionThrow exFinally

dr.Close()

EndTryEndFunction

---------------

If (Session("curWEEK"))IsNothingThen

week = -1

EndIf'The following case statement checks the value of weekSelectCase weekCase -1'if week is set to -1 that means the session variable curWEEK has not been set'hence this is possibly the initial rendering of the syllabus.' since this is the initial visit, the syllabus is rendered with' the first week of the syllabus.

week = daWeeks.getFirstWeekId(

CInt(Session("SylId")))

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))

Case 0'if week is set to 0 then the user has selected to view all weeks'so all weeks are rendered to the syllabus (this is can effect performance

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))CaseElse'if week is set to any other value, the user has selected to view a specific week'that week ID is the value of week' that specific week is rendered to the syllabus

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))EndSelect

|||

Hi Limno,

I wan to add another query

Sqlstring1 = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ")order by sortorder"

which state that if there is no week that matches current date then first week present in database should be executed ..

please guide me where i should fix it

Public

OverloadsSharedFunction getId(ByVal SylIdAs Int32)AsInteger'this function returns the ID of the first week of the sylbiDim connAs SqlConnectionDim cmdAs SqlCommandDim countAs Int32Dim sqlStringAsStringDim drAs SqlDataReader

conn =

New SqlConnection

cmd =

New SqlCommand

sqlString = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ") AND (startdate>=dateadd(week,datediff(week,0,getdate()),-1))AND (Enddate<dateadd(week,datediff(week,0,getdate())+1,-1)) "

conn.ConnectionString = ConfigurationSettings.AppSettings("ConnStr")

cmd.CommandType = CommandType.Text

cmd.CommandText = sqlString

Try

cmd.Connection = conn

IfNot conn.State = ConnectionState.OpenThen

conn.Open()

EndIf

dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)

If dr.HasRows =TrueThen

dr.Read()

ReturnCInt(dr.Item(0))EndIf

Catch exAs ExceptionThrow exFinally

dr.Close()

EndTryEndFunction

---------------

If (Session("curWEEK"))IsNothingThen

week = -1

EndIf'The following case statement checks the value of weekSelectCase weekCase -1'if week is set to -1 that means the session variable curWEEK has not been set

week = daWeeks.getId(

CInt(Session("SylId")))

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))

Case 0

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))CaseElse'if week is set to any other value, the user has selected to view a specific week

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))EndSelect

Thanks alot once again for your kind help

|||

Hi Limno,

I wan to add another query

Sqlstring1 = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ")order by sortorder"

which state that if there is no week that matches current date then first week present in database should be executed ..

please guide me where i should fix it

Public

OverloadsSharedFunction getId(ByVal SylIdAs Int32)AsInteger'this function returns the ID of the first week of the sylbiDim connAs SqlConnectionDim cmdAs SqlCommandDim countAs Int32Dim sqlStringAsStringDim drAs SqlDataReader

conn =

New SqlConnection

cmd =

New SqlCommand

sqlString = "Select sylWeekId FROM SylWeeks Where (syllabusIDFK=" & SylId & ") AND (startdate>=dateadd(week,datediff(week,0,getdate()),-1))AND (Enddate<dateadd(week,datediff(week,0,getdate())+1,-1)) "

conn.ConnectionString = ConfigurationSettings.AppSettings("ConnStr")

cmd.CommandType = CommandType.Text

cmd.CommandText = sqlString

Try

cmd.Connection = conn

IfNot conn.State = ConnectionState.OpenThen

conn.Open()

EndIf

dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)

If dr.HasRows =TrueThen

dr.Read()

ReturnCInt(dr.Item(0))EndIf

Catch exAs ExceptionThrow exFinally

dr.Close()

EndTryEndFunction

---------------

If (Session("curWEEK"))IsNothingThen

week = -1

EndIf'The following case statement checks the value of weekSelectCase weekCase -1'if week is set to -1 that means the session variable curWEEK has not been set

week = daWeeks.getId(

CInt(Session("SylId")))

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))

Case 0

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))CaseElse'if week is set to any other value, the user has selected to view a specific week

doc.LoadXml(Syllabus.CreateRoot(

CType(Session("sylID"), Int32), week))EndSelect

Thanks alot once again for your kind help

Thursday, March 22, 2012

Accessing Analysis Services 2005 from MS Excel using HTTP from Windows 2000 Server

Hye Friends,
I have installed and configured SQL Server 2005 Analysis Services and MS Office 2000 with the latest Service Packs on Windows 2000 Server. I am able to connect to my Analysis Services from MS Excel using the following URl in Excel ...
http://<ip address>/olap/msmdpump.dll ("olap" being my Virtual Directory)
I was wondering whether I would be able to connect to the same service without using the fully qualified path with only IP-Address... i.e... using only
http://<ip address>
I have been able to implement the above in Windows 2003 Server, but having problems doing the same in Windows 2000 Server. Can anyone help?
Thanks in Advance

How were you able to do so in Windows 2003? I've tried using IIS 6.0 to redirect, but without success.

Tuesday, March 6, 2012

Access SQL to Transact SQL - Translator?

Friends,
I am new to SQL Server, and I access it mainly through
Access (ODBC DSN).
I need my queries to run faster, so I want to switch from
regular Access queries against linked SQL tables to faster
pass-through queries written in Transact SQL.
QUESTION: Does anyone know of an easy way to translate
Access SQL into Transact SQL - in other words, a way to
copy the Access SQL from SQL View, and paste it into a
translator?
Thanks in advance ...
"bill morgan" <willmorgan@.lisco.com> wrote in message
news:3f3d01c4a5bc$4dbaf7f0$a301280a@.phx.gbl...
> I am new to SQL Server, and I access it mainly through
> Access (ODBC DSN).
> I need my queries to run faster, so I want to switch from
> regular Access queries against linked SQL tables to faster
> pass-through queries written in Transact SQL.
If you want performance you may want to consider using SQL Server VIEWS and
Stored Procedures.

> QUESTION: Does anyone know of an easy way to translate
> Access SQL into Transact SQL - in other words, a way to
> copy the Access SQL from SQL View, and paste it into a
> translator?
There is no "easy" way to do this since the SQL syntax is different between
these 2 products.
On suggestion though, you could try running SQL Profiler and capture the SQL
Server SQL generated by an Access query. This you might be able to translate
into an SQL Server View or Stored Procedure.
Steve
|||Steve,
Thanks for your response. Actually, I have been capturing
the Access SQL, and generally it is simple to translate it
into Transact SQL. It gets sticky, though, when trying to
translate computed fields. For example, SQL Server does
not accept IIF() functions, so I have to come up with
alternative syntax and structure.
Thanks again ...[vbcol=seagreen]
>--Original Message--
>"bill morgan" <willmorgan@.lisco.com> wrote in message
>news:3f3d01c4a5bc$4dbaf7f0$a301280a@.phx.gbl...
from[vbcol=seagreen]
faster
>If you want performance you may want to consider using
SQL Server VIEWS and
>Stored Procedures.
>
>There is no "easy" way to do this since the SQL syntax is
different between
>these 2 products.
>On suggestion though, you could try running SQL Profiler
and capture the SQL
>Server SQL generated by an Access query. This you might
be able to translate
>into an SQL Server View or Stored Procedure.
>Steve
>
>.
>

Saturday, February 11, 2012

Access for the user

Dear Friends
I want to create a user for one database in the server so that he can do all
the admin task such as Backup, Restore, Modification for table, Proceduers,
Views and Functions.
But should not have access to another databases. Please suggest how i can do
the same.
Best regardsHi,
Assign the DB_OWNER database fixed role to the user. This will allow him the
admin tasks in that particular database.
Thanks
Hari
SQL Server MVP
"Sharad2005" <niitmalad@.yahoo.co.uk> wrote in message
news:16CA54CC-25A9-49FE-A9B4-001C0E0ED96E@.microsoft.com...
> Dear Friends
> I want to create a user for one database in the server so that he can do
> all
> the admin task such as Backup, Restore, Modification for table,
> Proceduers,
> Views and Functions.
> But should not have access to another databases. Please suggest how i can
> do
> the same.
> Best regards
>