|
Hi All,
Iam having a table like
columns
tbid menu_id1 menu_id2 menu_id3
If i inserted any new data to this table one more column say menu_id4 should be added automatically.
If i again inserts a new data to this table new column say menu_id5 should be created.
Please help me on this.
Regard's
Veeresh
|
|
|
|
|
Are you sure your table design is correct? Why do you need to change the table design every time you want to insert data?
What are menu_id1, meanu_id2 and menu_id3? Are they the same type of entity? If so, you should consider a table design composed of tbid and menu_id where the primary key is a composite of the two. Then, if you want to insert data, all you have to do is add new rows of data to the table.
Paul Marfleet
|
|
|
|
|
i was writing the function in sql server
create fucntion dbo.abc (@a int)
returns @mytable table
(
userId INT,
name VARCHAR(50),
state CHAR(2)
)
begin
end
now the question is how i can get the values like userid , name , state in the stored procedure while callig these , in stored procs
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Sonia Gupta wrote: now the question is how i can get the values like userid , name , state in the stored procedure while callig these , in stored procs
Well, you are not inserting any values to your table variable. So I assume it returns a blank table. Read this[^] article to get an idea on this.
|
|
|
|
|
CREATE FUNCTION [dbo].[FLifeId] (@itemid int ,@itemsubid int,@itemssubid int,@typeid int,@subtypeid int)
RETURNS int
AS
BEGIN
declare @lifeid int
declare @combinationid int
set @lifeid = 0
set @combinationid = 0
select @combinationid = CombinationId from tblItemsIdComposition where MCPId = @itemid and MCPSubId = MCPSubId and MCPSSubId = @itemssubid
if (@combinationid = 0)
begin
return @combinationid
end
else
begin
select @lifeid = id1 from a where combid = @combinationid and tyid = @typeid and styid = @subtypeid
end
return @lifeid
END
This is the ,matter i am typing in my funciton.The thing is , i want to pass two parameters back to the stored procedure , whee i am calling this funciton.
i know i can't return two values back to the stored procs.
Then how should i do it ?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
A function can return either a single scalar value or a table variable. This has been explained to you previously. A stored procedure can return multiple scalar values, so you could consider using one of those instead.
Paul Marfleet
|
|
|
|
|
hi guys, is it possible that i can retrieve records from different database like SQL Server 2000 and MySQL?
example, assuming i have table in SQL Server 2000 and i also have table in MySQL. the table in SQL Server 2000 for example is Table1 and in MySQL is Table2.
if i create a query that will combine or retrieve the fields of the two database, is it possible?
if so anyone who have idea with that and how to do that?
Thank You.
Don't block the drive way of all the newbies in programming.
|
|
|
|
|
I don't know, but guess with the use of LINQ, may be you can get this!
Please someone answer back if more information related to this is found.
thanks,
|
|
|
|
|
Does anybody knows where to find a vb 6 code that can manipulate database.. e.g. add, edit and delete a field... also code that can manipulate existing fields.. thnks..
|
|
|
|
|
Can anyone point me to more resources on Application partitioning using SQL Server? I'm thinking about developing multi-company portal so I'm in research phase for finding something that'll work out best in that case.
Thanks in advance!
|
|
|
|
|
hi , i have build an ASP.net application using Enterprise library 1.1. Curremtly i was using sql server 2000. Now i have to take my DB to sql server 2005. my question is that my current application will work with SQL server 2005??? Is enterprise library 1.1(june 2005) work well with SQL server 2005????? please reply soon...
|
|
|
|
|
Hi,
In sql plus if i type user name and password it showing account is locked.
How to release the locked account
Thanks in advance
Regards
Azeem
|
|
|
|
|
You might have to go in as admin and fix it. If it is the admin account that is locked, then not much can really be done.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
I'm using SQL Server 7 on the LAN network and I would like to block other SQL Servers from detecting or at least from accessing it.
The server still must allow access to users via applications so logins must exist. I just don't want other SQL servers on the network to be able to connect to and import/export, view table and SP, etc.
Any ideas?
|
|
|
|
|
CAn't be done. Best you can do is lock it down so that your applications use a login that has limited permissions, and make sure noone has the details of the admin account.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It cannot be done. You need to have the particular server just not be accessed by the others.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
May this work.
In sql server's properties, theres one check box as "register in ad server". Try to uncheck it and then see.
thanks,
|
|
|
|
|
CREATE FUNCTION dbo.abc (@a int)
RETURNS @Products TABLE (
CategoryName nvarchar(15)
, ProductID int)
can i , through this function type return more then one value ,I mean , scalar function return one value, or u can say in the programming languages like c# we can use ref keyword for the function parameters to get the updated value.are these parameters , refererence like parameters in c#.
and one more thing , how can i use the these updated parameters in the stored procedure , that are declared in the function under
TABLE( CategoryName nvarchar(15)
, ProductID int)
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Functions can either return a single scalar value or a table variable. Stored procedures can return more than one value if you append the OUTPUT keyword to any of your parameter declarations.
I don't understand the second part of your question. Your function returns a table variable. What do you mean by 'updated parameters'?
Paul Marfleet
|
|
|
|
|
How use of function, cursor, trigger in stored procedure in sql server
|
|
|
|
|
These are three separate areas that I recommend you reading up on by googling or buying a book.
In themselves they are fairly weighty topics so if you could be more specific you may get more specific help.
Do you understand what the these three components do?
Based on SQL Server 2000(and over-simplifying):
A function is used for returning a single value, or a table.
A cursor allows you to process one row at a time in a table, so that you can manipulate the data row by row.
A trigger is a rule that is applied to a table when an insert, update or delete s performed.
Hope this helps...
You always pass failure on the way to success.
|
|
|
|
|
I would recommend reading pl/sql from Ivan byross (sorry for spelling mistakes).
|
|
|
|
|
can i use the reference parameteres in the sql user defined functions.
actuallty i wanted to retrieve two values from the function.
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
|
ThanQ
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|