Sunday, March 25, 2012
attach Help
but i always receive an error message "database is write protect ......"
What I do wrong ?
byeFirst of all, what did you do?|||Are the three files read-only at the O/S level? This can happen if the three files were sent as attachments in e-mail.|||could it be that the database already exists and in read-only mode?|||Are we even talking about SQL Server?
And when does the damn weekend start already.....
DECLARE @.Weekend datetime
SELECT @.Weekend = 'Jan 16 2004 17:00:00'
SELECT DATEDIFF(mi, GetDate(), @.Weekend)/60.00 As Hours_till_Margaritaville|||Sorry for mistakes
I'll start again
i have 3 Files xxx.mdf,xxx.ndf,xxx.ldf from originally sql7 ,from network and I'd like to atach to Sqlserver 2000; on sql server 2000 is the database not present
With Query Analyzer I tested i did:
Exec sp_attach_db
@.dbname="xxx",
@.filename1= "xxx.mdf",
@.filename2= "xxx.ndf",
@.filename3= "xxx.ldf"
With Sql 2000 Manager I use The menu attach
In both case i received this message "The Database is write Protect you
have to unptrotect.......
bye|||Right click on each file in succession, go to properties, and see if any of them have the read-only checkbox marked. If so, uncheck that box.|||I checked the free file , they all are not write protect|||As a test, see if you can rename one of the files. Maybe backup software, or virus scan has it open?
I just tried a test of re-attaching a readonly filegroup, and it worked. Although, I do not have access to a 7.0 machine, anymore to try out a readonly filegroup with an upgrade.
That sparks a thought. Do you have access to the database in it's original state? That is, can you see if the original database (on SQL 7.0) is read only or had read only filegroups?|||I can rename the files, and I open the file .ndf with an Hex editor
there are more line with read only inside the file
bye
Sunday, March 11, 2012
Assigning multiple values to a parameter in stored procedure
How do you write a SQL statement in a stored procedure so
that it will allow you to assign multiple values to a
parameter?
For instance in this example below, depending on what the
users select on the front-end application, the values
assign can be one customer id value or multiple customer
id values:
Create procedure dbo.SP_Test
As @.CustID varchar(3)
Select * from tblCust where customerid = @.CustID
Please help!This is probably not the best solution but it should work
create procedure sp_test
@.cust_id varchar(50)
as
set nocount on
exec ('select * from tblcust where customerid in (' + @.cust_id +')')
go
This procedure would be called as sp_test '50' for one cust_id or sp_test
'50, 55, 100' for several cust_id's
Friday, February 24, 2012
aspnet_regsql.exe
hi...
I want to Create an Application Service Database for SQL Server,SqlWebEventProvider, and i am trying to write in command line:
c:\>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -U user -P pass -S sqlserver\sqltest -A w
i get the following error:
The argument 'sqlserver\sqltest' is invalid.
why is that?
do i have to use the following flags:
-ssadd -sstype t ?
and, how is the right way to do this...?
thank you...
Try to use one of this options:
c:\>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -U user -P pass -S sqlserver -A w
c:\>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -U user -P pass -S sqltest -A w
c:\>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -U user -P pass -S localhost -A w