Showing posts with label store. Show all posts
Showing posts with label store. Show all posts

Wednesday, March 21, 2012

hi Im facing problem in adding values to the database sqlserver2k

hi everyone,

I have a form in in that 3columns and 8rows default.. I have to store values for 8 rows at a time in to database..

I am working with vs2003, asp.net & C# behind the code.. so pls send me a code for implementing this.. asap

vijai

what problem you are facing mention it here. There are lot of scenarious how u want to add the data. Depends on your code and architecture...

|||

Hi Vijai,

Have you created the datatable yet and what about the table's design? Since you haven't told us the details, I just suggest some reference to you.

About how to implement data access in ASP.NET : http://quickstarts.asp.net/QuickStartv20/aspnet/doc/data/default.aspx
Something about SQL Basic reference: http://www.w3schools.com/sql/sql_insert.asp
About table creating:http://www.w3schools.com/sql/sql_create.asp or just using the wizard in the tool such like Sql Server enterprise manager.

Thanks.

Monday, March 19, 2012

Hex no

Can you store hex no in SQL Server or mySQL?
Thanks
Jack
"Jacky Luk" <jl@.knight.com> wrote in message
news:#R5wtObKEHA.3580@.TK2MSFTNGP10.phx.gbl...
> Can you store hex no in SQL Server or mySQL?
Explain what you mean by a hex no?
Steve
|||Hex no = 0xFFFFFFFF 0x51B2032 0x4100000 etc
Thanks
Jack
"Steve Thompson" <SteveThompson@.nomail.please> glsD
:#osGBm7KEHA.3428@.TK2MSFTNGP09.phx.gbl...
> "Jacky Luk" <jl@.knight.com> wrote in message
> news:#R5wtObKEHA.3580@.TK2MSFTNGP10.phx.gbl...
> Explain what you mean by a hex no?
> Steve
>
|||Gotcha -- yes you can, with a binary or varbinary data type, insert the
value as a:
0xFFFFFFFF
Steve
"Jack" <jl@.knight.com> wrote in message
news:OtxxkWALEHA.268@.TK2MSFTNGP10.phx.gbl...
> Hex no = 0xFFFFFFFF 0x51B2032 0x4100000 etc
> Thanks
> Jack
> "Steve Thompson" <SteveThompson@.nomail.please> glsD
> :#osGBm7KEHA.3428@.TK2MSFTNGP09.phx.gbl...
>

Hex no

Can you store hex no in SQL Server or mySQL?
Thanks
Jack"Jacky Luk" <jl@.knight.com> wrote in message
news:#R5wtObKEHA.3580@.TK2MSFTNGP10.phx.gbl...
> Can you store hex no in SQL Server or mySQL?
Explain what you mean by a hex no?
Steve|||Hex no = 0xFFFFFFFF 0x51B2032 0x4100000 etc
Thanks
Jack
"Steve Thompson" <SteveThompson@.nomail.please> glsD
:#osGBm7KEHA.3428@.TK2MSFTNGP09.phx.gbl...
> "Jacky Luk" <jl@.knight.com> wrote in message
> news:#R5wtObKEHA.3580@.TK2MSFTNGP10.phx.gbl...
> Explain what you mean by a hex no?
> Steve
>|||Gotcha -- yes you can, with a binary or varbinary data type, insert the
value as a:
0xFFFFFFFF
Steve
"Jack" <jl@.knight.com> wrote in message
news:OtxxkWALEHA.268@.TK2MSFTNGP10.phx.gbl...
> Hex no = 0xFFFFFFFF 0x51B2032 0x4100000 etc
> Thanks
> Jack
> "Steve Thompson" <SteveThompson@.nomail.please> glsD
> :#osGBm7KEHA.3428@.TK2MSFTNGP09.phx.gbl...
>

Friday, March 9, 2012

Help_Creating Archive Table

I have a table called customers that store information about the particular customer. I would like to have a table called Archive so that when I delete a Customer that have not been active for a specific time then the deleted information will be automatically be inserted into the Archive table. Do I need to create the archive table with the same numbers of columns as exactly as the customer table?

I need some basic idea about how this should be implemented.

Any input will be appreciated.
Thanks in advanceDo you use foreign keys? If so - you have to move customer activity history to archive table too. Structure of table could be the same, unless you want to know when data were moved to archive or any other additional information. And do not use removed ids again....|||Thank you snail for the reply
I have just created the Archive table. The primary key of the Customer Table is a foreign key in the archive table. I have added three more columns in the Archive Table namely Comments,ArchiveDate and EmployeeName, these three columns are not in the customer Table.Can this be possible? as this colums are not in the Customer Table. These columns are important because when a customer is deleted I want to be able to enter the reason why a specific customer was deleted. What did u mean by ids, are you talking about Identity Seed or?
Again I have trouble formulating the query that will insert the deleted columns into the Archive Table. Need additional Info
Thanks for the help so far|||well, if you got two identical tables you could write a trigger that fires on a deleted record from the customers table you can use
INSETED OF DELETE trigger

or if you got two different tables you can write a store procedure for deleting so it can insert the required record into the archive table with
the supplied fields first you have to insert to the achive table
using
insert into achive(field1,field2)
select field1,field2 from customers where customerid = @.custID

then update the record in the achive using
update achive set field6 = @.employeeName ...
where customerid = @.custID

to it then delete the record from the customers table.|||Thank u elamor for the reply. I am going to use Store Procedure, the idea is clear, I think with these info I know where to start, definately I might be posting my query here for deburg if ?

Friday, February 24, 2012

HELP: MFC ODBC SQL Server problems

I got a problem where in SQL Server a table has a column of type REAL & size
(precision) 4. It's meant to store double types for C++ variable values.
In SQL Server, the value 1E+10 translates to 10000000000 in C++ fine, via
MFC's CRecordset class (DBCORE.CPP). However any numbers above this value
translates to wrong numbers. Such as:
1.1E+10 => 10000000512
1.00001E+10 => 10000001024
1.01E+10 => 10099999744
1.0000001E+10 => 10000100352
Strange huh? Has anybody experienced this before? Does anyone know what is
wrong? I tried upgrading my SQL Server 2000 to SP4 and even upgraded MAC2.6
to SP2. Still no success.You should not use "Real" to handle a big number like "1E+10" since real
data type does not have enough precisions to do the job. If you change
the data type to "Float", you will have better chance to get the number
right. Or if you want to store "Exact" numbers, you should use "decimal"
as your data type.
Charles Zhang
http://www.speedydb.com
SpeedyDB ADO.NET is the fastest, most secure, and most flexible ADO.NET
Provider over Wide Area Netword (WAN).
Andrew Wan wrote:
> I got a problem where in SQL Server a table has a column of type REAL & si
ze
> (precision) 4. It's meant to store double types for C++ variable values.
> In SQL Server, the value 1E+10 translates to 10000000000 in C++ fine, via
> MFC's CRecordset class (DBCORE.CPP). However any numbers above this value
> translates to wrong numbers. Such as:
> 1.1E+10 => 10000000512
> 1.00001E+10 => 10000001024
> 1.01E+10 => 10099999744
> 1.0000001E+10 => 10000100352
> Strange huh? Has anybody experienced this before? Does anyone know what is
> wrong? I tried upgrading my SQL Server 2000 to SP4 and even upgraded MAC2.
6
> to SP2. Still no success.
>
>

HELP: Installing SQl server databases

Dear all,
One of our application consist of configuring an SQL server database with
user rights to tables and preparing corresponding store procedure.
usually when we do this, we prepare the server in our test environment and
then ship the whole hardware pre configure to customers.
in some cases we do not have the customer server, so we need to do the whole
configuration on site and in cas of errors its hard to find.
is there an easy way to prepare the SQL confisuration database, store
procedure, table rights on a test PC, then do a kind of straight forward
deployement on any server running SQL ?
thanks for your help
regards
SergeHi,
You can create the customer database in your local sql server. Do all the
setups in that new database. backup the database or detach the database.
Copy the backup or MDF and LDF file and take it in a tape. Restore the files
from tape to Customer side server and
do a Database restore or Attach the MDF and LDF.
Incase if you have login an user suid mismacth use the system stored
procedure sp_change_users_login to fix.
This will ensure that all the configurations are avaiable.
Thanks
Hari
SQL Server MVP
"serge calderara" <sergecalderara@.discussions.microsoft.com> wrote in
message news:EDEAF3C8-903B-49D6-8A48-9FD1B71E379F@.microsoft.com...
> Dear all,
> One of our application consist of configuring an SQL server database with
> user rights to tables and preparing corresponding store procedure.
> usually when we do this, we prepare the server in our test environment and
> then ship the whole hardware pre configure to customers.
> in some cases we do not have the customer server, so we need to do the
> whole
> configuration on site and in cas of errors its hard to find.
> is there an easy way to prepare the SQL confisuration database, store
> procedure, table rights on a test PC, then do a kind of straight forward
> deployement on any server running SQL ?
> thanks for your help
> regards
> Serge|||I have seen the method suggested earlier about taking the mdf and ldf and
using sp_attach_Db and in most cases you should be OK ( except for
permissions.) However the risk you are taking is with the file version...
The physical files will only have a limited life span, as MS changes things
usually attach works for one release backwards...
Another way is to generate scripts... These take longer to run, but are
usually safer because basic syntax does not change that often...One thing
you might do is combine the two... In your release, generate the scripts.
Then when you are about to go and setup a db for a user, THEN run the
scripts, and take the resulting mdf and ldf...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"serge calderara" <sergecalderara@.discussions.microsoft.com> wrote in
message news:EDEAF3C8-903B-49D6-8A48-9FD1B71E379F@.microsoft.com...
> Dear all,
> One of our application consist of configuring an SQL server database with
> user rights to tables and preparing corresponding store procedure.
> usually when we do this, we prepare the server in our test environment and
> then ship the whole hardware pre configure to customers.
> in some cases we do not have the customer server, so we need to do the
> whole
> configuration on site and in cas of errors its hard to find.
> is there an easy way to prepare the SQL confisuration database, store
> procedure, table rights on a test PC, then do a kind of straight forward
> deployement on any server running SQL ?
> thanks for your help
> regards
> Serge|||I am a bit confuse as I am new in that part.
let say that my ServerA is my test server in my office on which I prepare
every thing
lets call ServerB the target server on which th final DB will run
Could you please details me which operation to do on which server?
What is the content of those MDF and LDF files ?
How to deploy rights or group from server A to ServerB at the same time
thanks and sorry to disturb
experince will come with the time :-)
serge
"Wayne Snyder" wrote:
> I have seen the method suggested earlier about taking the mdf and ldf and
> using sp_attach_Db and in most cases you should be OK ( except for
> permissions.) However the risk you are taking is with the file version...
> The physical files will only have a limited life span, as MS changes things
> usually attach works for one release backwards...
> Another way is to generate scripts... These take longer to run, but are
> usually safer because basic syntax does not change that often...One thing
> you might do is combine the two... In your release, generate the scripts.
> Then when you are about to go and setup a db for a user, THEN run the
> scripts, and take the resulting mdf and ldf...
>
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "serge calderara" <sergecalderara@.discussions.microsoft.com> wrote in
> message news:EDEAF3C8-903B-49D6-8A48-9FD1B71E379F@.microsoft.com...
> > Dear all,
> >
> > One of our application consist of configuring an SQL server database with
> > user rights to tables and preparing corresponding store procedure.
> >
> > usually when we do this, we prepare the server in our test environment and
> > then ship the whole hardware pre configure to customers.
> >
> > in some cases we do not have the customer server, so we need to do the
> > whole
> > configuration on site and in cas of errors its hard to find.
> >
> > is there an easy way to prepare the SQL confisuration database, store
> > procedure, table rights on a test PC, then do a kind of straight forward
> > deployement on any server running SQL ?
> >
> > thanks for your help
> > regards
> > Serge
>
>|||On ServerA you will prepare the database to be installed, call it DBa. Once
this is complete you have 2 choices. 1) You can dump DBa and use the
resulting dump file, or 2) you can detach DBa and use the MDF and LDF files.
Copy either the dump file or MDF and LDF files to ServerB.
If you selected the database dump option, restore DBa. See Books Online for
the syntax.
If you selected the detach option, attach DBa. Again see Books Online for
the syntax.
As mentioned in one of the earlier posts if you created any data server
logins and database users you will need to fix those up via the
sp_change_users_login stored proc. See Books Online for documentation.
"serge calderara" wrote:
> I am a bit confuse as I am new in that part.
> let say that my ServerA is my test server in my office on which I prepare
> every thing
> lets call ServerB the target server on which th final DB will run
> Could you please details me which operation to do on which server?
> What is the content of those MDF and LDF files ?
> How to deploy rights or group from server A to ServerB at the same time
> thanks and sorry to disturb
> experince will come with the time :-)
> serge
> "Wayne Snyder" wrote:
> > I have seen the method suggested earlier about taking the mdf and ldf and
> > using sp_attach_Db and in most cases you should be OK ( except for
> > permissions.) However the risk you are taking is with the file version...
> > The physical files will only have a limited life span, as MS changes things
> > usually attach works for one release backwards...
> >
> > Another way is to generate scripts... These take longer to run, but are
> > usually safer because basic syntax does not change that often...One thing
> > you might do is combine the two... In your release, generate the scripts.
> > Then when you are about to go and setup a db for a user, THEN run the
> > scripts, and take the resulting mdf and ldf...
> >
> >
> > --
> > Wayne Snyder, MCDBA, SQL Server MVP
> > Mariner, Charlotte, NC
> > www.mariner-usa.com
> > (Please respond only to the newsgroups.)
> >
> > I support the Professional Association of SQL Server (PASS) and it's
> > community of SQL Server professionals.
> > www.sqlpass.org
> >
> > "serge calderara" <sergecalderara@.discussions.microsoft.com> wrote in
> > message news:EDEAF3C8-903B-49D6-8A48-9FD1B71E379F@.microsoft.com...
> > > Dear all,
> > >
> > > One of our application consist of configuring an SQL server database with
> > > user rights to tables and preparing corresponding store procedure.
> > >
> > > usually when we do this, we prepare the server in our test environment and
> > > then ship the whole hardware pre configure to customers.
> > >
> > > in some cases we do not have the customer server, so we need to do the
> > > whole
> > > configuration on site and in cas of errors its hard to find.
> > >
> > > is there an easy way to prepare the SQL confisuration database, store
> > > procedure, table rights on a test PC, then do a kind of straight forward
> > > deployement on any server running SQL ?
> > >
> > > thanks for your help
> > > regards
> > > Serge
> >
> >
> >