Follow Up To Exec..master And Sp_dboption
Jul 20, 2005
Hi all
I had some info on setting db owners and chaining so I can execute a dtsrun
(many thanks to Dan for that)
I have taken the comments on board and done some more research on the
internet, but I'm still struggling.
I am testing this on my personal edition, but when I run
EXEC sp_dboption 'my dbname', 'db chaining', true
it tells me that the SP doesn't accept the option db chaining.
I ran select @@version and I have SP3 on where I believe this option was
implented
can anyone give me any further pointers.
many thanks for any help
Andy
View 2 Replies
ADVERTISEMENT
Nov 20, 2011
I have a query with 2 subqueries, and no error message is reported, but, my problem is that the 2 subqueries do not follow the GROUP BY rule and show the total instead of by vendor...
Code:
SELECT Table1.agents AS Vendor
, Count(Table1.carS) AS Car_Sold
, Sum(Table1.carP) AS Car_Price
, Count(Table1.busS) AS MortBus_Sold
, Sum(Table1.busP) AS busPRice
[Code] ....
View 1 Replies
View Related
May 21, 2003
I try to run sp_password with a update trigger and get following error:
Server: Msg 15002, Level 16, State 1, Procedure sp_password, Line 32
The procedure 'sp_password' cannot be executed within a transaction.
Is there a way to go around this limitaion?
thanks
David
View 4 Replies
View Related
Jul 20, 2005
Hi allI have a stored procedure that has the lineEXEC master..xp_cmdshell 'dtsrun /Stestjob1 /N testdts /E'If I run the SP from an access front end as a trusted user or from ascheduled job it runs fine and exectues the dts.If I run the stored procedure using VB6 as a standard connection the dtsjobwont run. I get back Execute permissions denied on xp_cmd.. on databasemasterdb_connect_string = "Provider=SQLOLEDB.1;Persist Security Info=False;UserID=test_connect;PWD=pw1test;Initial Catalog=testdb;Data Source=" &database_name....Set cmd = New ADODB.Commandcmd.ActiveConnection = db_connect_stringcmd.CommandType = adCmdStoredProccmd.CommandText = "testStoredProcedure"cmd.ExecuteDo I need to give test_connect permisions to run the test stored procedure.I hoped that because the VB called a stored procedure and the connection hadpermissions to execute the SP then it would be the SP that called thexp_command....can anyone tell me the accepted way to do thismany thanksAndy
View 2 Replies
View Related
Mar 7, 2008
Hi All,
I am writing a stored procedure which accepts 2 parameters -
Current version(.....for example V53)
UpgradeTo version(.....for example V61)
Using these 2 inputs --I need to create a directory V61 by copying directory V53
for this specific example it would go like this-------------
exec master.dbo.xp_cmdshell N'Xcopy c:V53 c:V61 /i'
Now if i want to make a dynamic query for this ...
how do i go about it?
declare @folder1 varchar(255)
declare @folder2 varchar(255)
declare @xcopytext varchar(255)
SET @folder1 = 'V53'
set @folder2 = 'V61'
set @xcopytext = N'Xcopy "c:@folder1" "c:@folder2" /i'
exec master.dbo.xp_cmdshell @xcopytext
This gives the error :
File Not Foundfolder1
How do I integrate dynamic query with XCopy functionality ?
View 5 Replies
View Related
Mar 7, 2005
Hi,
i Exected...
Exec Master..xp_cmdshell 'bcp "DBCC CHECKDB" queryout "c:Test.txt"'
i've tried through this SQL script in Query Analyser but.
the Result is not storing in the Text file, and getting output this
---------------------------------------
Password:
NULL
Do you want to save this format information in a file? [Y/n]
Starting copy...
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]BCP host-files must contain at least one column
NULL
BCP copy out failed
NULL
----------------------------------------
Please help me, Successful Query.
Thanks <b>Nosepicker</b>
u r solutions is right...
Which u gave the Query...
Exec Master..xp_cmdshell 'osql -Uuserid -Ppassword -Sservername -ddatabase -Q"DBCC CHECKDB" > "c:Test.txt"'
i've Executed, It's work's fine in the VB6,VB.Net,ASP.Net...
I've done project, i've facility to take Backup and Restore the Database...
View 8 Replies
View Related
Apr 20, 2001
this is the message i get when i use 'sp_renamedb....."
A member of the sysadmin role must set database 'distributors' to single user mode with sp_dboption before it can be renamed.
what do i need to do set database to single user mode (i believe that that is what i'm need to do now?
View 3 Replies
View Related
Jul 25, 2005
I noticed that BOL says that the above is possibly going away. What's the official way to print out all your db options once it goes away, i.e. what are we supposed to do to quickly look at dboptions with doing sp_dboption 'databasename'?
View 6 Replies
View Related
Apr 14, 2008
1.could any one tell me the difference between sp_dboption and sp_configure.
View 1 Replies
View Related
Feb 28, 2008
Hi there,
I'm trying to remember which parameter i used for sp_dboption to fix the "data access" problem when I tried to synchronize one server to another.
I can't remember the exact error msg but it was something like "data access is not permitted" or "data access denied" or something like that.
does anyone know what error msg I am talking about? and how to fix it using sp_dboption??
I'd very appreciate it if someone can give me the exact error msg as well!
thanks,
View 2 Replies
View Related
Jan 25, 2008
Does an sp_dboption 'dbname','single user',true command execute succesfully when a background process is working on a database.
View 3 Replies
View Related
Jul 20, 2005
How to use a dsn-less connection from DTS?Source: MySQLDestination: SQL Server 7.0I have the ADODB.connection code but unsure where and how to use it.Pls advise.TIA!Bob
View 1 Replies
View Related
Apr 28, 2007
1. Let's say I have a SqlDataSource named Fred. Say I have a string variable, call it Barney. If I call Fred.Insert(Barney) HOW Does the insert command GET the Barney value and pass it to the SQL Insers string? 2. Lets say also in this same insert, I want the user Lets say Batty, who is logged in, to have her username automatically inserted into the table along with her Barney value. What is the method to get a hold of user name that is magically floating around in the session somewhere? All said and done, I'd love for it to work like this: "INSERT INTO [BedRock] ([UserName], [Character] ) VALUES (SomethingThatResolvesToSignedInUserName, SomehtingThatResolvesToStringValueofVariable) Table BedrockUserName CharacterBettyRubble 'Bam-Bam' THANKS inadvance fro ANY HelpDan-Simple and sleepless-Harper
View 3 Replies
View Related
Nov 20, 2000
Follow up for previouse message
I had only 40 mb of disk space in the c drive. could that be the reason. if so, how can I turn on the server and get into win NT and make the server up and running.
I hope someone can reply as soon as possible
Ahmed
View 1 Replies
View Related
Jul 12, 2007
Hi all,
I have some doubt about :
What is the basic difference between Patches,SP,Hot fixes in SQL Server ?
and
What are the steps we have to Follow before applying Service Pack ,Patches,Hot fixes?
Thanks
View 7 Replies
View Related
Nov 15, 2007
Hi All,
I am facing a problem in my personal edition of sql server 2000. my this edition is hung after some time due to error "the schedular 0 appear to be hung in sql server 2000" and next error is "the schedular 1 appear to be hung in sql server 2000" i found the solution of this error i run sp4, after that this error wont appear to me in the error log , but the other problem occur which is "your server is configure for 8 concurrent process but currently 166 process running so the performance would be degrade" and after that i am not able to log into the server. Due to this concurrent process problem i want to go for sql server 2000 Enterprise edition. so what stragery should i follow for upgradation of server. any other alternative of this problem
Regards
Shashi Kant chauhan
View 1 Replies
View Related
Aug 24, 2006
I have a table:
CREATE TABLE [dbo].[tx1]( [f1] [nvarchar](50) , [seq] [int] IDENTITY(1000,1) NOT NULL ) ON [PRIMARY]
SELECT *
FROM dbo.tx1
ORDER BY seq DESC
go
f1 seq
zz 1003
uu 1002
kk 1001
yy 1000
create view vx1 as
SELECT top 100 percent *
FROM dbo.tx1
ORDER BY seq DESC
go
select * from vx1
yy 1000
kk 1001
uu 1002
zz 1003
View 7 Replies
View Related
Dec 20, 1999
We have an NT 4.0 sp4 server with Sql 6.5, sp4 and its server name needs to be changed. This server will also be upgraded to Sql 7.0 sp1 too.
Is changing the server name easier/more efficient etc in 65 or 70?
Does anyone have any recommendations and or tips to follow in avoiding pitfalls, headaches etc?
Additional info: Replication is not involved here. If we upgrade to 70 first, it will be a "One-computer upgrade" process followed. BOL for 70 doesn't mention anything about a Server Name change. BOL for 65 does have "How to change to the current server name in the 6.x master database..." I was hoping to find specific details on the 'how to...' but was surprised that 70 doesn't cover this.
I have also seen a Jan 15 '99 posting by Sharon Dooley under "Machine Rename" which raises concerns that MS missed the boat on Server Name changes.
Any help would be appreciated.
Thank you,
TW
View 3 Replies
View Related
Oct 12, 2007
I need to know the steps on how to configure the SSRS Forms Authentication and its IIS Configuration. What specific Config Files should be modified?
i am using IIS 6.0, Windows Server 2003, SQL Server 2005.
Please help....
View 1 Replies
View Related
Sep 7, 2007
Just thought I'd point it out as something that needs fixing. This is inconsistent with every other MS product using the VS.net IDE framework.
I'd post it on Connect but then I'd wait 2 months to get "won't fix - this does not 'fit' with the current Katmai schedule" i.e. if I'm lucky (based on the new improved 3yr delivery of sql) it might get delivered in 2011. Wow.
Imagine if Xbox or PS3 designers told their customers, "sorry we know that up/down/left/right are in fact right/left/down/up, as you may expect on a game controller, but if you wait 3 years we might fix it"
View 3 Replies
View Related
Oct 31, 2007
I have two SQL Server 2000 (one is localhost, one is remote with VPN IP 192.168.5.4).
I can select * from [192.168.5.4].db.dbo.test but I can't exec [192.168.5.4].db..spAdd in localhost.
These select and sp is OK for 1 or 2 week without any problem,but it didn't work one day.
Can some one explain why?
View 5 Replies
View Related
Jun 19, 2007
I got a File with sales orders and their details.
Step 1. First I am filtering the Sales Order information and inserting it in my Sales Orders table.
Step 2.Then I am filtering the details from the sales Order and inserting them in the respective table.
My Problem is that the Sales Order File does not contain the Sales Order key (ID), this is generated by the SQL Server. How can get it in order to use it in the second step? I need it because it is a foreign key in the details table.
Any Idea?
View 4 Replies
View Related
Mar 25, 2008
Hello,
I'm new to SQL and need help with a query. Not sure if this is the right place.
I have 2 tables, one MASTER and one DETAIL.
The MASTER table has a masterID, name and the DETAIL table has a detailID, masterID, and value columns.
I want to return a populated MASTER table with entries based on the DETAIL.value.
SELECT MASTER.*
FROM MASTER
WHERE DETAIL.value > 3
This is a simplified version of my problem. I can't figure out how to set the relationship between MASTER.masterID and DETAIL.masterID. If I do an INNER JOIN, the number of results are based on the number of DETAIL entries. I only want one entry per MASTER entry.
Hope this makes sense.
How can I do this?
GrkEngineer
View 9 Replies
View Related
Nov 2, 2015
We already integrated different client data to MDS with MS Excel plugin, now we want to push back updated or new added record to source database. is it possible do using MDS? Do we have any background sync process to which automatically sync data to and from subscriber and MDS?
View 4 Replies
View Related
Feb 29, 2000
When I use EXEC in a stored procedure ( after building complex option logic) it produces an returns an error of 'Access denied' on the underlying tables.
All objects are dbo owned and execute permission has been given to all users.
Can ant one help?
Rob
View 1 Replies
View Related
Jul 22, 2003
When using a SP for getting a recordset is there any issues with using exec like in: rs.open "exec spWhatever"...
Should I use rs.open "spWhatever" or does it really matter performance wise on the SQL server?
Thanks
View 4 Replies
View Related
Nov 1, 2007
I am trying to create a awkward sp, just need to know if i can do this somehow, here i piece of the code...
create procedure IM_SP_TrPreProc /*@TableName Varchar(255),*/ @SystemFileName Varchar(255)
---------------------------------------------
--Param1 = Tablename
--Param2 = Systemfilename
---------------------------------------------
as
declare @TableName Varchar(255);--Just For Testing---DELETE!!
declare @Filename varchar(255); --Store Distinct filename
declare @DSNo Varchar(255);-- Use 'set' to execute Var TableName
declare @SumUnits Varchar(255); --Use 'set' to calculate sum of units
declare @SumValue Varchar(255);
Set @TableName = 'TrDs01' -- Testing Only--DELETE!!
------------------------Set Statements using @TableName Var------------------------------------------
Set @DSNo = 'select distinct DataSupplierNo from ' + @TableName
Set @SumUnits = 'select sum(Units) from ' + @TableName
Set @SumValue = 'Select sum(Value) from ' + @TableName
------------------------------------------------------------------------------------------------------
Insert into TransactionMaster([FileName],DataSupplierNo,ImportFileRecordID,FileLoadDate,
UnitsSum,ValueSum,RecordCount)
Select(@Filename),(exec(DSNo)), ................
Just the Bold and underlined bit "exec(DSNo)"..... is this doable in some way? can i use exec to retrieve the value to insert to data supplier. As far as i know i have to do it like this because im using a variable as the table name...
View 2 Replies
View Related
Apr 28, 2006
I need help understanding the syntax of the "exec sql" statement.
i am looking at code that build an sql string such as
sql="exec SOMETHING Session("id")"
or something like that.
then, there is
conn.execute(sql)
My question is the "SOMETHING" in the sql statement...is what? I know it is user defined (object or variable or such), but what exactly is it? i look through the rest of the code and don;'t see SOMETHING defined elsewhere.
i am not sure if i am asking the question right. i don't understand what the SOMETHING is doing, or why it is there.
in particular, the code i am examining is
sql="exec SurveyDelete "&"'" & Session("StudentID") & " ' "
conn.execute(sql)
i understand the this statement will delete a record, but how does it handle "SurveyDelete", how does it know what the is when it is not defined anywhere else in the code?
View 2 Replies
View Related
Feb 17, 2006
Hi,
Can I execute my MDX statement as in the exhibit format!
DECLARE @test VARCHAR(MAX)
SET @test = 'WITH test AS (SELECT * FROM merchants)'
EXEC(@test)
SELECT * FROM test
If I don't use that dynamice sql statement, everything work fine.
Thanks,
Myo
View 1 Replies
View Related
Mar 28, 2006
Hi,
I have a written a SP to do indexdefrag to all user table indexes in a databases...I had to use dynamic sql so I can reuse this code for any DB...
declare @strsql varchar(500)
set @strsql = ' dbcc indexdefrag('+'''DBName'''+',554556545,3)'
exec (@strsql)
When I execute the above script, I immeaditely see the results in the query analyser like below:
Pages Scanned Pages Moved Pages Removed
------------- ----------- -------------
3 0 0
Looks like the indexdefrag did not happen since the logical fragmentation is still a high number like 30%.....
Just wondering whats goin on..
Thanks.
Ranga
View 3 Replies
View Related
Aug 29, 2007
Hi, I have an sql query like this :DECLARE @TableName varchar(200), @ColumnName varchar(200), @EmployeeID varchar(200), @Result varchar(200);SET @TableName = 'Customer';SET @ColumnName = 'First_Name';SET @CustomerID = 28;-- This line return ErrorSET @Result = EXEC ('select' + @ColumnName + ' from ' + @TableName + ' where Recid = ' + @CustomerID + '');Print @Result; I am pretty sure the SELECT statement in EXEC will only return 0 or 1 record. But how to capture result from EXEC? Thanks
View 1 Replies
View Related
Nov 7, 2000
is it possible to have a sproc with a input parm of a column name and have this column name be inserted into an exec statement that runs and provides the output as a OUTPUT parm instead of a result set?
i can get the sproc to take the column name as a parm, run the exec, but cannot figure out how to assign the "dynamic sql" output to a OUTPUT variable instead of returning the result set.
View 1 Replies
View Related
Oct 17, 1999
How can i get the result from a dynamic sql like - exec('select ' + fieldName
+ ' from ' + TableName)
View 2 Replies
View Related