Paul,
Many thanks. I had completely overlooked that option. I was beginning to lose a significant chunk of my hair over this one as it was beginning to extend to other DLLs that I have created over time.
Thanks again,
hmscott
I have one possible use for it that I am currently exploring. I have super users that add new users to the database by way of an admin module.
Add new users is not a problem, but when I want to add a new super user, I runn into problems trying to add the db roles "db_accessadmin" and...
I am getting an error "Class does not support Automation or does not support expected interface".
Here are the circumstances:
Operating system:
Client: Win2K or WinXP Pro (error occurs on either)
Server: Win2K (SP4)
Application:
IIS 5 (web server)
Custom COM+ Object (built...
Unless I am much mistaken, parameters (or local variables) that are declared outside the CURSOR are still valid inside the cursor.
So:
DECLARE @MyParam1 varchar(10), @MyParam2 varchar(10)
DECLARE MyCursor CURSOR FOR
SELECT Column1, Column2
FROM MyTable
OPEN MyCursor
FETCH NEXT FROM MyCursor...
Magda,
There are several individuals in this forum and other who believe wholeheartedly that cursors are one of life's cardinal sins. I'm not one of them, but they do have a point (complexity, performance, etc). Consider this alternate solution. It doesn't directly address your situation...
First, don't let Nigel read this post (Nigel, if you are reading this post, close it, close your eyes, say a short prayer and go on to the next post). :0~!
From BOL:
I would consider very carefully the need to have two cursors in one SP. There are alternate solutions (one might by using VB...
To create a column like Access' Autonumber, you use
IDENTITY(SEED, INCREMENT)
For example, try:
CREATE MyTable (
ID INT IDENTITY(1, 1) NOT NULL,
Data VARCHAR(20) NULL
) ON PRIMARY
GO
INSERT MyTable (Data)
SELECT 'Record1' UNION
SELECT 'Record2' UNION
SELECT 'Record3'
GO
Try this (as an example only).
-- Create table a
create table a (
value1 varchar(10) null,
value2 int null
)
go
-- Create identical table b
create table b (
value1 varchar(10) null,
value2 int null
)
go
-- Move 4 records into table b
insert b (value1, value2)
select 'one', 1 union all...
The first question is pretty straightforward. The equivalent to the MS Access Yes/No data type is the SQL "Bit" data type. Be aware however, that Access does some behind-the-scenes magic with Yes/No. In reality, Yes is stored as a -1 (negative one) and No is stored as a 0 (zero)...
I guess my first question would be, why do you need a cursor here? It looks like a pretty straight forward INSERT statement would suffice (and cursors should be avoided where possible).
2nd, in the example you gave, you
DECLARE LINES CURSOR FOR ...
but you
OPEN PARTIDAS
was that a...
With some hesitation, I would suggest you read the BOL entry for 'WITH GRANT OPTION'. I say hesitation, because I wouldn't recommend this strategy -- especially for UPDATE.
But, as long as you are aware of the potential risks, the capability does exist.
hmscott
There are some 3rd Party tools that will do this (www.rac4sql.com and another that I'm having difficulty remembering right now), but there is no native T-SQL to create the type of recordset you want.
The CASE statement may help you if you have a defined number of headers (columns), or you can...
breaksr,
Looks like you found it (?!?).
Seriously, it seems that most questions receive attention here (or you can go to the programming forum for developer-oriented questions). I think the only courtesy most people would ask is that you look in Books on Line first before asking a question on...
If the SQL Server service account has the appropriate permissions and if you have the Messenger service on your laptop/workstation enabled, you can use the Net Send option (available on both jobs and alerts). I do not know if the messages are queued (ie, whether they will be delivered the next...
Are the log files continuing to grow? Or are they just not shrinking to a smaller size?
If the log files are continuing to grow in absolute size, you might have an open, uncommitted transaction (check by using SELECT @@TRANCOUNT) somewhere. You will need to find and kill that transaction.
If...
Here is a basic SQL script to create two tables and then add a foreign key constraint to the second table.
CREATE TABLE Alpha (
ID int IDENTITY (1,1) NOT NULL,
[Data] varchar(20) NULL
)
GO
CREATE TABLE Omega (
R_ID int NOT NULL,
Data varchar(20) NULL
)
GO
ALTER TABLE Alpha ADD...
In SQL, views cannot accept parameters (unlike queries in MS Access). To accomplish what you are trying to do, you will need to create a stored procedure. For example, consider the following for the pubs database:
CREATE PROC spSalesForStore (
@iStore as int
)
AS
SELECT *
FROM sales...
Hi,
You actually have a couple of options.
1. You can use sp_detach_db to detach the database from the server. Then move the files using any MS windows tool (command line, Explorer, etc). When the file is back to where you want it to be, use sp_attach_db to re-attach the files.
2. You...
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.