|
CREATE PROCEDURE Ks_Ins_Media_Item
@Desc nvarchar(200),
@added_date datetime,
@Added_by nvarchar(100),
@item int output
As
insert into Ks_Media_Item ([Description],Added_Date,Added_By)
values(@Desc,@added_date,@Added_by)
set @item = @@identity
CREATE PROCEDURE Ks_Ins_Media_Item_content
@Item_No int,
@content ntext,
@textlength int
As
insert into Ks_Media_Item_content(Item_no,content,text_length)
values(@item_no,@content,@textlength)
CREATE procedure ks_media_item_full_data
@Desc nvarchar(200),
@added_date datetime,
@Added_by nvarchar(100),
@content ntext,
@textlength int
as
declare @ItemNo int
execute dbo.Ks_Ins_Media_Item @Desc, @added_date, @Added_by, @ItemNo output
execute dbo.Ks_Ins_Media_Item_content @ItemNo,@content, @textlength
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
i have procedure with output parametr
i have to pass it to another procedure
in execution what is the syntax of it
pls
|
|
|
|
|
procedure1(procedure2(proc2Param))
|
|
|
|
|
it's cannat run can i pass the code to you yo see
the error
thank you
|
|
|
|
|
Paste ur code here and we will solve problem
|
|
|
|
|
Hi,
I need to modify a MS Access database:
- Rename tables
- Rename columns
- Add new columns and set field properties
(Can't seem to set "Allow Zero Length" with Access SQL)
I'm finding that SQL for Access is sometimes lacking when I need to update the database as my application grows. I see from my on-line research that some people turn to DAO or ADOX. If I'm working with an Access db, which should I use and why?
PS - Why would MS Access have a field property "Allow Zero Length" but no SQL statement to set/change it?
thanks,
Ron
|
|
|
|
|
First of all, only Text, Memo and Hyperlink fields can accept zero length strings and therefore have that property.
You may want to look into using DDL to manage your table properties.
Steve
|
|
|
|
|
Thanks Steve,
I knew that only Text, Memo and Hyperlink fields only have that property, but as far as my research, I can't use SQL to change this property... if there is, please let me know.
Thanks for the tip on DDL, I'll do some research.
Ron
|
|
|
|
|
I always do such edits in Access. I have never tried to alter table structures dynamically from VB.
You may want to try posting your question in MDBMakers.com.
This forum has Access MVP's and many knowledgeable users who may be able to help you.
Steve
|
|
|
|
|
hi,
i'm working on mysql database i want to select from table last 10 rows inserted where id=5
Always Thx for you help
Regards,
Charbel Asmar
|
|
|
|
|
SELECT * from mytable where id=5 order by orderbyfield <code>LIMIT 10</code>
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I'm using VC++ 6.0, and using the ODBC API to connect to the databse.
My question is that is there a way to find the limit of the number of fields permitted per Primary Key.
Eg. For MS SQL 2000/ 2005 limit is 16 or less fields for a primary key.
For MS Access the limit is 10 or less fields for a primary key.
|
|
|
|
|
Try SQLGetInfo(SQL_MAX_COLUMNS_IN_INDEX).
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hi guys;
I have this problem with sql server 2000 and asp.net 2.0
Here is the problem:
I am trying to use the Roles.AddUserToRole(string username ,string Role) .
Now the problem starts when the program gets to this place where it has to execute the addusertorole method. Im getting this error:
Error 446: cannot resolve collation conflict for equal to operation
I have read alot and searched the internet but I dont quit get what am I suppose to do.
Could you please help me to resolve this problem?
Thanks a million
Hadi
|
|
|
|
|
Hi ;
Thanks alot for the reply from minhpc_bk was very usefull. Right on time.
Here is how i fixed the problem:
I replaced the line in aspnet_UsersInRoles_AddUsersToRoles stored procedure
DECLARE @tbNames table(Name nvarchar(256) NOT NULL PRIMARY KEY)
with
DECLARE @tbNames table(Name nvarchar(256) COLLATE Database_Default NOT NULL PRIMARY KEY)
Riazi
|
|
|
|
|
Hi,
In SQL Server Everywhere, there is no support for keyword "TOP" for selecting
limited number of rows. Can you give me any idea how can I perform similar task with this limitation ?
Thanks in advance
|
|
|
|
|
Hi;
If I understood your problem your trying to select a limited number of rows of your table?
What version of SQL SERVER are you using? If your using 2000 then the TOP keyword should work fine.
SELECT TOP 7 FROM LatestNews
Im using it with out problems.
Riazi
|
|
|
|
|
Hi Riazi,
Thanks for your support.
I am using SQL SERVER EVERYWHERE 2005, which is a latest mobile and desktop database solution from Microsoft released very recently in this year. This is actually SQL Server Mobile upgraded version. And this SQL Server Everywhere doesnot support TOP and ROWCOUNT keyword. So, I thought there might be some tehcnique to perform this similar task.
SQL SERVER EVERYWHERE 2005 : Web link[^]
Thanks and regards.
|
|
|
|
|
Does this work?
Set ROWCOUNT @aNumber
Farhan Noor Qureshi
|
|
|
|
|
Hi Farhan,
Thanks for your support.
I am using SQL SERVER EVERYWHERE 2005, which is a latest mobile and desktop database solution from Microsoft released very recently in this year. This is actually SQL Server Mobile upgraded version. And this SQL Server Everywhere doesnot support TOP and ROWCOUNT keyword. So, I thought there might be some tehcnique to perform this similar task.
Thanks and regards.
|
|
|
|
|
As with all computer technology there are usually many ways to perform one task.
At our shop we're new at the whole SQL database process. On our old apps with our mainframe we have test databases, we make changes and then copy the framework of the test database into production.
With SQL we have two servers. A development server and a production server. What is the best way to move a database from our development server with select tables and select stored procedures.
Does the backup / restore process lend itself to this kind of move or should we be researching into DTS?
I'm looking for suggestions from those of you who have worked with SQL databases for years and can guide newbies to the best solution you've found.
Any suggestions are welcome
Lost in the vast sea of .NET
|
|
|
|
|
KreativeKai wrote: What is the best way to move a database from our development server with select tables and select stored procedures.
One way would be to have sql scripts that create new tables / stored procedures and update altered tables / stored procedures. Run these scripts on the production server after you've tested on the development server.
I am sure there are other ways, but this is the first to come to my mind
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|
|
Using the enterprise manager you could choose the copy database item from the context menu. This could be used to copy the database and create a script to be run for later updates.
only two letters away from being an asset
|
|
|
|
|
Cool!!
That seems way to simple, but I tested it and it works great!!
Are there any drawbacks? Is it accurate creating the scripts or are there disadvantages to this method??
Thanks for your idea!!
Lost in the vast sea of .NET
|
|
|
|
|
KreativeKai wrote: Is it accurate creating the scripts or are there disadvantages to this method??
Use scripts unless you want to update any changes by hand.
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|