Showing posts with label entering. Show all posts
Showing posts with label entering. Show all posts

Friday, February 24, 2012

Enterprise Manager causing extensive network traffic

Does anybody have any idea what is happening here. On 3 out of five workstations when entering Enterprise Manager the network traffic jumps drastically to the point that the server needs to be rebooted. Any information would be greatly appreciated.
Thanks
NewbieTry Using the SQL Profiler that comes with SQL Server

This underused programme will list every command that hits the SQL Server in Real time.

Just run the default trace & see whats happening when a client logs on

GW|||I used profiler this morning, using the default trace and I also set it to log everything. It didn't log anything out of the ordinary, and there was nothing that coincided with the amount of traffic being generated.

Originally posted by GWilliy
Try Using the SQL Profiler that comes with SQL Server

This underused programme will list every command that hits the SQL Server in Real time.

Just run the default trace & see whats happening when a client logs on

GW|||OK

My next step would be to download a trial version of Commview 3 - install it onto the client.

This App is an excellent packet sniffer and will show you exactly any traffic that is happening & to which IP Address it is going to

You could try and decipher the packets with this tool if you are brave - at very least it will show how much traffic is generated on which port to where.

GW

Sunday, February 19, 2012

Enterprise Manager ... inserting <NULL> value.

What is the keyboard shortcut for entering a <NULL> into a database field from within the Enterprise Manager? I've done it before, but can't remember it for the life of me! Also, is there a query that I can use to insert <NULL> in place of ''?Run...as fast as you can ...away from EM...

Just don't put anything in there....

EDIT: It's [CTRL]+0|||Originally posted by Brett Kaiser
It's [CTRL]+0 Thanks!|||Now do yourself a favor and stop using EM and start using QA|||I'm a SQL newbie ... forgive my ignorance. I find it easier to use EM since it's graphical and I can enter/edit information on screen vs. writing queries. Since this DB is in development, this doesn't pose any locking issues.|||Well, if you learn to do it right while you're developing, when you go to production you will have a set of tools for troubleshooting data that you will find yourself going to EM to do otherwise.

You really shouldn't use EM ever for any reason. We continually tell people that because basically the tool sucks. :)

Wednesday, February 15, 2012

Entering Unique data into a column

Is there a better to insure an INSERT will only add a new row only if the
data being added to a particular column is unique, besides doing a SELECT
before doing the INSERT?
SELECT X from table where X='NewData'
ExecuteReader and test for number of Rows
if Zero then do the INSERT
Thank you...
BruceINSERT INTO YourTable (x, ...)
SELECT 'NewData', ...
WHERE NOT EXISTS
(SELECT *
FROM YourTable
WHERE x = 'NewData')
David Portas
SQL Server MVP
--|||"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:ecidneFpqq8UaW7cRVn-pA@.giganews.com...
> INSERT INTO YourTable (x, ...)
> SELECT 'NewData', ...
> WHERE NOT EXISTS
> (SELECT *
> FROM YourTable
> WHERE x = 'NewData')
> --
> David Portas
> SQL Server MVP
> --
>
Thanks.....
Bruce|||"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:ecidneFpqq8UaW7cRVn-pA@.giganews.com...
> INSERT INTO YourTable (x, ...)
> SELECT 'NewData', ...
> WHERE NOT EXISTS
> (SELECT *
> FROM YourTable
> WHERE x = 'NewData')
> --
> David Portas
> SQL Server MVP
> --
>
Okay, What am I doing wrong? The following didn't work.. The INSERT happened
even though the value of 'Dentist' was in the table in the columne
AddressType.
INSERT INTO AddressType(AddressType) Values ('Dentist')
SELECT 'Dentist'
WHERE NOT EXISTS
(SELECT *
FROM AddressType
WHERE AddressType = 'Dentist')
Now, my table, AddressType, had only two columns, PrimaryKey (with
autoincrement) and AddressType.
Thanks...
Bruce|||You added the VALUES clause, which means it's no longer an INSERT... SELECT.
Try:
INSERT INTO AddressType (AddressType)
SELECT 'Dentist'
WHERE NOT EXISTS
(SELECT *
FROM AddressType
WHERE AddressType = 'Dentist')
BTW I assume AddressType is declared unique. Always declare unique columns,
don't just rely on the INSERT.
David Portas
SQL Server MVP
--|||
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:L8udnQJ32Z_Hm2ncRVn-rA@.giganews.com...
> You added the VALUES clause, which means it's no longer an INSERT...
SELECT.
> Try:
> INSERT INTO AddressType (AddressType)
> SELECT 'Dentist'
> WHERE NOT EXISTS
> (SELECT *
> FROM AddressType
> WHERE AddressType = 'Dentist')
> BTW I assume AddressType is declared unique. Always declare unique
columns,
> don't just rely on the INSERT.
> --
> David Portas
> SQL Server MVP
> --
>
This works. Thanks. And no, the column is not declared unique. I forgot
about that attribute, but will add it...
Thanks again...
Bruce

entering store procedure result to table

Hello there
is there a way to enter store procedure result to table?insert into tblname
exec stored_proc1
-Omnibuzz (The SQL GC)
http://omnibuzz-sql.blogspot.com/
"Roy Goldhammer" wrote:

> Hello there
> is there a way to enter store procedure result to table?
>
>|||Thankes A lot
"Omnibuzz" <Omnibuzz@.discussions.microsoft.com> wrote in message
news:DB2F9A89-FFC1-4B17-ABBD-3A45C8B24867@.microsoft.com...
> insert into tblname
> exec stored_proc1
> --
> -Omnibuzz (The SQL GC)
> http://omnibuzz-sql.blogspot.com/
>
> "Roy Goldhammer" wrote:
>|||Whell Omnibuzz.
Now i need to enter it to function in order to use it as generic function
My function looks like this:
create function fnDir(@.Path as varchar(8000))
returns @.ret table(FileName varchar(1000))
as
begin
DECLARE @.dir varchar(1000)
set @.dir = 'dir ' + @.Path + '/b'
insert @.ret
exec master..xp_cmdshell @.DIR
end
and it gives me error:
EXECUTE cannot be used as a source when inserting into a table variable.
how can i solve it?
"Omnibuzz" <Omnibuzz@.discussions.microsoft.com> wrote in message
news:DB2F9A89-FFC1-4B17-ABBD-3A45C8B24867@.microsoft.com...
> insert into tblname
> exec stored_proc1
> --
> -Omnibuzz (The SQL GC)
> http://omnibuzz-sql.blogspot.com/
>
> "Roy Goldhammer" wrote:
>|||Roy,shalom
The error message is pretty clear. You cannot use EXEC command within a UDF.
Instead , create a stored procedure
"Roy Goldhammer" <roy@.hotmail.com> wrote in message
news:ehGpAc5kGHA.3816@.TK2MSFTNGP02.phx.gbl...
> Whell Omnibuzz.
> Now i need to enter it to function in order to use it as generic function
> My function looks like this:
> create function fnDir(@.Path as varchar(8000))
> returns @.ret table(FileName varchar(1000))
> as
> begin
> DECLARE @.dir varchar(1000)
> set @.dir = 'dir ' + @.Path + '/b'
> insert @.ret
> exec master..xp_cmdshell @.DIR
> end
> and it gives me error:
> EXECUTE cannot be used as a source when inserting into a table variable.
> how can i solve it?
> "Omnibuzz" <Omnibuzz@.discussions.microsoft.com> wrote in message
> news:DB2F9A89-FFC1-4B17-ABBD-3A45C8B24867@.microsoft.com...
>|||Whell Uri.
I need it because other wants to use it as select *
from [process]
the only way i know to use it is by that
do you have any idea?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:ui9Sbh5kGHA.896@.TK2MSFTNGP04.phx.gbl...
> Roy,shalom
> The error message is pretty clear. You cannot use EXEC command within a
> UDF. Instead , create a stored procedure
>
>
>
> "Roy Goldhammer" <roy@.hotmail.com> wrote in message
> news:ehGpAc5kGHA.3816@.TK2MSFTNGP02.phx.gbl...
>|||> Whell Uri.
> I need it because other wants to use it as select *
> from [process]
> the only way i know to use it is by that
> do you have any idea?
Yes, teach them to use EXEC [process];|||Roy
I'm a little bit . What is prevent you from using this code inside
the SP, ahhh I see because someone wants to run SELECT *, so
you can run EXEC sp and that will returt the same data , does it matter to
him?
And as you probably know that using SELECT * in the production is considered
a bad practice
"Roy Goldhammer" <roy@.hotmail.com> wrote in message
news:%23yHLBo5kGHA.3588@.TK2MSFTNGP02.phx.gbl...
> Whell Uri.
> I need it because other wants to use it as select *
> from [process]
> the only way i know to use it is by that
> do you have any idea?
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:ui9Sbh5kGHA.896@.TK2MSFTNGP04.phx.gbl...
>|||In SQL 2005 you could use a CLR function in SQL 2000, however, you could use
sp_OA* system procedures to instantiate a file system object
("Scripting.FileSystemObject") then traverse the selected folder to get a
list of file names to return as the result of the function.
What's your version? Anyway, there are many good examples in Books Online
(and elsewhere on MSDN).
ML
http://milambda.blogspot.com/|||Whell Aaron
they need it for anoter sql in order to add it to join.
how can i do it with store procedue?
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:%2354Ptv5kGHA.4816@.TK2MSFTNGP05.phx.gbl...
>
> Yes, teach them to use EXEC [process];
>
>

Entering parameters resets other parameters

I am having a problem with reports where, after a parameter is changed, it
will remove the currently displayed report (replacing it with white) and on
some occassions reset some of the other parameters (even though there are no
dependencies). Is there some way to disable the refresh so that only
clicking "View Report" will change the report displayed?Has anyone else experienced this? We see the same thing and I would really
like to get rid of this behavior.
Thank you!
Jon
"Kyle" <Kyle@.discussions.microsoft.com> wrote in message
news:53AAA6CD-0B51-4879-A641-C580CD9819D6@.microsoft.com...
>I am having a problem with reports where, after a parameter is changed, it
> will remove the currently displayed report (replacing it with white) and
> on
> some occassions reset some of the other parameters (even though there are
> no
> dependencies). Is there some way to disable the refresh so that only
> clicking "View Report" will change the report displayed?

Entering null into blank fields in the database

How can I enter NULL manually in one of the rows in Sql Server database. Those rows does not contain any data.
you can use DbNull.Value. If its a datetime datatype you need to use SqlDateTime.Null and import Sqltypes namespace.
|||well the problem is bit different. I have 4 rows with 4 fields each. Like Name, Age, Address, Phone number.
Now Name, Age , Address is filled with some data. But I forgot to adddata for the phone and now its just blank. How can I make this nullinstead of blank.

|||UPDATE
<table>
SET
[phone]= NULL
WHERe
[phone] = ' '

Entering Notes/Comments/Remarks to Report

Hi, there,

We intended to create a report that allows users to enter remarks, comments or additional notes in supporting the report.

Can it be done in SSRS? FYI, we are using SQL Server 2005 Enterprise.

Thank you.

Regards,

Yong Hwee

You want to annotate within the report, or you want to add extended properties to the report? If it is the first, then there is no way without changing the RDL or annotating the exported format. If it is the second, then you can use SetProperties/GetProperties to write/retrieve extended properties (including your annotations) programmatically.|||

Hi, John,

Thank you for your reply. Sorry for my ignorance. In fact, we are still thinking the way to cater this requirement. Currently, the report is in Excel workbook. Annotations are entered directly to the workbook. Users are producing this report every mth. If possible, we would like users to enter the annotations to the report and saved. It seems like the second method using SetProperties/GetProperties is the better choice but what are the possible ways of implemeting it?

We are looking for a intuitive solution that allows monthly reports to be saved and retrieved later. The results in the saved reports should not change irregardless of the underlying source. I think this is just like the 'report snapshot' in SSRS.

Thank you.

Regards,

Yong Hwee

|||You can use history snapshots for archiving previously generated reports, but we don't support setting/getting properties on individual snapshots, only the report item itself.|||

Hi, John,

Thank you for the reply.

Regards,

Yong Hwee

Entering Notes/Comments/Remarks to Report

Hi, there,

We intended to create a report that allows users to enter remarks, comments or additional notes in supporting the report.

Can it be done in SSRS? FYI, we are using SQL Server 2005 Enterprise.

Thank you.

Regards,

Yong Hwee

You want to annotate within the report, or you want to add extended properties to the report? If it is the first, then there is no way without changing the RDL or annotating the exported format. If it is the second, then you can use SetProperties/GetProperties to write/retrieve extended properties (including your annotations) programmatically.|||

Hi, John,

Thank you for your reply. Sorry for my ignorance. In fact, we are still thinking the way to cater this requirement. Currently, the report is in Excel workbook. Annotations are entered directly to the workbook. Users are producing this report every mth. If possible, we would like users to enter the annotations to the report and saved. It seems like the second method using SetProperties/GetProperties is the better choice but what are the possible ways of implemeting it?

We are looking for a intuitive solution that allows monthly reports to be saved and retrieved later. The results in the saved reports should not change irregardless of the underlying source. I think this is just like the 'report snapshot' in SSRS.

Thank you.

Regards,

Yong Hwee

|||You can use history snapshots for archiving previously generated reports, but we don't support setting/getting properties on individual snapshots, only the report item itself.|||

Hi, John,

Thank you for the reply.

Regards,

Yong Hwee

Entering maintenance mode through Enterprise Manager?

Is there a way of entering maintenance mode ("-m") through Enterprise
Manager (2000), rather than running sqlservr.exe directly?
Thanks!
You can add it as a start up parameter (right-click your server, startup parameters), these are
stored in the registry. But as this is a one-time, it is easier to use Windows Services applet, and
add the parameter there.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Neil W." <neilw@.netlib.com> wrote in message news:e97bUWk2FHA.1292@.TK2MSFTNGP12.phx.gbl...
> Is there a way of entering maintenance mode ("-m") through Enterprise
> Manager (2000), rather than running sqlservr.exe directly?
> Thanks!
>

Entering maintenance mode through Enterprise Manager?

Is there a way of entering maintenance mode ("-m") through Enterprise
Manager (2000), rather than running sqlservr.exe directly?
Thanks!You can add it as a start up parameter (right-click your server, startup par
ameters), these are
stored in the registry. But as this is a one-time, it is easier to use Windo
ws Services applet, and
add the parameter there.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Neil W." <neilw@.netlib.com> wrote in message news:e97bUWk2FHA.1292@.TK2MSFTNGP12.phx.gbl...[
vbcol=seagreen]
> Is there a way of entering maintenance mode ("-m") through Enterprise
> Manager (2000), rather than running sqlservr.exe directly?
> Thanks!
>[/vbcol]

Entering maintenance mode through Enterprise Manager?

Is there a way of entering maintenance mode ("-m") through Enterprise
Manager (2000), rather than running sqlservr.exe directly?
Thanks!May be changing the startup parameters from windows "server properties", tab
"General", then stopping and restarting the service.
AMB
"Neil W." wrote:

> Is there a way of entering maintenance mode ("-m") through Enterprise
> Manager (2000), rather than running sqlservr.exe directly?
> Thanks!
>
>|||Replied in .server. Please don't multi-post.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Neil W." <neilw@.netlib.com> wrote in message news:u9SHVNk2FHA.1188@.TK2MSFTNGP12.phx.gbl...

> Is there a way of entering maintenance mode ("-m") through Enterprise
> Manager (2000), rather than running sqlservr.exe directly?
> Thanks!
>
>

Entering maintenance mode through Enterprise Manager?

Is there a way of entering maintenance mode ("-m") through Enterprise
Manager (2000), rather than running sqlservr.exe directly?
Thanks!You can add it as a start up parameter (right-click your server, startup parameters), these are
stored in the registry. But as this is a one-time, it is easier to use Windows Services applet, and
add the parameter there.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Neil W." <neilw@.netlib.com> wrote in message news:e97bUWk2FHA.1292@.TK2MSFTNGP12.phx.gbl...
> Is there a way of entering maintenance mode ("-m") through Enterprise
> Manager (2000), rather than running sqlservr.exe directly?
> Thanks!
>

Entering Empty Node Using An Updategram

Hi there,
I was wondering if anyone has found how to add an empty (not NULL) node
to an update. I found if you create a node you can get it to enter an
empty space by setting the default value to ('') on the database so
that when you query the data you have an empty node returned. The
problem I'm having is when I want to "blank" a node so I have something
like:
<before>
<node>Some text</node>
</before>
<after>
<node/>
</after>
which will result in a NULL value. Is there something I can put in the
after node that will result in it producing the same as ('') or
something to that effect?
Thanks,
GaryGary,
I'm assuming you are using the XML datatype and want to perform this DML via
the .modify() method.
In that case, you can use the replace value of DML statement. The new value
you want is "empty" or (). Here is an example:
declare @.x xml
set @.x = '<foo>bar</foo>'
set @.x.modify('replace value of /foo[1]/text()[1] with ()')
select @.x
You will most likely need to modify this DML if you are using a typed xml
column.
Regards,
Galex Yen
"Gary" wrote:

> Hi there,
> I was wondering if anyone has found how to add an empty (not NULL) node
> to an update. I found if you create a node you can get it to enter an
> empty space by setting the default value to ('') on the database so
> that when you query the data you have an empty node returned. The
> problem I'm having is when I want to "blank" a node so I have something
> like:
> <before>
> <node>Some text</node>
> </before>
> <after>
> <node/>
> </after>
> which will result in a NULL value. Is there something I can put in the
> after node that will result in it producing the same as ('') or
> something to that effect?
> Thanks,
> Gary
>|||you need to use xsi:nil. Here is the documentation and an example:
http://msdn2.microsoft.com/en-us/library/ms171764.aspx
<ROOT xmlns:sql="urn:schemas-microsoft-com:xml-sql"
xmlns:updg="urn:schemas-microsoft-com:xml-updategram"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<updg:sync mapping-schema='StudentSchema.xml'>
<updg:before/>
<updg:after>
<Student SID="S00004" lname="Elmaci" minitial="" years="2">
<fname xsi:nil="true">
</fname>
</Student>
</updg:after>
</updg:sync>
</ROOT>
"Gary" wrote:

> Hi there,
> I was wondering if anyone has found how to add an empty (not NULL) node
> to an update. I found if you create a node you can get it to enter an
> empty space by setting the default value to ('') on the database so
> that when you query the data you have an empty node returned. The
> problem I'm having is when I want to "blank" a node so I have something
> like:
> <before>
> <node>Some text</node>
> </before>
> <after>
> <node/>
> </after>
> which will result in a NULL value. Is there something I can put in the
> after node that will result in it producing the same as ('') or
> something to that effect?
> Thanks,
> Gary
>

Entering Empty Node Using An Updategram

Hi there,
I was wondering if anyone has found how to add an empty (not NULL) node
to an update. I found if you create a node you can get it to enter an
empty space by setting the default value to ('') on the database so
that when you query the data you have an empty node returned. The
problem I'm having is when I want to "blank" a node so I have something
like:
<before>
<node>Some text</node>
</before>
<after>
<node/>
</after>
which will result in a NULL value. Is there something I can put in the
after node that will result in it producing the same as ('') or
something to that effect?
Thanks,
Gary
Gary,
I'm assuming you are using the XML datatype and want to perform this DML via
the .modify() method.
In that case, you can use the replace value of DML statement. The new value
you want is "empty" or (). Here is an example:
declare @.x xml
set @.x = '<foo>bar</foo>'
set @.x.modify('replace value of /foo[1]/text()[1] with ()')
select @.x
You will most likely need to modify this DML if you are using a typed xml
column.
Regards,
Galex Yen
"Gary" wrote:

> Hi there,
> I was wondering if anyone has found how to add an empty (not NULL) node
> to an update. I found if you create a node you can get it to enter an
> empty space by setting the default value to ('') on the database so
> that when you query the data you have an empty node returned. The
> problem I'm having is when I want to "blank" a node so I have something
> like:
> <before>
> <node>Some text</node>
> </before>
> <after>
> <node/>
> </after>
> which will result in a NULL value. Is there something I can put in the
> after node that will result in it producing the same as ('') or
> something to that effect?
> Thanks,
> Gary
>
|||you need to use xsi:nil. Here is the documentation and an example:
http://msdn2.microsoft.com/en-us/library/ms171764.aspx
<ROOT xmlns:sql="urn:schemas-microsoft-com:xml-sql"
xmlns:updg="urn:schemas-microsoft-com:xml-updategram"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<updg:sync mapping-schema='StudentSchema.xml'>
<updg:before/>
<updg:after>
<Student SID="S00004" lname="Elmaci" minitial="" years="2">
<fname xsi:nil="true">
</fname>
</Student>
</updg:after>
</updg:sync>
</ROOT>
"Gary" wrote:

> Hi there,
> I was wondering if anyone has found how to add an empty (not NULL) node
> to an update. I found if you create a node you can get it to enter an
> empty space by setting the default value to ('') on the database so
> that when you query the data you have an empty node returned. The
> problem I'm having is when I want to "blank" a node so I have something
> like:
> <before>
> <node>Some text</node>
> </before>
> <after>
> <node/>
> </after>
> which will result in a NULL value. Is there something I can put in the
> after node that will result in it producing the same as ('') or
> something to that effect?
> Thanks,
> Gary
>

Entering data into tables

How does one enter data into the tables of a new database in the first place? I'm using SQL Server Management Studio Express. I can name the columns, but that seems to be as far as I get. Thanks for any Help.

I would recommend you use the T-SQL INSERT statement for adding data to the table.

Please take a look at the following tutorial titled "Inserting and Updating Data In a Table"

http://msdn2.microsoft.com/en-us/library/ms365309.aspx.

Kind Regards,
Jaaved

|||

Thanks a lot, as you can tell, I'm brand new to this SQL. Just trying to learn the ropes.

Thanks again.

entering data into sql database

hi

I am working on webforms i have to insert system date into sql database when a button is clicked.

I have have 3 fields on the webform and a submit button.

I have to insert the date along with the other fileds into the sql database

when I am trying to insert date using getdate() it is getting inserted but not into the same row as that of other fields.

Can you plzzz help me with the code for inserting system data into the database into the same row as that of other fields

myCommand2 =New SqlCommand("Insert into Items(Requestdate) values (getdate()) where Hospital= '" & DropDownList2.SelectedItem.Text & "' ", myConnection)

ra = myCommand2.ExecuteNonQuery()

myConnection.Close()

THE ABOVE CODE GIVES AN SYNTAX ERROR NEAR "WHERE"

please help

you can also post me ur replies onurs_forever_tanya2001@.yahoo.co.in

Thanks bye

You can't specify awhere clause on an insert statement as the whole point of an insert is to add a record (i.e. it doesn't already exist). If you want to update and existing record, you will have to use anupdatestatement.

|||

by using update statement will i be able to insert new record then?

because i have to take system date while inserting a new record...

please help

|||

tanya2001:

by using update statement will i be able to insert new record then?

No. If you want to insert a record you have to use an insert statement (but remove your where clause). If you want to update an existing record, use an update statement.

|||

Hey tanya ,

Thanks for your question .

let me descrive some essesntioal stuff for you first.

Insert Statement , we use this statement when we wantadd new record to our table , it means that record doesn't exist and we are going to add that , so in this case we wont usingwhere on this state ment becuase there is no any rows and we want to add that.

Update Statement , we use this statement when we already we have one or more records in our table and we want just change some of their value we use update statement and we use where to specify which rows we are going to change.

In you solution , if you are going to Insert New value to table that doesn't not exist at all use Insert Statement, if you are going to change some value in your database use update.Yes

|||

thanks for your answer but i want to insert system date as well with the new record in the database

so how can i insert the system date as well as the new record by entering a single submit button

its actually like i have 3 fields in a webform so i have to insert those three fields as well as system date should be inserted when submit is clicked

please help

|||

thanks all i got the answer

Entering all the data in one big table

I am entering text heavy data in one big table, which has many columns. One
problem I'm having is the text does not fit in some rows (because the
characters are so many) and I have to truncate if the text is longer than
the length defined for the column.
Now I am hoping to change the design so that I don't need to truncate any
data. I know that creating a properly normalized database would solve the
problem, but this is very difficult for the situation I have. The change
should be as small as possible. What would be the best way to solve this
problem?You might want to use the TEXT datatype for some of the larger columns. You
can fit 2GB in each.
Andrew J. Kelly SQL MVP
"TomTom" <no_spam_please@.TomTom.com> wrote in message
news:uc2imULAEHA.3004@.TK2MSFTNGP10.phx.gbl...
> I am entering text heavy data in one big table, which has many columns.
One
> problem I'm having is the text does not fit in some rows (because the
> characters are so many) and I have to truncate if the text is longer than
> the length defined for the column.
> Now I am hoping to change the design so that I don't need to truncate any
> data. I know that creating a properly normalized database would solve the
> problem, but this is very difficult for the situation I have. The change
> should be as small as possible. What would be the best way to solve this
> problem?
>
>|||I'm working on international text. If I do it, then I cannot host Japanese
and Korean on the same machine. Is this correct?
"Andrew J. Kelly" <sqlmvpnoooospam@.shadhawk.com> wrote in message
news:uYvGhpMAEHA.3936@.TK2MSFTNGP11.phx.gbl...
> You might want to use the TEXT datatype for some of the larger columns.
You
> can fit 2GB in each.
> --
> Andrew J. Kelly SQL MVP
>
> "TomTom" <no_spam_please@.TomTom.com> wrote in message
> news:uc2imULAEHA.3004@.TK2MSFTNGP10.phx.gbl...
> One
than
any
the
>|||You can use nText datatype to store unicode data.
Andrew J. Kelly SQL MVP
"TomTom" <no_spam_please@.TomTom.com> wrote in message
news:OoeSKSYAEHA.132@.TK2MSFTNGP10.phx.gbl...
> I'm working on international text. If I do it, then I cannot host Japanese
> and Korean on the same machine. Is this correct?
>
> "Andrew J. Kelly" <sqlmvpnoooospam@.shadhawk.com> wrote in message
> news:uYvGhpMAEHA.3936@.TK2MSFTNGP11.phx.gbl...
> You
columns.
> than
> any
> the
change
this
>

Entering all the data in one big table

I am entering text heavy data in one big table, which has many columns. One
problem I'm having is the text does not fit in some rows (because the
characters are so many) and I have to truncate if the text is longer than
the length defined for the column.
Now I am hoping to change the design so that I don't need to truncate any
data. I know that creating a properly normalized database would solve the
problem, but this is very difficult for the situation I have. The change
should be as small as possible. What would be the best way to solve this
problem?You might want to use the TEXT datatype for some of the larger columns. You
can fit 2GB in each.
--
Andrew J. Kelly SQL MVP
"TomTom" <no_spam_please@.TomTom.com> wrote in message
news:uc2imULAEHA.3004@.TK2MSFTNGP10.phx.gbl...
> I am entering text heavy data in one big table, which has many columns.
One
> problem I'm having is the text does not fit in some rows (because the
> characters are so many) and I have to truncate if the text is longer than
> the length defined for the column.
> Now I am hoping to change the design so that I don't need to truncate any
> data. I know that creating a properly normalized database would solve the
> problem, but this is very difficult for the situation I have. The change
> should be as small as possible. What would be the best way to solve this
> problem?
>
>|||I'm working on international text. If I do it, then I cannot host Japanese
and Korean on the same machine. Is this correct?
"Andrew J. Kelly" <sqlmvpnoooospam@.shadhawk.com> wrote in message
news:uYvGhpMAEHA.3936@.TK2MSFTNGP11.phx.gbl...
> You might want to use the TEXT datatype for some of the larger columns.
You
> can fit 2GB in each.
> --
> Andrew J. Kelly SQL MVP
>
> "TomTom" <no_spam_please@.TomTom.com> wrote in message
> news:uc2imULAEHA.3004@.TK2MSFTNGP10.phx.gbl...
> > I am entering text heavy data in one big table, which has many columns.
> One
> > problem I'm having is the text does not fit in some rows (because the
> > characters are so many) and I have to truncate if the text is longer
than
> > the length defined for the column.
> >
> > Now I am hoping to change the design so that I don't need to truncate
any
> > data. I know that creating a properly normalized database would solve
the
> > problem, but this is very difficult for the situation I have. The change
> > should be as small as possible. What would be the best way to solve this
> > problem?
> >
> >
> >
>|||You can use nText datatype to store unicode data.
--
Andrew J. Kelly SQL MVP
"TomTom" <no_spam_please@.TomTom.com> wrote in message
news:OoeSKSYAEHA.132@.TK2MSFTNGP10.phx.gbl...
> I'm working on international text. If I do it, then I cannot host Japanese
> and Korean on the same machine. Is this correct?
>
> "Andrew J. Kelly" <sqlmvpnoooospam@.shadhawk.com> wrote in message
> news:uYvGhpMAEHA.3936@.TK2MSFTNGP11.phx.gbl...
> > You might want to use the TEXT datatype for some of the larger columns.
> You
> > can fit 2GB in each.
> >
> > --
> > Andrew J. Kelly SQL MVP
> >
> >
> > "TomTom" <no_spam_please@.TomTom.com> wrote in message
> > news:uc2imULAEHA.3004@.TK2MSFTNGP10.phx.gbl...
> > > I am entering text heavy data in one big table, which has many
columns.
> > One
> > > problem I'm having is the text does not fit in some rows (because the
> > > characters are so many) and I have to truncate if the text is longer
> than
> > > the length defined for the column.
> > >
> > > Now I am hoping to change the design so that I don't need to truncate
> any
> > > data. I know that creating a properly normalized database would solve
> the
> > > problem, but this is very difficult for the situation I have. The
change
> > > should be as small as possible. What would be the best way to solve
this
> > > problem?
> > >
> > >
> > >
> >
> >
>

Entering a row from a table to a column of other table

Is it possible to enter a complete record into a column say varchar(max) and then be able to retreive the record from the column. I am using sql 2005.

Thanks very much in advance,

you can use a separator for columns and insert it into a table.

insert into tablename (varcharnmaxcolumn)

select col1 +'|' + col2+'|' +col3

from table1

and during retrieval you can split the output as per separator as '|' in this case

Entering a Guid in Enterprise Manager

A very simple question...
When I edit the data in a table how can I enter a Guid value in Enterprise
Manager?
I've tried:
{AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE}
AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
'AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE'
nothing works!
Hi
{E5215E35-1D3B-40B1-9F8E-A0B7BEF39F03} works perfectly for me
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"sm" <sm@.smith.com.invalid> wrote in message
news:%23PkcSZpSFHA.2124@.TK2MSFTNGP14.phx.gbl...
>A very simple question...
> When I edit the data in a table how can I enter a Guid value in Enterprise
> Manager?
> I've tried:
> {AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE}
> AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
> 'AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE'
> nothing works!
>
|||Thanks.
Actually generating a Guid in registry format with guidgen.exe (Visual
Studio Tools menu) and then pasting it in the column doesn't seem to work.
It's probably because of a carriage return.
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:ecp1cBqSFHA.2872@.TK2MSFTNGP14.phx.gbl...
> Hi
> {E5215E35-1D3B-40B1-9F8E-A0B7BEF39F03} works perfectly for me
> --
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "sm" <sm@.smith.com.invalid> wrote in message
> news:%23PkcSZpSFHA.2124@.TK2MSFTNGP14.phx.gbl...
>