Hi,
I'm looking for a better way to loop through a table. I'm using a Cursor and it's very slow. I know cursors are bad and I guess this is one reason. Here is my cursor
DECLARE @idnum1 INT
DECLARE @date1 DATETIME
DECLARE my_sucky_cursor CURSOR FOR
SELECT [MyTable].[ID Number]...
How would I deny Select statements on all my tables for all users? I can use DENY SELECT 'tablename' but it only applies to non-administrators. For security reasons, I only want a user to be able to access the data via the front end application.
I am using Windows authentication...
Hello everyone,
I get a bit confused with setting permissions for my database. I am using Windows Authentication and a C++ front end app is connecting to a SQL 2005 database. Basically, in my front end, the initial user (who must be an Administrator of the connecting computer), creates a...
I have an SQL 2005 database with a front end written in C++.
I am using all stored procedures and views to access the tables and I am granting execute privledges and select privledges on the views. I also need to allow users to create and alter views.
I don't want the user to have the...
Hello,
I have a Win2K3 server with SQL2005 Express installed. The server also allows VPN connections.
From a remote computer, I can VPN without problem to the server. However, I get mixed results when trying to connect to the SQL Server. Usually it doesn't connect at all. If I play with...
Hello all,
What is the perferred method of informing a client that a table has changed. If I have multiple clients viewing the same data, and one client changes data in the view, what's the best way to let everyone know that they should update their views.
I'm using SQL 2005. I've been...
I have an application that uses an Access97 database. The clients connect to the db either locally or via a network share. I am using DAO with VisualC++ to get to the Access Data.
I am now re-writing the app using VS2005 and SQL Server 2005. My new app uses OLEDB to access Views and Stored...
I have a front end app that reads/writes data to an SQL server database.
The front end would be used by various types of users where some users would have access to only parts of the database, while other users would be administrators and have access to all parts of the database.
I am...
Is there a system sp or can I write a sp that can change the structure of a table.
Specifically, i need to be able to remove the 'primary key' attribute and the 'is identity' attribute, manually write some data, then put identity back in.
Thanks,
Does anybody know why this query fails?
PARAMETERS custid Long
UPDATE CUSTOMERS
SET TOTAL =
(SELECT SUM(DETAILS.CHARGE) FROM DETAILS WHERE DETAILS.CUSTOMER = custid)
WHERE CUSTOMERS.ID = custid;
I get the error 'operation must use an updateable query' however if I execute without the SELECT...
I'm not sure why this query fails
PARAMETERS custid Long
UPDATE CUSTOMERS
SET TOTAL =
(SELECT SUM(DETAILS.CHARGE) FROM DETAILS WHERE DETAILS.CUSTOMER = custid)
WHERE CUSTOMERS.ID = custid;
I got the error 'operation must be an updatable query'
If I remove the (SELECT SUM() ...) and just...
I have 2 tables
TYPES (ID, NAME)
SCHEDULE (ID, DATE, TYPE)
I want a query that returns the count of all the Types used in the schedule table for a given time period. Even if the count is zero.
I have:
SELECT TYPES.NAME, COUNT(SCHEDULE.TYPE)
FROM TYPES LEFT JOIN SCHEDULE ON SCHEDULE.TYPE =...
Hi,
I have a table that contains up to 3 columns that may or may not contain price data for up to 3 SKU's
ID SKU1 PRICE1 SKU2 PRICE2 SKU3 PRICE3
--------------------------------------------------
001 AAAA 10.00 BBBB 12.00 CCCC 15.00
002 BBBB 12.50
003 DDDD...
Hello,
I have created two stored procedures. One of them uses WRITETEXT to write large of amounts of data to a 'text' field. The other uses 'READTEXT' to read the data.
Here is the write code:
CREATE PROCEDURE [update_EXTNOTES]
(@idnumber [int],
@Notes [ntext])
AS
EXEC...
Hello,
I have created two stored procedures. One of them uses WRITETEXT to write large of amounts of data to a 'text' field. The other uses 'READTEXT' to read the data.
Here is the write code:
CREATE PROCEDURE [update_EXTNOTES]
(@idnumber [int],
@Notes [ntext])
AS
EXEC sp_dboption...
I've seen some sample code on how to get a page of data from a large table using a stored procedure.
However, I need to be able to get a range of rows rather than a page. This sounds like the same thing, or maybe it is, however, the range of rows may or may not be based on the identity column...
In my client app, I have a form that Opens a connection to an SQL Server table (i'm using OLE DB).
The form allows the user to MovePrev/MoveNext through records that have been entered in the table. If the user Moves to a record, then changes some of the data, when the client app issues the...
I am writing a client using OLE DB and VC++ and it will access an SQL database. The database has 6-8 tables in it, some stored procedures, views, etc.
Is it best for the client to open all the tables when the app starts and then close them at the end, or should the app be written so that the...
I have a trigger that appears to work fine, however I want to make sure that it can handle multiple records in the inserted or deleted tables. Plus I few other questions.
The current trigger is something like
CREATE TRIGGER [SetData] ON dbo.Transactions
/*
The basic purpose of this...
Hi,
I currently have a stored procedure where I pass in the ID of a customer, and the stored procedure performs sum selects and updates a field in the same customer table. Like this;
CREATE PROCEDURE [dbo].[Balance]
(
@cusid Integer
)
AS
UPDATE CUSTOMERS
SET BALANCE =
(SELECT...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.