Showing posts with label single. Show all posts
Showing posts with label single. Show all posts

Tuesday, March 27, 2012

binding textbox text to a database field

hello

is it possible to to bind a single field from a database table to a textbox.

I am trying to open a web form with five textboxes on it. When it loads is it possible to have the textboxes filled with a different field from a row in a database, selected with a sql statment.

Thanks in advance NubNub

Wrong Forum.|||

Yes, that is quite possible.

But you will get better assistance if you post your question in one of the .NET ASP related forums.

sql

Sunday, March 25, 2012

Bind many tables from a single sp on many tables on a single repor

Hi,
i've a single stored procedure that return many tables from different select
queries. it is possible to bind on a single report all "recordset" on
different tables? in other words how i can "navigate" the source dataset, is
possible to refer to a kind of dataset index? ex. dsname[1], dsname[2] etc?RS does not support this. You either need multiple stored procedures or you
need to pass a parameter to the sp that says which recordset you want. Note
that either way you will have to call a stored procedure per dataset. It is
a one to one relationship.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"luspo" <luspo@.discussions.microsoft.com> wrote in message
news:CC7325EC-29A7-43F7-B857-4F0F0CFF1E67@.microsoft.com...
> Hi,
> i've a single stored procedure that return many tables from different
select
> queries. it is possible to bind on a single report all "recordset" on
> different tables? in other words how i can "navigate" the source dataset,
is
> possible to refer to a kind of dataset index? ex. dsname[1], dsname[2]
etc?

Friday, February 24, 2012

Best way to take backUp

Which is the best way to take BackUp of the DB from MSSQL 2000 to a
secondary server with out loosing any single Insert/update?Hi
Do you want the secondary server read only ?
1)Log shipping
2) Repliaction
"imtiaz" <Imtiaz@.microsoft.com> wrote in message
news:uioGWaxfGHA.3860@.TK2MSFTNGP02.phx.gbl...
> Which is the best way to take BackUp of the DB from MSSQL 2000 to a
> secondary server with out loosing any single Insert/update?
>|||Yes I want secondary server to be readonly/ or to a backup device is also
will work.
Can you please explain the following in detail(steps)
1.log shipping
2.replication
Thanks in advance
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:OFfRO3xfGHA.1276@.TK2MSFTNGP03.phx.gbl...
> Hi
> Do you want the secondary server read only ?
> 1)Log shipping
> 2) Repliaction
> "imtiaz" <Imtiaz@.microsoft.com> wrote in message
> news:uioGWaxfGHA.3860@.TK2MSFTNGP02.phx.gbl...
>|||Check this out
http://www.sql-server-performance.c...og_shipping.asp
I guess it would give you an good idea about Log Shipping in SQL Server.
Best Regards
Vadivel
http://vadivel.blogspot.com
"imtiaz" wrote:

> Yes I want secondary server to be readonly/ or to a backup device is also
> will work.
> Can you please explain the following in detail(steps)
> 1.log shipping
> 2.replication
> Thanks in advance
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OFfRO3xfGHA.1276@.TK2MSFTNGP03.phx.gbl...
>
>|||http://www.sql-server-performance.c...og_shipping.asp
About replications it is very big topic , you are going to spend a lot of
time to learn it
http://www.mssqlcity.com/Articles/Replic/Replic.htm --Setting All
Replica (Step by step)
"imtiaz" <Imtiaz@.microsoft.com> wrote in message
news:OlYL4AyfGHA.1792@.TK2MSFTNGP03.phx.gbl...
> Yes I want secondary server to be readonly/ or to a backup device is also
> will work.
> Can you please explain the following in detail(steps)
> 1.log shipping
> 2.replication
> Thanks in advance
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:OFfRO3xfGHA.1276@.TK2MSFTNGP03.phx.gbl...
>

Sunday, February 19, 2012

Best way to send DB results to variable

Hello all

I have a database query which will return a single value

SELECT COUNT(DISTINCT(Level_id)) FROM RoleSkill WHERE Route_ID = 1

obviously this will return only a single value and not an array of data like most database queries, therefore i would like it to be sent directly to an integer variable.

I tried doing this directly with a sqlcommand but get error that it cannot be converted to integer. Is there a good way of solving this problem?

thanks for your help

TomExecuteScalar|||Aha right you are!

thanks very much i expected the process to be more complex, i had forgotten there are 3 options for a command object.

cheers ...Tom|||Output parameters

Best way to prevent multiple notifications for an event

I am setting up a notification system using the SQL Event Provider, and I have a question about preventing multiple notifications for a single event. The events are provided from a SQL select, and the notification emails are sent once a day. How does NS decide if it's already handled an event? If I change the email frequency, do I need to add a check in my SQL select, or does NS handle this?

Thanks
Erick

Chronicles tables can be used to prevent duplicate notifications. Check out ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/sqlntsv9/html/17e2debd-485f-4962-b974-6be6597983f9.htm for more information.

HTH...

Tuesday, February 14, 2012

Best way to get TOP 10 CPU intensive SQL

I run a shared hosting server where multiple people share a single SQL
server (each of them have their own data base). I need a way to monitor to
find out what % of the resources each user is taking as we don't want any
one person abusing the system. What is the best way to do this
Jay
Jay
Run SQL Server Profiler tool.
"Jay Janarthanan" <jay@.objectcube.com> wrote in message
news:e4AaSxinEHA.648@.tk2msftngp13.phx.gbl...
> I run a shared hosting server where multiple people share a single SQL
> server (each of them have their own data base). I need a way to monitor to
> find out what % of the resources each user is taking as we don't want any
> one person abusing the system. What is the best way to do this
> Jay
>
|||See if this helps:
Identifying SQL Server Perfromance Issues Using Profiler
http://vyaskn.tripod.com/analyzing_profiler_output.htm
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Jay Janarthanan" <jay@.objectcube.com> wrote in message
news:e4AaSxinEHA.648@.tk2msftngp13.phx.gbl...
> I run a shared hosting server where multiple people share a single SQL
> server (each of them have their own data base). I need a way to monitor to
> find out what % of the resources each user is taking as we don't want any
> one person abusing the system. What is the best way to do this
> Jay
>

Monday, February 13, 2012

Best way to get TOP 10 CPU intensive SQL

I run a shared hosting server where multiple people share a single SQL
server (each of them have their own data base). I need a way to monitor to
find out what % of the resources each user is taking as we don't want any
one person abusing the system. What is the best way to do this
JayJay
Run SQL Server Profiler tool.
"Jay Janarthanan" <jay@.objectcube.com> wrote in message
news:e4AaSxinEHA.648@.tk2msftngp13.phx.gbl...
> I run a shared hosting server where multiple people share a single SQL
> server (each of them have their own data base). I need a way to monitor to
> find out what % of the resources each user is taking as we don't want any
> one person abusing the system. What is the best way to do this
> Jay
>|||See if this helps:
Identifying SQL Server Perfromance Issues Using Profiler
http://vyaskn.tripod.com/analyzing_profiler_output.htm
--
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Jay Janarthanan" <jay@.objectcube.com> wrote in message
news:e4AaSxinEHA.648@.tk2msftngp13.phx.gbl...
> I run a shared hosting server where multiple people share a single SQL
> server (each of them have their own data base). I need a way to monitor to
> find out what % of the resources each user is taking as we don't want any
> one person abusing the system. What is the best way to do this
> Jay
>

Sunday, February 12, 2012

Best way to generate next sequence number of a table.

Hi,
Can you tell me the best way to get a next unique sequence
integer number which fits in a table. My application supports multi users
and at a single point of time users may add a new row to the table. But it
should fit to generate a unique next available integer value.
For eg: my table contains EMPID int, EMP_Name varchar(50)
EMPID is a primary key.
Can any one suggest me the best way to do it?
Thanks in advance.
VenkatHi,
create table Employees
(
EmpID int identity(1, 1) not null, --this will increment with each
insert by one.
Emp_Name varchar(50)
)
HTH
Peter
"Venkat" <stammana@.palantirsolutions.com> wrote in message
news:eb$gxjFSGHA.4300@.TK2MSFTNGP14.phx.gbl...
> Hi,
>
> Can you tell me the best way to get a next unique sequence
> integer number which fits in a table. My application supports multi users
> and at a single point of time users may add a new row to the table. But it
> should fit to generate a unique next available integer value.
>
> For eg: my table contains EMPID int, EMP_Name varchar(50)
> EMPID is a primary key.
>
> Can any one suggest me the best way to do it?
>
> Thanks in advance.
>
> --
> Venkat
>|||After doing an insert, you can get the most recently inserted id with:
SELECT SCOPE_IDENTITY()|||I would re-think this design. Where is the check digit so I can
validate it? Why is the employee identifer a varying length integer
issued internally where it cannot be verified?|||> Why is the employee identifer a varying length integer
> issued internally where it cannot be verified?
can you suggest a better alternative?

Best way to create next sequence number

Hi,
Can you tell me the best way to get a next unique sequence
integer number which fits in a table. My application supports multi users
and at a single point of time users may add a new row to the table. But it
should fit to generate a unique next available integer value.
For eg: my table contains EMPID int, EMP_Name varchar(50)
EMPID is a primary key.
The main constraint here is i am using Ado.net. So i need to
know the the integer (primary key) value before accpeting the changes to
database. I need to get the next sequence number as there are some child
objects for which i need to use this id. Once all the data is set the user
can select to save the changes which commits the data in the data table with
the db.
Can any one suggest me the best way to do it?
Thanks in advance.
VenkatHi
CREATE PROC Get_nextID
@.ID char(20),
@.nextID numeric(18) output
as
update NextIDs
set @.nextID = NextID = NextID + 1
where ID = @.ID
"Venkat" <stammana@.palantirsolutions.com> wrote in message
news:ucR8AgPSGHA.5908@.TK2MSFTNGP10.phx.gbl...
> Hi,
> Can you tell me the best way to get a next unique sequence
> integer number which fits in a table. My application supports multi users
> and at a single point of time users may add a new row to the table. But it
> should fit to generate a unique next available integer value.
>
> For eg: my table contains EMPID int, EMP_Name varchar(50)
> EMPID is a primary key.
> The main constraint here is i am using Ado.net. So i need to
> know the the integer (primary key) value before accpeting the changes to
> database. I need to get the next sequence number as there are some child
> objects for which i need to use this id. Once all the data is set the user
> can select to save the changes which commits the data in the data table
> with the db.
> Can any one suggest me the best way to do it?
>
> Thanks in advance.
>
> --
> Venkat
>
>|||You can use IDENTITY wich is the internal MS SQL Server mechanism and
had recently been normalize in the SQL:2003 ISO standard.
Or you can use your own concept working with a key table like this :
CREATE PROCEDURE P_SYS_DB_CALC_NEW_KEY
@.NOM_TABLE SYSNAME,
@.NEW_VAL INT OUTPUT
AS
-- ****************************************
***************
-- PROCDURE STOCKE DE CALCUL DE CLEF AUTO INCRMENT //
--///////////////////////////////////////////////////////
-- Frdric BROUARD - 2001-09-14 //
--///////////////////////////////////////////////////////
-- chane de requte
DECLARE @.STR_QRY VARCHAR(8000)
-- valeur devant tre retourne
DECLARE @.maxcle integer
SET @.NEW_VAL = NULL
SET NOCOUNT ON
-- ON DEMARRE LA TRANSACTION
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
BEGIN TRANSACTION SET_KEY
-- on regarde si la table des clefs existe
IF NOT EXISTS(SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'SYS_DB_MASTERKEY')
BEGIN
-- si elle n'existe pas il faut la crer
CREATE TABLE SYS_DB_MASTERKEY
(MSK_TABLE_NAME CHAR(128) NOT NULL,
MSK_LAST_VALUE INTEGER NOT NULL DEFAULT 0,
CONSTRAINT MSK_KEY PRIMARY KEY
(MSK_TABLE_NAME))
IF @.@.ERROR <> 0
GOTO LBL_ERROR
-- cration des index
CREATE INDEX MSK_PK ON SYS_DB_MASTERKEY
(MSK_TABLE_NAME)
END
-- on regarde si la table concerne existe
IF NOT EXISTS(SELECT *
FROM SYS_DB_MASTERKEY
WHERE MSK_TABLE_NAME = @.NOM_TABLE)
BEGIN
-- elle n'existe pas, on l'y insre
INSERT INTO SYS_DB_MASTERKEY VALUES (@.NOM_TABLE, 0)
IF @.@.ERROR <> 0
GOTO LBL_ERROR
END
-- calcule de la nouvelle clef
SELECT @.NEW_VAL = MSK_LAST_VALUE +1
FROM SYS_DB_MASTERKEY
WHERE MSK_TABLE_NAME = @.NOM_TABLE
IF @.@.ERROR <> 0
GOTO LBL_ERROR
-- mise jour de la nouvelle clef dans la table des clefs
UPDATE SYS_DB_MASTERKEY
SET MSK_LAST_VALUE = @.NEW_VAL
WHERE MSK_TABLE_NAME = @.NOM_TABLE
IF @.@.ERROR <> 0
GOTO LBL_ERROR
COMMIT TRANSACTION SET_KEY
GOTO LBL_RESUME
LBL_ERROR:
ROLLBACK TRANSACTION SET_KEY
LBL_RESUME:
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
SET NOCOUNT ON
GO
A +
Venkat a crit :
> Hi,
> Can you tell me the best way to get a next unique sequence
> integer number which fits in a table. My application supports multi users
> and at a single point of time users may add a new row to the table. But it
> should fit to generate a unique next available integer value.
>
> For eg: my table contains EMPID int, EMP_Name varchar(50)
> EMPID is a primary key.
> The main constraint here is i am using Ado.net. So i need to
> know the the integer (primary key) value before accpeting the changes to
> database. I need to get the next sequence number as there are some child
> objects for which i need to use this id. Once all the data is set the user
> can select to save the changes which commits the data in the data table wi
th
> the db.
> Can any one suggest me the best way to do it?
>
> Thanks in advance.
>
> --
> Venkat
>
>
Frdric BROUARD, MVP SQL Server, expert bases de donnes et langage SQL
Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com
Audit, conseil, expertise, formation, modlisation, tuning, optimisation
********************* http://www.datasapiens.com ***********************|||Uri Dimant a crit :
> Hi
> CREATE PROC Get_nextID
> @.ID char(20),
> @.nextID numeric(18) output
> as
> update NextIDs
> set @.nextID = NextID = NextID + 1
> where ID = @.ID
>
Never do this ! You will fatally have some deadlock / telescoping key
values over the time due to a lack in the isolation principles.
A +

>
> "Venkat" <stammana@.palantirsolutions.com> wrote in message
> news:ucR8AgPSGHA.5908@.TK2MSFTNGP10.phx.gbl...
>
Frdric BROUARD, MVP SQL Server, expert bases de donnes et langage SQL
Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com
Audit, conseil, expertise, formation, modlisation, tuning, optimisation
********************* http://www.datasapiens.com ***********************|||SQLpro
This is only one of many options, I have seen that by using a technique from
my previous post and and having an index on the column we don't get any
deadlocks. But I agree that the OP may use this below much better script
DECLARE @.maxid INT
BEGIN TRAN
SELECT @.maxid =COALESCE(MAX(Mycol),0) FROM Table WITH (UPDLOCK,HOLDLOCK)
WHERE.....
INSERTI INTO Table(mycol) VALUES (@.maxid +1)
COMMIT TRAN
"SQLpro [MVP]" <brouardf@.club-internet.fr> wrote in message
news:u4Ncq2PSGHA.1728@.TK2MSFTNGP11.phx.gbl...
> Uri Dimant a crit :
> Never do this ! You will fatally have some deadlock / telescoping key
> values over the time due to a lack in the isolation principles.
> A +
>
>
> --
> Frdric BROUARD, MVP SQL Server, expert bases de donnes et langage SQL
> Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com
> Audit, conseil, expertise, formation, modlisation, tuning, optimisation
> ********************* http://www.datasapiens.com ***********************|||Uri Dimant a crit :
> SQLpro
> This is only one of many options, I have seen that by using a technique fr
om
> my previous post and and having an index on the column we don't get any
> deadlocks. But I agree that the OP may use this below much better script
>
> DECLARE @.maxid INT
> BEGIN TRAN
> SELECT @.maxid =COALESCE(MAX(Mycol),0) FROM Table WITH (UPDLOCK,HOLDLOCK)
> WHERE.....
> INSERTI INTO Table(mycol) VALUES (@.maxid +1)
> COMMIT TRAN
effectyvly this lock or an isolation level as SERIALIZABLE can garanty that.
Wich in term of cost is pretty ugly since the table grow !!!
A +

> "SQLpro [MVP]" <brouardf@.club-internet.fr> wrote in message
> news:u4Ncq2PSGHA.1728@.TK2MSFTNGP11.phx.gbl...
>
Frdric BROUARD, MVP SQL Server, expert bases de donnes et langage SQL
Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com
Audit, conseil, expertise, formation, modlisation, tuning, optimisation
********************* http://www.datasapiens.com ***********************