How A Storied Procedure Can Read A Table In MS Access?
Sep 5, 2007
Hi,
We currently use an access database to manipulate data in tables on a SQL server. The end user copies a list of ProjNo from a spreadsheet into an Access table. The Access table is used as the criteria for 5 Access queries. It is common that one of the queries does not get run.
I figured I would create a Storied Procedure on the SQL server, call the storied procedure from MS Access using the MS Access table as the criteria to run the Storied Procedure. I do not know how to provide the Storied Procedure the ProjNo in the MS Access table. The number of ProjNo records in that table can vary.
I've found info on how to add one record at a time but I need a more of a batch process approach.
Can you point me in the right direction?
Thanks,
Mary
View 5 Replies
ADVERTISEMENT
Apr 21, 2006
I have a data file that I converted from Access to SQL Server using theupsizing wizard. I then attached the tables to the Access front end using anODBC connection. I have one table that is read only for some reason. I'mnot sure how that happened, it went through the same procedures as the othertables in terms of upsizing and connecting. The original table was not readonly or hidden or anything else, it had full permissions.I've tried disconnecting and reconnecting the table but still the samething. In SQL Server, the permissions are the same as all the other tables.I can't seem to figure out what's making this one read only.I'm using SQL Server 2005 Express and Access 2003. Any ideas would begreatly appreciated.Thanks!
View 11 Replies
View Related
Nov 25, 2001
In a stored procedure, I am trying to create a table and then read it from within that SP or from another one (nestsed). When I run the below code (simplified version of my real SP), no records are returned even though I know that there is data. The table is created and records are inserted, I just cannot read the records from the SP or one that calls it with an EXEC.
Any ideas? My code is listed below. (When I get this to work, I plan to convert the code to manipulate a temporaty table).
Alter Procedure spWod_rptWoStatusSummary_9
As
BEGIN
CREATE TABLE tblStatusSummary (TckStaffCd_F Char(3), RecType Char(20))
INSERT INTO tblStatusSummary
SELECT TckStaffCd_F, RecType
END
BEGIN
Select * from tblStatusSummary
end
View 1 Replies
View Related
Apr 7, 2015
How can I create a SQL authentication account with read-write access to only 1 table in a SQL database.
View 1 Replies
View Related
Mar 6, 2005
Hi
I have created a .net application using visual studio .net and sql server destop edition on my pc. I have exported the database tables and stored procedures and imported them into a Sql Server database on a web hosting service. The web host does not allow me to access this database directly through visual studio .net.
My connection string to the external database works ok and I can access my stored procedures through my web pages. I know they accept parameters and that I can receive Return Values from them. However, whenever I try to access any of the tables on the external database through a stored procedure, I get a sqlException saying that the table cannot be found (Invalid object name 'UserList').
I have created a text type command which selects data from one of the tables and this runs through without any errors. I have also managed to Insert a row onto one of the external tables also by using a text type command. My only problem seems to be with commands using stored procedures.
Just in case this is the problem - the owner of the table/procedures on my desktop is shown as dbo but on the external database the owner of the tables is shown as [domainname].co.uk_dbuser while the stored procedures owner is still dbo.
Example of stored procedure on external database:
/****** Object: Stored Procedure dbo.AddUser Script Date: 01/03/2005 21:10:06 ******/
CREATE PROCEDURE dbo.AddUser
(
@Username Varchar(20),
@Password Varchar(20)
)
AS
(
Select User_ID From UserList
Where User_Username = @Username
)
GO
Have tried changing dbo.AddUser to [domain].co.uk_dbuser.Adduser but this would not save because there were too many full-stops!
Any help would be greatly appreciated as I am completely stuck.
John
View 2 Replies
View Related
Aug 29, 2006
I have an existing MS SQL 2005 server which is used to maintain data that has been collected from various sources around a plant. A new system has been added on our network where the data is provided in a daily MS Access database. The name of the MS Access database changes every day.
I would like to use the job manager to run a Stored Proc every night to extract the daily data from the MS Access database. Is there any way to do this.
Regards, Eric
View 1 Replies
View Related
Jan 29, 2001
I have SQL Server 7 database & I need to create some interface between users & database to let users see what is in the database, but not let them change or destroy data. Do I need to create some other database in-between users & the original database? Users can't program & want access to all data.management doesn't want to create a replication of the database. They want to let users have access through MS Word or Access. What could you advise me?
View 1 Replies
View Related
Jan 18, 2008
Hi,
How can I provide a user read only access to all the databases on the server. I have 15 databases on the server. I know I can give db_datareader access in each database individually but that is time consuming and I have 10 servers for this to be done.
thanks in advance.
View 3 Replies
View Related
May 31, 2007
The error comes up like this -
System.Data.SqlClient.SqlException .... because the database is read-only
( I'm putting this here so searches can find it easier)
I got this idea from a related thread, but they used a NETWORK user that is obsolete in 2007.
I found that you have to edit the actual file properties on the ASPNETDB.MDF and ASPNETDB.LDF files so that the ASPUSER has full access. i.e. on the file properties, security tab, hit the Add button and type in ASP.NET then return. Back at the security properties, click on the 'Full Control' checkbox at the top. That took care of it for me.
This was after checking the IIS control panel for the properties on the folder that contained my application and App_Data folders to be sure that the "Write" checkbox was already checked, it was
Of course this assumes that you have installed the express version of SQL from Microsoft
View 2 Replies
View Related
Feb 5, 2008
Hello,
We have SQL Server 2005 with 300+ databases in it. It was set up by the conractor. How can I create new account with read-only access to all databases? Is there any "quick" method of doing it (like in Sybase, it is very easy). I've created new login, but I do not see where can I set up the permissions properly. Thanks
View 8 Replies
View Related
Mar 31, 2008
Hi guys,
I want to give someone read only permission to our SQL server so they can log in and look at the database structure and query a few tables. I've set up the user but the problem is that when I connect in SQL server remotley, it shows all the other DB's on the server even though it is restricting access to them. Can these other DB's be hidden so that only the DB the user has access to shows up?
Cheers for your help!
View 9 Replies
View Related
Dec 6, 2006
I have a set of comma separated variables in a Script Component list. I want to access them in Script code and use them to build string in the code.
View 9 Replies
View Related
Jun 29, 2007
Sorry for the simple question, but I'm not having any luck getting this to work: I need to give someone read-only access to everything in a database.
If someone could help me by giving me (or linking me to) a step-by-step, idiot-proof recipe for giving Bob in my office read-only access to the whole database, I'd be very grateful. And remember: I'm good at db programming, but completely ignorant on the subject of db admin.
View 3 Replies
View Related
Feb 13, 2006
Hi there,
I have successfully installed SQL Server Express.
I have copied NorthWind to SQL Server.
I have created an ODBC to the SQL NorthWind.
But my problem is, I open the data but I cannot edit or insert records
to the Customer table.
I have gone into SQL Management Studio and modified Permissions
on NorthWind and the Customer table with Alter, Insert, Update.
But no luck.
Has anyone experienced this?
Email me at justintoronto@hotmail.com if you have a solution.
I will try to check back here also.
Thanks,
Justin
View 1 Replies
View Related
Nov 25, 2015
I am facing a very weird issue in our SSAS database. We have several roles with 'Read definition' access. None of these roles are able to see data in the cubes. I have checked these roles over and over and there is no problem with the definition. Each of the roles have been given read access to Data Source, Cube and Dimensions.
The users are able to access the definition and structure of the cube i.e. they can see the measures & dimensions available but when they drag measures and dimension attributes in the browser (SSMS) OR execute an MDX - they get null values. The roles with 'Full Control (administrator)' access are able to see all the data without any issues.
Â
I have tried the following:
1. Deleted all roles and re-created.
2. Created roles directly on SSAS DB.
3. Deployed all objects and processed the DB.
Â
Each time only the admins are able to see the data.
View 7 Replies
View Related
Nov 17, 2011
Any easy way for a batch file or automated process to read from one db and table and what ever entry is missing out of another database + table it writes those missing entries to.
This is a simple table in one db that is filled with usernames, I want to see if there are missing usernames in another db and table and write those entries.
db1.usr_table.usr_name = jdoenew
If jdoenew is missing in the 2nd db I will need to write entries like:
db1.usr_table.usr_name = jdoenew
db1.usr_table.password = tmppassword
db1.usr_table.active = 1
View 1 Replies
View Related
May 19, 2008
Hi,Using Chandu Thota's book Mappoint.net I attempted to set up a findnearby query using his example Implementing Spatial Search Using SQL Server.
The book uses C# I have attempted to convert the code to call the stored procedure as follows:
TryDim units As Int16 = 0
Dim cmd As SqlCommand = New SqlCommand("FindNearby")
'Assign input values to the sql command
cmd.CommandType = CommandType.StoredProcedurecmd.Parameters.AddWithValue("@CenterLat", latitude)
cmd.Parameters.AddWithValue("@CenterLon", longitude)cmd.Parameters.AddWithValue("@SearchDistance", distance)
cmd.Parameters.AddWithValue("@Units", units)Dim con As New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("VehicleMarshallConnectionString").ConnectionString)
If con.State = ConnectionState.Closed Then con.Open()
If con.State = ConnectionState.Open Then
cmd.Connection = conDim dreader As SqlDataReader = cmd.ExecuteReader()
If dreader.Read() Then
If Not dreader.IsDBNull(1) ThenDim ordnum As String = dreader(1).ToString
End If
End If
End IfIf con.State = ConnectionState.Open Then con.Close()
Catch ex As Exception
Finally
End Try
The code returns no values but when I execute the stored procedure from the server explorer in visual studio I get the records I would expect in the output window. How would I read the returned values from my code.
Output Window
Running [dbo].[FindNearby] ( @CenterLat = 53.10531, @CenterLon = -2.4769, @SearchDistance = 100, @Units = 0 ).
ID ordnum ProxDistance
----------- ------------------------- -------------------------
1 009999/USP 0
2 109999/USP 14.5971373147639
3 119999/USP 57.7144756947325
No rows affected.
(3 row(s) returned)
@RETURN_VALUE = 0
Finished running [dbo].[FindNearby].
Regards,
JoeBo
View 10 Replies
View Related
May 21, 2008
Hi
I have decided to approach the problem here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=103310
by using a Stored procedure, someone mentioned it's possible
for a SP to read the contents of a text file ?
IS it ?
For example i have a DB table
with fields to,from,subject,body
problem is the body field references a file (full path)
and i need to extract all info into a txt file
the full txt body, so can i perform some sort of inner
operation on the select body .. part of the SP ?
View 2 Replies
View Related
Sep 25, 2006
Dear all,
I am using SQL 2000 and would like to dynamically assign ODBC data source to transform data task. Do you have a stored procedure to perform read/write from/to ODBC data source? I would like to input data source and table name.
Thank you and Best regards,
Chaivat
View 5 Replies
View Related
Jun 25, 2007
I need to create a flat file as word document, may i know how to write text from stored procedure if a file is already exist then the text will append, how to do it ?
Thank you.
View 1 Replies
View Related
Aug 6, 2007
Stored procedure in SQL Server 2K is as follows..
CREATE PROCEDURE TestDataRead
@TestString varchar(20) OUTPUT
AS
SET @TestString = 'Mr.String'
GO
-----------------------------------------------------------------------
SSIS package details.
OLEDB connection manager; Connection works fine.
Execute SQL Task Editor properties are as follows.
ResultSetà None
SQLStatementà exec TestDataRead
SQLSourceTypeirectInput
Parameter Mapping:
VariableName: selected the user variable from the list.
Direction: Output
DataType:varchar
Parameter Name: 0
Parameter Type: 20
When I run I am getting the following error.
SSIS package "TEST SSIS1.dtsx" starting.
Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "exec TestDataRead" failed with the following error: "Procedure 'TestDataRead' expects parameter '@TestString', which was not supplied.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. ...........................................
...................................................................
Please help.
Smith
View 3 Replies
View Related
Mar 23, 2015
We log ship our production database tansaction logs to a secondary database on a separate remote domain.
Incidentally, this was not set up via the "Ship Transaction Logs" wizard, but instead we had to use the various system stored procedures after restoring a copy of the database on the remote domain in standby mode.
We now have an issue where users are unable to access the remote secondary database without having sysadmin privileges. Clearly we want to avoid this!
We want to be able to use Windows Authentication mode on the server of the secondary database. But since the two domains differ, is it possible to even achieve this?
How can we set up read-only access for users on the secondary database without giving them sysadmin privileges?
View 3 Replies
View Related
Sep 15, 2015
I have 3 servers taking part in an AlwaysOn AG.
I want to grant a user READ access to only one replica, and certainly not to the principle.
How do I go about doing this?
View 4 Replies
View Related
Jan 17, 2008
Hello, I am trying to configure a Script Component as a data source. Although this should be a simple exercise, I am running into a problem.
My control flow contains a Foreach Loop with a file iterator. The Directory Expression of the Foreach Loop Editor is supplied by an expression mapped to a package level variable called inputdirectory. The FileNameRetrieval Expression is mapped to a package scoped variable called filename.
My data flow is encapsulated by the Foreach Loop, and contains a Script Component as Source for the Data Flow Source, and a Flat File for the Data Flow Destination. The contents of the Script Designer are as follows:
Code Block
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports System.IO
Public Class ScriptMain
Inherits UserComponent
Dim thisFileDate As Date
Dim thisFileName As String
Dim thisFilePath As String
Public Overrides Sub CreateNewOutputRows()
thisFileName = ReadOnlyVariables("filename").Value.ToString()
thisFilePath = ReadOnlyVariables("inputdirectory").Value.ToString()
thisFileDate = File.GetCreationTime(thisFilePath & "" & thisFileName)
FileSpecBuffer.AddRow()
FileSpecBuffer.FileName = thisFileName
FileSpecBuffer.FullPath = thisFilePath & "" & thisFileName
FileSpecBuffer.CreateDate = thisFileDate
End Sub
End Class
When I debug the package, I get the following error:
The collection of variables locked for read access is not available at this point.
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponent.get_ReadOnlyVariables()
at ScriptComponent_67311120e6eb4162a3ea1f70847f04de.ScriptMain.CreateNewOutputRows()
at ScriptComponent_67311120e6eb4162a3ea1f70847f04de.UserComponent.PrimeOutput(Int32 Outputs, Int32[] OutputIDs, PipelineBuffer[] Buffers)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PrimeOutput(Int32 outputs, Int32[] outputIDs, PipelineBuffer[] buffers)
My googlefu fails me at reconciling this. I have read various posts about changing the line ReadOnlyVariables("filename").Value to ReadWriteVariables("filename").Value, and handling the buffer assignment in PostExecute. The problem is that all examples shown are either for Script Component as Destination or Script Component as Transformation. I have tried playing with the Custom Properties in the Script Commponent set the ReadOnlyVariables and ReadWriteVariables, using a PreExecute method, a PostExecute method, all with different errors returning. I'm at a loss here. Could anybody provide me with a simple working example so that I can correctly populate my output buffer in the context of Script Component as Source?
I fully understand that I could just run a Script Task Using System.IO.Directory, and System.IO.File, but I really want to make this package work in the manner I've described. Any help would be appreciated.
Thanks,
John T
View 5 Replies
View Related
Aug 10, 2007
Hi
I wounder if there is a sp in the master db that can give me what usergroup a username is connected to / and or give me info if the username is valid (Windows NT login).
If not: then how do I read what usergroup a username is connected to? sysxlogin table in master db? And can I connect to a sp in master db from another db? Can I create a sp in my db that reads in the master db?
Thanks!!
Best Regards
Staffan
View 1 Replies
View Related
May 7, 2001
Problem Description:
Stored Procedure hanging when try to execute in READ_ONLY Database. Though the stored procedure is highly complicated,it runs smoothly on the same server if the Database option is set to READ/WRITE. Not all stored procedures are hanging in READ_ONLY database,only if the stored procedure tries to retrieve more records (say 10000 ).
If the SQL Statements present inside the stored procedures are executed,they are getting executed perfectly but hangs if it is executed as stored procedure.
On restarting the SQL Server, stored procedure getting executed only for the first time in READ_ONLY database but executing it again for the second time, it starts hanging. ( I tried executing the stored procedure after clearing the procedure cache but still hangs ).
Environment:
Windows NT 4.0 (Service Pack 5 )
SQL Server 7.0 ( Service Pack 3 )
Multi Processor ( 2 - 500 Mhz )
Let me know if you need more information on it.
View 3 Replies
View Related
Jun 27, 2001
Hi,
How to read from a flat file in a stored procedure. Is there any built in utility available ? Please let me know.
Mahesh.
View 2 Replies
View Related
Mar 28, 2004
Hi All,
I need some help from you experts.
I need to develop something that reads from xml files and writes in to sqlserver, also it should read from SQLServer and writes to xml.
I should be able to give this as a job to exectue daily ,etc.
Can we do this using stored procedures in SQLServer.
Pls paste some sample code, if any or direct me to any url with better info.
Thanks in advance
View 11 Replies
View Related
Sep 26, 2007
I am coding a DataList control for 2 column data from a stored procedure. The 1st column isprogramName and the 2nd is programLink. I used Edit Template -> Edit DataBonding to add<h ref="http.....>, but can not get it right. Please help. Also, what is the Parameter Sourcefor using Logon User ID as a stored procedure paramter when configuring a SqlDataSource? None, cookie, control,..? TIA,Jeffrey
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" Style="z-index: 16;left: 29px; position: absolute; top: 82px"><ItemTemplate>programName:<asp:Label ID="programNameLabel" runat="server" Text='<%# Eval("programName") %>'></asp:Label><br />programlink:<asp:Label ID="programlinkLabel" runat="server" Text='<%# Eval("programlink") %>'></asp:Label><br /><br /></ItemTemplate></asp:DataList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:iTemplatesConnectionString %>"SelectCommand="MyPrograms" SelectCommandType="StoredProcedure"><SelectParameters><asp:Parameter Name="meid" Type="Int32" DefaultValue="3532" /></SelectParameters></asp:SqlDataSource>
View 4 Replies
View Related
Sep 24, 2002
Hi
I was wondering how I could pass on the following parameters from an ini file to a stored procedure within a DTS package. The parameters in the ini file look like:
[DatabaseCleaner]
! -- TableToBeCleaned_N=<table name>,<months to hold on db>,<months to hold on hd>
! -- <N> must be a successive number starting from 1 ...
TableToBeCleaned_1=Transactions,24,24
TableToBeCleaned_2=Payments,24,24
TableToBeCleaned_3=PresenceTickets,24,24
As I do not know how many tables that will be declared in the ini file I have to loop through until the last parameters and pass it over to the SP.
How can I do that? Any idea?
Thanks
mipo
View 1 Replies
View Related
Apr 30, 2015
In general as understand if we have a stored procedure that does operations like inserts or updates, it makes perfect sense to use a rollback operation within a transaction.
So, if something goes wrong and the transaction does not complete, all changes will be reverted and an error description will be thrown for example.
Nevertheless, does using a rollback within a try catch statement, make sense in a read only stored procedure, that practically executes some dynamic sql just to select data from some tables?
I have around 100 Stored procedures, all of them read only. Today a colleague suggested adding try-catch blocks with rollback to all of them. But since they are just selecting data, I don't see a clear benefit of doing so, compared to the hassle of changing such a big number of SP's.
View 9 Replies
View Related
Jan 12, 2007
For some reason, I run a stored procedure in Query Analyzer and it works fine. When I run the very same procedure in MS access by clicking on its link I have to run it twice. The first run gives me the message that the stored procedure ran correctly but returned no records. The second run gives me the correct number of records but I have to run it twice. I am running month-to-month data. The first run is Jan thru March. Jan and Feb have no records so I run three months on the first set. The ensuing runs are individual months from April onward. The output is correct but any ideas on why I have to do it twice in Access? I am a bit new to stored procedures but my supervisor assures me that it should be exactly the same.
ddave
View 2 Replies
View Related
Feb 12, 2008
Hey ,
I have sql server 2000, and i am using Microsoft Application block.
I have Transaction Like...
SqlConnection conn = new SqlConnection(ASLConnectionString); conn.Open(); SqlTransaction Trans = conn.BeginTransaction(IsolationLevel.ReadUncommitted);
But If i have another process that try to read the Table if that old transaction running.. it wouldn't Allow me to read the DATA.
i tried Isolation level "snapshot" but that works under sql server 2005 only. so i can not use that. And i have some services that will run during day time.
So if anybody have solution to read the data from table...from sql server 2000 even if another transaction is running?
Please Give any guideline..Help will be appriciated.
thanks & regards,
Nirav Patel
View 1 Replies
View Related