Friday, March 30, 2012

how to create sql database in visual basic

First i am newbie in vb and Sql server...

Is possible to create and attaching, via vb classic or VBA, a sql
database in this instance:\\DVD377-14D9E48C\SQLEXPRESS...
I have Sql Express.

Database name: mydatabase
Database Table: mytable

fileds:
fiedl1 text format
fiedl2 text format
fiedl3 text format
fiedl4 date format
fiedl5 number format
fiedl6 text formatFirst i am newbie in vb and Sql server...

Is possible to create and attaching, via vb classic or VBA, a sql
database in this instance:\\DVD377-14D9E48C\SQLEXPRESS...
I have Sql Express.

Database name: mydatabase
Database Table: mytable

fileds:
fiedl1 text format
fiedl2 text format
fiedl3 text format
fiedl4 date format
fiedl5 number format
fiedl6 text format

You can execute sql statement from your code...its better to read a book on vb - database programming.|||Also it's best not to be creating tables from app code.

If your app logs in as a user that has rights to create tables, then it's logging in as a user with far too many rights - usually only an admin would be allowed to create tables. So this would ONLY be acceptable to me if your app was an administrative app, such as SSMS. :)

How to create sproc with unlimited number of parameters?

We have this kind of thing in C#, and I know the sp_executesql (or something like that) does it too. How do you create a stored procedure that has certain known parameters, followed by any number of additional parameters?

For example, you may have one that's called in any of these ways:

exec my_sp @.ID, @.text, @.P1, @.P2

exec my_sp @.ID, @.text, @.P1, @.P2, @.P3

exec my_sp @.ID, @.text, @.P4, @.P39087, @.P2

I can't find a syntax in the docs that really accommodates this.

Thanks in advance for your help!

Is something like this what you are looking for? This defines a procedure with M required parameters and N optional parameters:

create procedure dbo.xample
( @.pm_required_01 <type#01>,
@.pm_required_02 <type#02>,
...
@.pm_required_M <type#M>,
@.pm_optional_01 <type#01> = <defaultValue#01>,
@.pm_optional_02 <type#02> = <defaultValue#02>,
...
@.pm_optional_N <Type#N> = <defaultValue#N>
)
as

yourCode

|||Does this solution enforce a maximum number of parameters though? If so, that's not quite what I was after.

I guess the other problem too is that there has to be some way to iterate through all of the parameters as well.|||

Jeff:

It sounds to me like you want to use a "list" as an argument to the stored procedure; if that is the case examine this article by Erland Sommarskog and see if this is the correct orientation:

http://www.sommarskog.se/arrays-in-sql.html

Also, there is a response here from Jens Suessmeyer that has some more about using a "string list":

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=326300&SiteID=1

|||

TSQL has a hard limit of ~2K Parameters to any module. Thus, there is no way to do what your asking natively in TSQL (i.e, the best you can do is 2K sql_variant parameters with a default defined ).

People have used various techniques to get around this problem, most of which are nicely summarized in the links above.

How to create spool in PL/SQL

I want to create many different spools in PL/SQL programs, therefore i can't use 'spool' command for create a single in .sql file.
Can any one help me? Thx alot...Urgent!Originally posted by wwwdavy
I want to create many different spools in PL/SQL programs, therefore i can't use 'spool' command for create a single in .sql file.

Can any one help me? Thx alot...Urgent!
Perhaps the UTL_FILE package is what you need? This allows PL/SQL to open, read/write and close files on the server.|||Originally posted by andrewst
Perhaps the UTL_FILE package is what you need? This allows PL/SQL to open, read/write and close files on the server.

That's GOOD! Thx very much! Nice to meet u ^_^

How to create slideshow of a report?

Hi Expert!
I got a report showing the list of current sale volume by each office
branch. We got 20 offices. Is there a slideshow software package or ASP.NET
control out there to display my report as what PowerPoint does. I would like
to be able to pass in the report parameters.
Thanks in advance for any clue
ThanhOn Feb 26, 3:11 pm, Thanh Nguyen
<ThanhNgu...@.discussions.microsoft.com> wrote:
> Hi Expert!
> I got a report showing the list of current sale volume by each office
> branch. We got 20 offices. Is there a slideshow software package or ASP.NET
> control out there to display my report as what PowerPoint does. I would like
> to be able to pass in the report parameters.
> Thanks in advance for any clue
> Thanh
One option would be to use SnagIt to record the parameter passing,
report execution, etc; and then play it back as video or use
screenshot frames. Hope this is helpful.
Regards,
Enrique Martinez
Sr. SQL Server Developer|||Thanks for your reply.
I would like to my slideshow to be real-time as much as possible, that means
once it reaches the end of the slideshow, it should be able to re-query again
and display the new sale volume in the next 1st slide. You can think of this
like stocks banner or something like that.
"EMartinez" wrote:
> On Feb 26, 3:11 pm, Thanh Nguyen
> <ThanhNgu...@.discussions.microsoft.com> wrote:
> > Hi Expert!
> >
> > I got a report showing the list of current sale volume by each office
> > branch. We got 20 offices. Is there a slideshow software package or ASP.NET
> > control out there to display my report as what PowerPoint does. I would like
> > to be able to pass in the report parameters.
> >
> > Thanks in advance for any clue
> > Thanh
>
> One option would be to use SnagIt to record the parameter passing,
> report execution, etc; and then play it back as video or use
> screenshot frames. Hope this is helpful.
> Regards,
> Enrique Martinez
> Sr. SQL Server Developer
>|||You can burn your powerpoint slideshow to dvd,
by this way you can a real-time and interactive dvd which can control each
silde play with a remote.
Play the DVD with a dvd player.
Burn the powerpoint slide show with Wondershare PPT2DVD
http://www.ppt-to-dvd.com/download.php?sid=4
--
PowerPoint software
http://www.ppt-to-dvd.com
PowerPoit free templates
http://www.ppt-to-dvd.com/free-templates.php?sid=4
"Thanh Nguyen" wrote:
> Thanks for your reply.
> I would like to my slideshow to be real-time as much as possible, that means
> once it reaches the end of the slideshow, it should be able to re-query again
> and display the new sale volume in the next 1st slide. You can think of this
> like stocks banner or something like that.
> "EMartinez" wrote:
> > On Feb 26, 3:11 pm, Thanh Nguyen
> > <ThanhNgu...@.discussions.microsoft.com> wrote:
> > > Hi Expert!
> > >
> > > I got a report showing the list of current sale volume by each office
> > > branch. We got 20 offices. Is there a slideshow software package or ASP.NET
> > > control out there to display my report as what PowerPoint does. I would like
> > > to be able to pass in the report parameters.
> > >
> > > Thanks in advance for any clue
> > > Thanh
> >
> >
> > One option would be to use SnagIt to record the parameter passing,
> > report execution, etc; and then play it back as video or use
> > screenshot frames. Hope this is helpful.
> >
> > Regards,
> >
> > Enrique Martinez
> > Sr. SQL Server Developer
> >
> >sql

How to create Site Map based on Catalog table

Hi
I want to create site map with quick access to all reports in my intranet.
I have already static map without links, based on Catalog table and i want
to expand its funcionality by adding dynamic links.
Has someone already solved this problem?
thx5 minutes after sending my question i found solution. Maybe someone will find
it usefull :
all you need is to make the link to URL (using navigation tab) to expresion :
="http://reports.mycompany.com/Reports/Pages/Report.aspx?ItemPath="
+ Fields!Path.Value
that's all - it's working!

How to create simple insert trigger

I have just one table but need to create a trigger that takes place after an update on the Orders table. I need it to multiply two columns and populate the 3rd column (total cost) with the result as so:

Orders

ProductPrice ProductQuantity TotalCost
-- --
£2.50 2
£1.75 3
£12.99 2

Can anyone please help me?You don't need a trigger, you need a computed column:

CREATE TABLE [dbo].[xxx](
[col_a] [int] NOT NULL default(2),
[col_b] [int] NOT NULL default(2),
[col_axb] as a * b,
) ON [PRIMARY]
GO|||Thank you for the help!

How to create server alias

Can anyone descrive in principle how a Web server alias is actually set
up? How do you get a server alias to point to a particular server with
a particular IP address within a large organisation? The outcome being
that when a user types the alias url into the address bar, the correct
page appears in the browser window
Hi
Does it somehow relate to SQL Server?
<simonaj30@.yahoo.co.uk> wrote in message
news:1162895112.082029.220030@.i42g2000cwa.googlegr oups.com...
> Can anyone descrive in principle how a Web server alias is actually set
> up? How do you get a server alias to point to a particular server with
> a particular IP address within a large organisation? The outcome being
> that when a user types the alias url into the address bar, the correct
> page appears in the browser window
>
|||I would think so, as we use it in our organisation
Uri Dimant wrote:[vbcol=seagreen]
> Hi
> Does it somehow relate to SQL Server?
>
> <simonaj30@.yahoo.co.uk> wrote in message
> news:1162895112.082029.220030@.i42g2000cwa.googlegr oups.com...
|||Well, If I understood you , take a look at Client Network Utility to add a
new alias to the server
<simonaj30@.yahoo.co.uk> wrote in message
news:1162896637.485781.85960@.m73g2000cwd.googlegro ups.com...
>I would think so, as we use it in our organisation
> Uri Dimant wrote:
>
|||You right Uri...
Post this in question in Internet Information service(IIS) group. This is
done through IIS configuration.
This is SQL Server group.
vinu
<simonaj30@.yahoo.co.uk> wrote in message
news:1162896637.485781.85960@.m73g2000cwd.googlegro ups.com...
>I would think so, as we use it in our organisation
> Uri Dimant wrote:
>
|||ok, many thanks
Uri Dimant wrote:[vbcol=seagreen]
> Well, If I understood you , take a look at Client Network Utility to add a
> new alias to the server
>
> <simonaj30@.yahoo.co.uk> wrote in message
> news:1162896637.485781.85960@.m73g2000cwd.googlegro ups.com...