Showing posts with label advise. Show all posts
Showing posts with label advise. Show all posts

Wednesday, March 28, 2012

newbie question - sp help

hi all,

i need some helpful advise from you.
i need to write a sp that you may be able to help me with.

i have a table that only contains a numeric field. i need to write a
sp that, when executed, the numberic field increments by one and then
returns the new numeric. i have looked on the net for this, but have
not had any look...

can you please help in any way? i know nothing about writing sp's!

- hollis..Try something like:
/***********START SP

CREATE PROCEDURE numberTest @.numberIn int

AS

declare @.numberOut int

set @.numberOut = @.numberIn + 1

print @.numberOut

/***********END SP

You will need to manupulate to fit in excatly with what you need

JV
__________________________________________________ _________________
Remotely manage MS SQL db with SQLdirector -
www.ciquery.com/tools/sqldirector/

"Hollis" <hollis_uk@.lycos.co.uk> wrote in message
news:98c2c468.0309091201.50cd813d@.posting.google.c om...
> hi all,
> i need some helpful advise from you.
> i need to write a sp that you may be able to help me with.
> i have a table that only contains a numeric field. i need to write a
> sp that, when executed, the numberic field increments by one and then
> returns the new numeric. i have looked on the net for this, but have
> not had any look...
> can you please help in any way? i know nothing about writing sp's!
> - hollis..|||hollis_uk@.lycos.co.uk (Hollis) wrote in message news:<98c2c468.0309091201.50cd813d@.posting.google.com>...
> hi all,
> i need some helpful advise from you.
> i need to write a sp that you may be able to help me with.
> i have a table that only contains a numeric field. i need to write a
> sp that, when executed, the numberic field increments by one and then
> returns the new numeric. i have looked on the net for this, but have
> not had any look...
> can you please help in any way? i know nothing about writing sp's!
> - hollis..

This is one possible way:

create proc dbo.GetNextID
@.NextID int output
as
update dbo.MyTable
set @.NextID = NumericColumn = NumericColumn + 1
go

declare @.id int
exec dbo.GetNextID @.NextID = @.id output
select @.id
go

Simon

Wednesday, March 7, 2012

Newbie advise

Hi
I am going to begin my first sql server app with vb.net front end. Is there
somewhere I can read on good practices on developing sql server apps, or is
there a sample app that I can see as an example?
Thanks
Regards
I'd check the "How Do I" Videos from MSDN if you're just starting out.
This link is specific to Visual Basic.NET
http://msdn2.microsoft.com/en-us/vbasic/bb466226.aspx
"John" <info@.nospam.infovis.co.uk> wrote in message
news:eHk$nX8iIHA.5280@.TK2MSFTNGP02.phx.gbl...
> Hi
> I am going to begin my first sql server app with vb.net front end. Is
> there somewhere I can read on good practices on developing sql server
> apps, or is there a sample app that I can see as an example?
> Thanks
> Regards
>
|||Here are the samples and starter kits for SQL Server 2005 Express with have
plenty of examples in VB.NET:
http://msdn2.microsoft.com/en-us/express/bb403187.aspx
http://msdn2.microsoft.com/en-us/express/aa718396.aspx
HTH,
Plamen Ratchev
http://www.SQLStudio.com
|||My latest book is a good match for you. See www.betav.com for details or
just visit
http://www.amazon.com/Hitchhikers-Guide-Visual-Studio-Server/dp/0321243625.
It walks you through how SQL Server works in terms anyone can understand and
uses VB.NET for all of the examples from simple to far more sophisticated
approaches.
__________________________________________________ ________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
__________________________________________________ __________________________________________
"John" <info@.nospam.infovis.co.uk> wrote in message
news:eHk$nX8iIHA.5280@.TK2MSFTNGP02.phx.gbl...
> Hi
> I am going to begin my first sql server app with vb.net front end. Is
> there somewhere I can read on good practices on developing sql server
> apps, or is there a sample app that I can see as an example?
> Thanks
> Regards
>
|||On Mar 21, 10:39Xpm, "John" <i...@.nospam.infovis.co.uk> wrote:
> Hi
> I am going to begin my first sql server app with vb.net front end. Is there
> somewhere I can read on good practices on developing sql server apps, or is
> there a sample app that I can see as an example?
>
While it's actually a Visual Studio.Net reference, it has a lot of
material that covers data access in your .Net applications:
http://www.learnvisualstudio.net
Good luck!
Richard Carpenter

Newbie advise

Hi
I have an ms access background. After hearing all the good stuff about
vb2005/sql2005 I am aiming to switch over. My problem is that I am not very
familiar with features of sql server that are not found in access such as
triggers, stored procedures etc and am not sure when these should be used. I
need to know things like;
- Is it recommended to keep all/most queries as stored procedures and pass
them parameters from vb.net client or is it ok to have the queries in the vb
app?
- Are views essential or just a mater of convenience?
- Triggers, how important are these?
- What about new features of vb2005/sql2005, when should they be used?
...and so on.
Is there a place where I can get some more information, to have a better
idea of how to take the best advantage of these features?
Thanks
Regards
Hi
As most of your questions are generic then reading the SQL 2000 books online
will give you a good idea of where you should be heading. See
http://msdn.microsoft.com/library/de...ortal_7ap1.asp
In general using stored procedures is the best way to manage code and
optimize it's execution. Having Views is not essential, the need for them is
something that will be determined as part of your design process. Similarly
with triggers, your design may require them, but quite often there are
alternatives such as check constraints provide the same functionality and you
may find them easier to manage.
If you have specific issues then you may want to post a new message just
relating to that specific issue.
HTH
John
"John" wrote:

> Hi
> I have an ms access background. After hearing all the good stuff about
> vb2005/sql2005 I am aiming to switch over. My problem is that I am not very
> familiar with features of sql server that are not found in access such as
> triggers, stored procedures etc and am not sure when these should be used. I
> need to know things like;
> - Is it recommended to keep all/most queries as stored procedures and pass
> them parameters from vb.net client or is it ok to have the queries in the vb
> app?
> - Are views essential or just a mater of convenience?
> - Triggers, how important are these?
> - What about new features of vb2005/sql2005, when should they be used?
> ...and so on.
> Is there a place where I can get some more information, to have a better
> idea of how to take the best advantage of these features?
> Thanks
> Regards
>
>
|||What in the wide world of sports is MS SQL and why is it important on some of
the new programs?
Chuck
"John" wrote:

> Hi
> I have an ms access background. After hearing all the good stuff about
> vb2005/sql2005 I am aiming to switch over. My problem is that I am not very
> familiar with features of sql server that are not found in access such as
> triggers, stored procedures etc and am not sure when these should be used. I
> need to know things like;
> - Is it recommended to keep all/most queries as stored procedures and pass
> them parameters from vb.net client or is it ok to have the queries in the vb
> app?
> - Are views essential or just a mater of convenience?
> - Triggers, how important are these?
> - What about new features of vb2005/sql2005, when should they be used?
> ...and so on.
> Is there a place where I can get some more information, to have a better
> idea of how to take the best advantage of these features?
> Thanks
> Regards
>
>

Newbie advise

Hi
I have an ms access background. After hearing all the good stuff about
vb2005/sql2005 I am aiming to switch over. My problem is that I am not very
familiar with features of sql server that are not found in access such as
triggers, stored procedures etc and am not sure when these should be used. I
need to know things like;
- Is it recommended to keep all/most queries as stored procedures and pass
them parameters from vb.net client or is it ok to have the queries in the vb
app?
- Are views essential or just a mater of convenience?
- Triggers, how important are these?
- What about new features of vb2005/sql2005, when should they be used?
...and so on.
Is there a place where I can get some more information, to have a better
idea of how to take the best advantage of these features?
Thanks
RegardsHi
As most of your questions are generic then reading the SQL 2000 books online
will give you a good idea of where you should be heading. See
http://msdn.microsoft.com/library/d...
ap1.asp
In general using stored procedures is the best way to manage code and
optimize it's execution. Having Views is not essential, the need for them is
something that will be determined as part of your design process. Similarly
with triggers, your design may require them, but quite often there are
alternatives such as check constraints provide the same functionality and yo
u
may find them easier to manage.
If you have specific issues then you may want to post a new message just
relating to that specific issue.
HTH
John
"John" wrote:

> Hi
> I have an ms access background. After hearing all the good stuff about
> vb2005/sql2005 I am aiming to switch over. My problem is that I am not ver
y
> familiar with features of sql server that are not found in access such as
> triggers, stored procedures etc and am not sure when these should be used.
I
> need to know things like;
> - Is it recommended to keep all/most queries as stored procedures and pass
> them parameters from vb.net client or is it ok to have the queries in the
vb
> app?
> - Are views essential or just a mater of convenience?
> - Triggers, how important are these?
> - What about new features of vb2005/sql2005, when should they be used?
> ...and so on.
> Is there a place where I can get some more information, to have a better
> idea of how to take the best advantage of these features?
> Thanks
> Regards
>
>|||What in the wide world of sports is MS SQL and why is it important on some o
f
the new programs'
--
Chuck
"John" wrote:

> Hi
> I have an ms access background. After hearing all the good stuff about
> vb2005/sql2005 I am aiming to switch over. My problem is that I am not ver
y
> familiar with features of sql server that are not found in access such as
> triggers, stored procedures etc and am not sure when these should be used.
I
> need to know things like;
> - Is it recommended to keep all/most queries as stored procedures and pass
> them parameters from vb.net client or is it ok to have the queries in the
vb
> app?
> - Are views essential or just a mater of convenience?
> - Triggers, how important are these?
> - What about new features of vb2005/sql2005, when should they be used?
> ...and so on.
> Is there a place where I can get some more information, to have a better
> idea of how to take the best advantage of these features?
> Thanks
> Regards
>
>

Newbie advise

Hi
I am going to begin my first sql server app with vb.net front end. Is there
somewhere I can read on good practices on developing sql server apps, or is
there a sample app that I can see as an example?
Thanks
RegardsI'd check the "How Do I" Videos from MSDN if you're just starting out.
This link is specific to Visual Basic.NET
http://msdn2.microsoft.com/en-us/vbasic/bb466226.aspx
"John" <info@.nospam.infovis.co.uk> wrote in message
news:eHk$nX8iIHA.5280@.TK2MSFTNGP02.phx.gbl...
> Hi
> I am going to begin my first sql server app with vb.net front end. Is
> there somewhere I can read on good practices on developing sql server
> apps, or is there a sample app that I can see as an example?
> Thanks
> Regards
>|||Here are the samples and starter kits for SQL Server 2005 Express with have
plenty of examples in VB.NET:
http://msdn2.microsoft.com/en-us/express/bb403187.aspx
http://msdn2.microsoft.com/en-us/express/aa718396.aspx
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||My latest book is a good match for you. See www.betav.com for details or
just visit
http://www.amazon.com/Hitchhikers-Guide-Visual-Studio-Server/dp/0321243625.
It walks you through how SQL Server works in terms anyone can understand and
uses VB.NET for all of the examples from simple to far more sophisticated
approaches.
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
"John" <info@.nospam.infovis.co.uk> wrote in message
news:eHk$nX8iIHA.5280@.TK2MSFTNGP02.phx.gbl...
> Hi
> I am going to begin my first sql server app with vb.net front end. Is
> there somewhere I can read on good practices on developing sql server
> apps, or is there a sample app that I can see as an example?
> Thanks
> Regards
>|||On Mar 21, 10:39=A0pm, "John" <i...@.nospam.infovis.co.uk> wrote:
> Hi
> I am going to begin my first sql server app with vb.net front end. Is ther=e
> somewhere I can read on good practices on developing sql server apps, or i=s
> there a sample app that I can see as an example?
>
While it's actually a Visual Studio.Net reference, it has a lot of
material that covers data access in your .Net applications:
http://www.learnvisualstudio.net
Good luck!
--
Richard Carpenter

Newbie advise

Hi
I have an ms access background. After hearing all the good stuff about
vb2005/sql2005 I am aiming to switch over. My problem is that I am not very
familiar with features of sql server that are not found in access such as
triggers, stored procedures etc and am not sure when these should be used. I
need to know things like;
- Is it recommended to keep all/most queries as stored procedures and pass
them parameters from vb.net client or is it ok to have the queries in the vb
app?
- Are views essential or just a mater of convenience?
- Triggers, how important are these?
- What about new features of vb2005/sql2005, when should they be used?
...and so on.
Is there a place where I can get some more information, to have a better
idea of how to take the best advantage of these features?
Thanks
RegardsHi
As most of your questions are generic then reading the SQL 2000 books online
will give you a good idea of where you should be heading. See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/startsql/portal_7ap1.asp
In general using stored procedures is the best way to manage code and
optimize it's execution. Having Views is not essential, the need for them is
something that will be determined as part of your design process. Similarly
with triggers, your design may require them, but quite often there are
alternatives such as check constraints provide the same functionality and you
may find them easier to manage.
If you have specific issues then you may want to post a new message just
relating to that specific issue.
HTH
John
"John" wrote:
> Hi
> I have an ms access background. After hearing all the good stuff about
> vb2005/sql2005 I am aiming to switch over. My problem is that I am not very
> familiar with features of sql server that are not found in access such as
> triggers, stored procedures etc and am not sure when these should be used. I
> need to know things like;
> - Is it recommended to keep all/most queries as stored procedures and pass
> them parameters from vb.net client or is it ok to have the queries in the vb
> app?
> - Are views essential or just a mater of convenience?
> - Triggers, how important are these?
> - What about new features of vb2005/sql2005, when should they be used?
> ...and so on.
> Is there a place where I can get some more information, to have a better
> idea of how to take the best advantage of these features?
> Thanks
> Regards
>
>|||What in the wide world of sports is MS SQL and why is it important on some of
the new programs'
--
Chuck
"John" wrote:
> Hi
> I have an ms access background. After hearing all the good stuff about
> vb2005/sql2005 I am aiming to switch over. My problem is that I am not very
> familiar with features of sql server that are not found in access such as
> triggers, stored procedures etc and am not sure when these should be used. I
> need to know things like;
> - Is it recommended to keep all/most queries as stored procedures and pass
> them parameters from vb.net client or is it ok to have the queries in the vb
> app?
> - Are views essential or just a mater of convenience?
> - Triggers, how important are these?
> - What about new features of vb2005/sql2005, when should they be used?
> ...and so on.
> Is there a place where I can get some more information, to have a better
> idea of how to take the best advantage of these features?
> Thanks
> Regards
>
>

Newbie advise

Hi
I have an ms access background. After hearing all the good stuff about
vb2005/sql2005 I am aiming to switch over. My problem is that I am not very
familiar with features of sql server that are not found in access such as
triggers, stored procedures etc and am not sure when these should be used. I
need to know things like;
- Is it recommended to keep all/most queries as stored procedures and pass
them parameters from vb.net client or is it ok to have the queries in the vb
app?
- Are views essential or just a mater of convenience?
- Triggers, how important are these?
- What about new features of vb2005/sql2005, when should they be used?
...and so on.
Is there a place where I can get some more information, to have a better
idea of how to take the best advantage of these features?
Thanks
RegardsHi
As most of your questions are generic then reading the SQL 2000 books online
will give you a good idea of where you should be heading. See
ap1.asp" target="_blank">http://msdn.microsoft.com/library/d...
ap1.asp
In general using stored procedures is the best way to manage code and
optimize it's execution. Having Views is not essential, the need for them is
something that will be determined as part of your design process. Similarly
with triggers, your design may require them, but quite often there are
alternatives such as check constraints provide the same functionality and yo
u
may find them easier to manage.
If you have specific issues then you may want to post a new message just
relating to that specific issue.
HTH
John
"John" wrote:

> Hi
> I have an ms access background. After hearing all the good stuff about
> vb2005/sql2005 I am aiming to switch over. My problem is that I am not ver
y
> familiar with features of sql server that are not found in access such as
> triggers, stored procedures etc and am not sure when these should be used.
I
> need to know things like;
> - Is it recommended to keep all/most queries as stored procedures and pass
> them parameters from vb.net client or is it ok to have the queries in the
vb
> app?
> - Are views essential or just a mater of convenience?
> - Triggers, how important are these?
> - What about new features of vb2005/sql2005, when should they be used?
> ...and so on.
> Is there a place where I can get some more information, to have a better
> idea of how to take the best advantage of these features?
> Thanks
> Regards
>
>|||What in the wide world of sports is MS SQL and why is it important on some o
f
the new programs'
--
Chuck
"John" wrote:

> Hi
> I have an ms access background. After hearing all the good stuff about
> vb2005/sql2005 I am aiming to switch over. My problem is that I am not ver
y
> familiar with features of sql server that are not found in access such as
> triggers, stored procedures etc and am not sure when these should be used.
I
> need to know things like;
> - Is it recommended to keep all/most queries as stored procedures and pass
> them parameters from vb.net client or is it ok to have the queries in the
vb
> app?
> - Are views essential or just a mater of convenience?
> - Triggers, how important are these?
> - What about new features of vb2005/sql2005, when should they be used?
> ...and so on.
> Is there a place where I can get some more information, to have a better
> idea of how to take the best advantage of these features?
> Thanks
> Regards
>
>