User Return Value Of A SP In Another SP (SQL Server 2000)
May 5, 2006
Hi group,
I need the result of a SP in another SP. The SP I need to have the result of does not have an output param. It just returns a result.
I tried the following code:
SELECT @WeightedAverage = EXEC uspCalcWeightedAverage @StartDate, @EndDate, @InMarket, @InProductType, @InWeekDay
I get the following error:
Server: Msg 156, Level 15, State 1, Line 26
Incorrect syntax near the keyword 'EXEC'.
Is it possible to fill a variable with the result of a SP?
TIA
Regards,
Sander
View 8 Replies
ADVERTISEMENT
Dec 29, 2014
What I want to do is return a row of data when my query doesn't return a record. I have two tables:
CREATE TABLE dbo.abc(
SeqNo smallint NULL,
Payment decimal(10, 2) NULL
) ON PRIMARY
[Code] ....
So when I run the following query:
SELECT 'abc' + '-' + CAST(SeqNo AS VARCHAR) + '-' + CAST(Payment AS VARCHAR) FROM abc WHERE SeqNo = 1
UNION
SELECT 'def' + '-' + CAST(SeqNo AS VARCHAR) + '-' + CAST(Payment AS VARCHAR) FROM def WHERE SeqNo = 1
abc-1-200.00
abc-1-500.00
As you can see since 1 doesn't exists in table 'def' nothing is returned as expected. However, if a row isn't returned I want to be able to enter my own row such as
abc-1-200.00
abc-1-500.00
def-0-0.00
View 4 Replies
View Related
May 15, 2007
hi friends.,i have some question regarding sql server 2000. pls help me... 'sa' user in sql server 2000 can be deleted or not ??if i install sql server 2000 with windows authentication; then will 'sa' user be created or not ? while i have my sql server database on some other pc (2000 professional os) and i installed my application on a different pc; then i have to access the pc in which my database resides; from installed pc location . why is that so ? with out accessing the pc where sql server is installed; my application is unalble to access/connect database....pls help methanks in advance//..
View 3 Replies
View Related
Mar 10, 2008
Hi,
I need to execute a stored procedure.I do not have the permissions to execute it , but I was provided with a user that have those rights.What I want to know is how can I impersonate that user?Tried SETUSER , but it doesn't work....
View 1 Replies
View Related
Feb 28, 2007
As an 'SA' I thought that you have permission to do anything on the server. Running an update command from Query Analyzer is throwing this error:
SQL Server 2000 SP3
Server: Msg 18456, Level 14, State 1, Line 1
Login failed for user 'sa'.
The table is in the dbo schema.
Has anyone seen this error before?
View 12 Replies
View Related
Feb 1, 2007
Hi,
I have a database created in server 2000, and now I have moved it to server 2005.
All works do fine, but there is a user which cannot be removed.
In the user properties window, the assigned schema is empty. The user is a db_owner of the database. When I was trying to update the user, it asked me for the login. The login is empty, but the field is disabled.
So my question is, how to remove this user?
Thank you.
Jensan
View 1 Replies
View Related
Jun 14, 2007
Hey Folks!
I have a typical requirement by my client. On submitting a Update (Bulk) button a huge database operation starts. A huge bulk update operation need to be performed. This would take 2-3 minutes some times. Client wants a cancel button in this case where he can be given a way to cancel the database Transaction.
Please let me know in case if there is a way out.
Thanks, in advance.
Regards,
Uday.D
View 2 Replies
View Related
Jul 9, 2007
Respected Members,
I have a question, when our aspx page is trying to access the SQL Server 2000 database than before this do we have to creaete a user with the name of ASPNET in SQL Server 2000, or without creating this paticular user(its the default user of ASP.NET account) our aspx pages can also access the SQL Server 2000,I have already SQL Server 2000 running in "SQL Server Authentication Mode" so while creating the user do I have to create it in "Windows Authentication" or "SQL Server Authentication", can you provide some link where I could find complete steps for craeting the ASPNET user or if some one can tell all the steps in details here.
View 1 Replies
View Related
Jul 23, 2005
Hi All,Would someone give me an explanation on how SQL 2000 server backs up auser database? Is SQL server make a copy of user database first, andthen backup it up to a defined backup device? Or is it going straightto the defined backup device.Thanks,Bob.
View 1 Replies
View Related
Oct 14, 2006
hi,it might be a very stupid question but i want to know whether anexecution plan is created in user defined functions in sql server 2000like stored procedures.Thanks.
View 4 Replies
View Related
Oct 30, 2007
Short of doing an INSERT and subsequent DELETE on a table, how do I figure out if a user has INSERT/UPDATE/DELETE access to a particular table?
View 11 Replies
View Related
Jul 9, 2007
Respected Members,
I have a question, when our aspx page is trying to access the SQL Server 2000 database than before this do we have to creaete a user with the name of ASPNET in SQL Server 2000, or without creating this paticular user(its the default user of ASP.NET account) our aspx pages can also access the SQL Server 2000,I have already SQL Server 2000 running in "SQL Server Authentication Mode" so while creating the user do I have to create it in "Windows Authentication" or "SQL Server Authentication", can you provide some link where I could find complete steps for craeting the ASPNET user or if some one can tell all the steps in details here.
View 3 Replies
View Related
Mar 24, 2008
hi all
i am using sysobjects for taking the list of user objects.
by using userid, status column combinations, able to take out the user tables/triggers/views
but for stored procedures, it doesn't work.
is there any better way to list the user objects.
thanks in advance.
sam alex
View 3 Replies
View Related
Nov 1, 2000
What are the maximum number of user connections achievable for sql server 2000 (w/ win 2000 adv server), and how are they managed - compared with sql server 7.0 (w/ win nt 4.0)? Our group is looking at upgrading our dbase server from sql server 7.0 to sql server 2000.
HELP
Thanks in advance
Gunnar
gunnardl@yahoo.com
View 1 Replies
View Related
Jan 25, 2008
Hello,
I am trying to migrate reporting services from SQL server 2000 to SQL 2005. I followed the migration steps listed in one of the TechNet documents. Installed SQL 2005 and SP2.
Backed up existing SQL 2000 databases and restored on SQL 2005.
Went to Configuration tool and then to the Database setup. Connected to SQL 2005.
Clicked on the Upgrade button. The upgrade fails and I always get the following errors:
"The database version (C.0.6.54) does not match your reporting services installation. You must upgrade your Reporting services database"
Then I get this exception:
System.Data.SqlClient.SqlException: Cannot find the user 'RSExecRole', because it does not exist or you do not have permission.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.ReportingServices.Common.DBUtils.ApplyScript(String connectionString, String script)
at ReportServicesConfigUI.SqlClientTools.SqlTools.ApplyScript(String connectionString, String script)
I do not understand why it is looking for user 'RSExecRole', which is a role.
Appreciate your help
View 3 Replies
View Related
Jan 15, 2007
I am supporting a system that needs to allow users to have access to TempDB.
I set these users up using the GUI, but whenever the server is restarted, these users permissions are wiped out and the db_owner permission is lost and I have to manually go in and apply the permissons for the database to work again, it happens on most reboots but not all.
Is there anyway to keep these users permissions when the server is rebooted?
Your help is most appriciated.
P.S Could I create a stored procedure that when ever the Server is rebooted the procedure would recreate these permissions?
If I need to do this how would I go about doing this?
View 8 Replies
View Related
Apr 25, 2007
I had thought that I had posted this yesterday but since I cannot findit here we go again.I have searched the archives but either the code I want is not postedor I missed it.I have a user create role in a database that I need to reproduce inanother version of the database. Does anyone out there have the SQLor T-SQL necessary to generate all the grants to a role?-- Mark D Powell --
View 2 Replies
View Related
Feb 19, 2008
Is it possible to define your own function? If so could you give me an example.
Keep in mind that I said in SQL Server 2000. I want no CLR SQL Server 2005 solutions.
Cheers,
David
View 1 Replies
View Related
Mar 30, 2006
Hi,
My server administrator has created a few users as domain user privilege for connecting SQL server from my application. However it faild to connect, and
with Domain Admin privilege, my app is running ok.
I asked admin person to upgrade domain user privilege to connect SQL server,
but he couldn't do this for security reason, and told it should work with domain user.
Is it true for domain user to connect SQL server without any problem?
Do I need to add the user, domain user, into Logins of Security inside SQL server Enterprise Manager?
Or inside users of my database section of SQL server EManager?
Thanks,
dixon
View 1 Replies
View Related
Jan 7, 2008
I have installed Sql Server 2000 Personal Edition (Version: 8.00.2039 SP4 Personal Edition), it runs over Windows XP.
Has Sql Server 2000 Personal Edition any user limits?
Thanks for reply
Ariel
View 6 Replies
View Related
Apr 21, 2008
Dear all,
I want to grant a user permissions to run Jobs in SQL Server 2000. I can' seem to find any appropriate roles for that. Do I need to assign him a server role? In that case, which? Many thanks.
Pedro Martins
View 1 Replies
View Related
Sep 21, 2004
How do I add login user ASPNET to my SQL 2000 Desktop Engine Server?. I can not find the "Server Manager" in the Start - Programs. Is there any other way to get around adding ASPNET login to the SQL server so I can test my VB program. I got the error: Login failed for user 'com_nameASPNET'.
View 1 Replies
View Related
Jan 3, 2008
I have created the following user function :-
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER function [dbo].[GetBillPrice](@BillLineID int)
returns float
as
begin
DECLARE @BillPrice float
SET @BillPrice = (
SELECT ((CAST(T_BillValueAndTax.BillValueAndTaxBillValue as float))+(CAST(T_BillTax.BillTaxTax1Value as float)) +(CAST(T_BillTax.BillTaxTax2Value as float)))
FROM T_BillLine
INNER JOIN T_BillValueAndTax on T_BillValueAndTax.BillValueAndTaxID = T_BillLine.BillValueAndTaxID_Price
INNER JOIN T_BillTax on T_BillTax.BillTaxID = T_BillValueAndTax.BillTaxID_Bill
WHERE T_BillLine.BillLineID = @BillLineID)
return ABS(@BillPrice)
end
No matter how I try to return the @BillPrice value, the value is rounded to the nearest whole number. For instance if the value is calculated as 198.75 the value returned is 199.0
When I execute the function in Query Anlayser the correct value of 198.75 is returned.
Any help in solving this would be greatly appreciated.
View 10 Replies
View Related
Dec 7, 2006
This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database)
Help pleaseee
View 3 Replies
View Related
May 5, 2008
How do I return a list of all user tables in a database where table name starts with EmpID_
for example the table names are:
EmpID_Countries
EmpID_Regions
EmpID_States
EmpID_Colorado
EmpID_Arizona
etc etc...........
I am using SQL Server 2005. Thanks.
View 1 Replies
View Related
Oct 30, 2006
Hi all!
I'm trying to use a UDF that returns a table, but I'm not sure of the syntax to invoke it. I've found examples in BOL and on-line like the following:
SELECT * FROM dbo.fn_MyTableFunc( 123.09, 'MyID' )
But I need the input parameter to be obtained from another table. For a very simplistic example, I've got 4 tables (and yes, I know that I can get the results I want for this example without using a UDF, but humor me):
CREATE TABLE tUser (UserID int PRIMARY KEY, UserName varchar(50))
CREATE TABLE tAcctGroup (AcctGroupID int PRIMARY KEY, AcctGroupName varchar(50))
CREATE TABLE tAcct (AcctID int PRIMARY KEY, AcctGroupID int, AcctName varchar(50))
CREATE TABLE tMapUserToGroup (UserID int, AcctGroupID int)
GO
INSERT INTO tUser VALUES (111, 'Me')
INSERT INTO tAcctGroup VALUES (1, 'NY')
INSERT INTO tAcct VALUES (11, 1, 'New York City')
INSERT INTO tAcct VALUES (12, 1, 'Syracuse')
INSERT INTO tAcctGroup VALUES (2, 'GA')
INSERT INTO tAcct VALUES (21, 2, 'Atlanta')
INSERT INTO tAcct VALUES (22, 2, 'Savannah')
INSERT INTO tAcct VALUES (23, 2, 'Augusta')
INSERT INTO tAcctGroup VALUES (3, 'TX')
INSERT INTO tAcct VALUES (31, 3, 'Dallas')
INSERT INTO tAcct VALUES (32, 3, 'Houston')
INSERT INTO tAcct VALUES (33, 3, 'El Paso')
INSERT INTO tAcct VALUES (34, 3, 'San Antonio')
INSERT INTO tAcctGroup VALUES (4, 'CA')
INSERT INTO tAcct VALUES (41, 4, 'Los Angeles')
INSERT INTO tAcct VALUES (42, 4, 'San Francisco')
INSERT INTO tMapUserToGroup VALUES (111,2)
INSERT INTO tMapUserToGroup VALUES (111,4)
GO
CREATE FUNCTION dbo.ufnGetAcctList(@AcctGroupID int) RETURNS @tAcct table (AcctID int, AcctName varchar(50))
AS
BEGIN
INSERT INTO @tAcct
SELECT AcctID, AcctName FROM tAcct WHERE AcctGroupID = @AcctGroupID
RETURN
END
GO
I know that I can do:
SELECT * FROM TestDB.dbo.ufnGetAcctList(4)
But I want the equivalent of:
SELECT AcctID, AcctName FROM tAcct
WHERE AcctGroupID IN (SELECT AcctGroupID FROM tMapUserToGroup WHERE UserID = 111)
Which uses tMapUserToGroup to obtain the AcctGroupID to pass into the function. The results would be:
AcctID AcctName
-----------------------------
21 Atlanta
22 Savannah
23 Augusta
41 Los Angeles
42 San Francisco
Any thoughts?
Thanks in advance for your help.
Cat
View 7 Replies
View Related
Jul 20, 2005
I have a SQL database with an Access front end. In the database Ihave a read only and a read write role. When a read only user opensthe database I want all the fields on the form to be locked so thatthe user will not try to change data and get an error from the server.Right now I am doing that with a table. But it's a hassle to have tomaintain a table when if I could answer the question is the currentlylogged in user in the read write role?My server is running SQL Server 2000. So I was wondering if I couldwrite a function to do this? The function would take the role beingchecked as a text parameter and return true if the currently logged inuser is in that role or false if he/she isn't.
View 1 Replies
View Related
May 15, 2015
I have a stored proc which evaluates a table of 'tasks' to return the task with the highest priority for a given user - at the same time, once that task has been found - I want to allocate that user to the task.
I have created a stored proc that works...however I'm sure this requirement /pattern is common & I would like some best practice for this pattern of update and select within a transaction.
Here is some sample data:
use tempdb;
go
if OBJECT_ID('Tasks', 'U') is not null
drop table tasks;
go
create table tasks (
TaskId int identity primary key,
[Code] ....
And here's what my current stored proc looks like;
if OBJECT_ID('pGetNextTask', 'P') is not null
drop proc pGetNextTask;
go
create proc pGetNextTask (
@UserID char(10),
@TaskID int output
)
[Code] ....
View 3 Replies
View Related
Jul 22, 2015
I have 2 tables each containing a material type. Table 1 contains material from their 3D application. Table 2 contains material with specific values that is not ours and we cannot rename or edit the data. I need a type of junction or mapping table that can connect the user material to the preset material. for example:
User Material = Wood-MDF
Preset Material = MDF Panel
I figured that i would make this table with 3 fields (ID, UserMaterialID, PresetMaterialID).How would i then construct a query view / Stored procedure that would return the Preset data values based on the user material id?
View 2 Replies
View Related
Jan 18, 2008
If I want to return to a point in time for all my databases in SQL 2000 can I just copy all the files in the data directory to a safe place. And then when I want to go back to that point in time, just copy them all back?
View 4 Replies
View Related
Oct 6, 2007
Hi,
I need to add carriage returns into a text box of 3 lines.
The data is pulled from the BD so the "cariage return" symbol need to be in the database field.
I know that some reporting software give the option to add HTML code into textbox but I did'nt find out about ms reporting 2000.
Thanks,
Marco
View 6 Replies
View Related
Aug 21, 2007
Login Failed for user , the user is not associated with a trusted sql server connection. (microsoft SQL Server,Error:18452)
hi ,
i am getting the above error message once in a while maybe two or 3 times a week , and then it goes away in 10 to 15 minutes or 5 minutes ,
our mode is set to mixed and we are able to connect and use both sql and windows , but once in a while , it will give us the above message when we try connecting throught sql server management studio client (using sql 05) using windows login , although it lets us connect using sql login while the windows login is denied, and after a while it lets us connect with both.
occurs randomly on some days , we run our servers on VM ware virtual machines using windows 2003 r2 enterprise 64 bit with sp2 with esx 301 virtual machine.
would appericate any feedback on this thanks
View 5 Replies
View Related
Nov 7, 2007
Hi
Last week I was receiving an error when trying to connect to two of our seven sql servers from my laptop via my domain admin account. The only fix was to have my laptop rebuilt and everything re-installed.
Today however another administrator is starting to have the same problem but to only one of the seven servers!
When that administrator uses my laptop with her domain admin account it works!?
What could possibly be going wrong with our laptops? We have not installed or changed anything.
The full error message we see:
Login failed for user ''. The user is not associated with a trusted SQL Server connection. (Microsoft Sql Server, Error: 18452)
The error being logged on the server: (two errors are logged each time)
SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. [CLIENT: 53.35.165.148]
Login failed for user ''. The user is not associated with a trusted SQL Server connection. [CLIENT: 53.35.165.148]
View 16 Replies
View Related