显示标签为“hii”的博文。显示所有博文
显示标签为“hii”的博文。显示所有博文

2012年3月22日星期四

any1 please really stuck! sql statement insert

Hi

I have the following insert statement

However it wont insert into the database

can any1 help or suggest tried everything

thanx

SqlCommand cmd2 = new SqlCommand("INSERT INTO room_type_temp (Room_code, Room_description, Room_notes, area, height, spanotes, pladescription, perdescription, floor, walls, ceiling, doorsets, glazing, windows, chanotes, hatch, air, lighting, noise, safety, awt, ast, amvs, amve, amvsu, ap, af, ah, lsi, lsn, lli, lcr, lslg, nasl, nsp, nt, sahs, AF2, sdhw, atn, amn, apn, lsin, lsnn, llin, lslgg, lcrn, nn, sn, fn, npf, nms, nin, fe, fad, Room_Sheet) SELECT Room_code, Room_description, Room_notes, area, height, spanotes, pladescription, perdescription, floor, walls, ceiling, doorsets, glazing, windows, chanotes, hatch, air, lighting, noise, safety, awt, ast, amvs, amve, amvsu, ap, af, ah, lsi, lsn, lli, lcr, lslg, nasl, nsp, nt, sahs, AF2, sdhw, atn, amn, apn, lsin, lsnn, llin, lslgg, lcrn, nn, sn, fn, npf, nms, nin, fe, fad, Room_Sheet FROM room_types where room_code = " + (Session["room_code"].ToString()), con);

Did you get error message? It seems that you missed single quote around session.

FROM room_types where room_code = " + (Session["room_code"].ToString()), con);

Should be

FROM room_types where room_code = '" + (Session["room_code"].ToString()) + "'", con);

|||

Hi

found it as well

used '" + room_code + "'

cheers!!!

:-)

2012年2月18日星期六

Any help on sp_trace_getdata

Hi
I have created a trace and then I tried reading trace through
sp_trace_getdata by specifying the correct trace id.
But query analyser become busy in continously executing sp_trace_getdata and
does return any result for long time.
Can any one suggest how should I call sp_trace_getdata to get the result
asynchronously, of the trace as when it is generated.
Thanks
Pushkar
Are you trying to consume the trace rowset? If you are using SQL Query
Analyzer, make sure you are not sending it to the grid, but to the text
window.
GertD@.SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright SQLDev.Net 1991-2005 All rights reserved.
"Pushkar" <tiwaripushkar@.yahoo.co.in> wrote in message
news:%23pJuSu3ZFHA.3808@.TK2MSFTNGP14.phx.gbl...
> Hi
> I have created a trace and then I tried reading trace through
> sp_trace_getdata by specifying the correct trace id.
> But query analyser become busy in continously executing sp_trace_getdata
> and
> does return any result for long time.
> Can any one suggest how should I call sp_trace_getdata to get the result
> asynchronously, of the trace as when it is generated.
> Thanks
> Pushkar
>
|||Thanks a lot Gert.
When sending the output to the text it worked. But why it was not working
while sending the output to a grid?
How can I write a application or extended stored procedure that can consume
the trace rowset and update some table?
Please help me out.
Thanks a lot.
Pushkar
"Gert E.R. Drapers" <GertD@.SQLDevNet> wrote in message
news:uiN6eVBaFHA.464@.TK2MSFTNGP15.phx.gbl...
> Are you trying to consume the trace rowset? If you are using SQL Query
> Analyzer, make sure you are not sending it to the grid, but to the text
> window.
> GertD@.SQLDev.Net
> Please reply only to the newsgroups.
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use.
> Copyright SQLDev.Net 1991-2005 All rights reserved.
> "Pushkar" <tiwaripushkar@.yahoo.co.in> wrote in message
> news:%23pJuSu3ZFHA.3808@.TK2MSFTNGP14.phx.gbl...
>
|||Because the grid will consume rows until it gets end of rowset, which in
case of SQL Trace will only happen when you stop the trace.
This is a behavior of the grid in Query Analyzer, OSQL and when using the
text window will pull rows directly and display them, like profiler does,
you can do exactly the same thing.
GertD@.SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright SQLDev.Net 1991-2005 All rights reserved.
"Pushkar" <tiwaripushkar@.yahoo.co.in> wrote in message
news:u1oS9BCaFHA.3864@.TK2MSFTNGP10.phx.gbl...
> Thanks a lot Gert.
> When sending the output to the text it worked. But why it was not working
> while sending the output to a grid?
> How can I write a application or extended stored procedure that can
> consume
> the trace rowset and update some table?
> Please help me out.
> Thanks a lot.
> Pushkar
>
>
>
> "Gert E.R. Drapers" <GertD@.SQLDevNet> wrote in message
> news:uiN6eVBaFHA.464@.TK2MSFTNGP15.phx.gbl...
> rights.
>
|||Thanks
Pushkar
"Gert E.R. Drapers" <GertD@.SQLDevNet> wrote in message
news:eSPrx6HaFHA.3132@.TK2MSFTNGP09.phx.gbl...
> Because the grid will consume rows until it gets end of rowset, which in
> case of SQL Trace will only happen when you stop the trace.
> This is a behavior of the grid in Query Analyzer, OSQL and when using the
> text window will pull rows directly and display them, like profiler does,
> you can do exactly the same thing.
> --
> GertD@.SQLDev.Net
> Please reply only to the newsgroups.
> This posting is provided "AS IS" with no warranties, and confers no
rights.[vbcol=seagreen]
> You assume all risk for your use.
> Copyright SQLDev.Net 1991-2005 All rights reserved.
> "Pushkar" <tiwaripushkar@.yahoo.co.in> wrote in message
> news:u1oS9BCaFHA.3864@.TK2MSFTNGP10.phx.gbl...
working
>

Any help on application that works like a profiler

Hi
I like to write an application that works kind of like Profiler.
I want to get some sort of event notification that something has happened on
the database server to let me know I should check for data and then log into
some table.
I tried through system stored procedure, but they don't let me directly
trace into the table, for that I have trace into file then from there to a
table.
I want to write something like profiler type application, that should be
continously listening to server events.
Are there any COM objects available for that or some other where through
which I can do this.
Thanks in Advance
PushkarIn SQL Server profiler, you can filter events based on application name or
user, and output the event trace to a table or text file. Once this is in
place, your application can simply query for specific event conditions. Just
in case, if your intention is to implement a complex data constraint, then
use a trigger. Also, if you are wanting to block specific types of user
access to tables or stored procedures, then implement this using appropriate
logins and object level permissions.
"Pushkar" <tiwaripushkar@.yahoo.co.in> wrote in message
news:eFI1SsgZFHA.2520@.TK2MSFTNGP09.phx.gbl...
> Hi
> I like to write an application that works kind of like Profiler.
> I want to get some sort of event notification that something has happened
on
> the database server to let me know I should check for data and then log
into
> some table.
> I tried through system stored procedure, but they don't let me directly
> trace into the table, for that I have trace into file then from there to a
> table.
> I want to write something like profiler type application, that should be
> continously listening to server events.
> Are there any COM objects available for that or some other where through
> which I can do this.
> Thanks in Advance
> Pushkar
>

2012年2月11日星期六

anti-virus on sql server box?

hi!

i am using sql 2005 with sp1 standard edition.

i have a question regarding the antivirus software. Is it ok to install anti-virus software on the sql server box? what are the issues involved if we install anti-virus software on the sql server box?
I heard, it causes some performance and other issues.

Is there anything we need to take care of .if we decide to install anti-virus software on the sql server box?

Can anybody share experience on this?

Thanks

Personally, I am very much against installing anti-virus software on a SQL Server box, for performance reasons. You see conflicting advice from Microsoft about this. The Perf people say no, and the security people say yes. If you decide to run AV on your SQL Server, make sure to exclude the data and log files from the scanning.|||

Generally speaking, it is not a good idea to have anti-virus products on a SQL Server.

Consider that anti-virus products protect the computer from user activities in the Workstation service.

On a SQL Server, there 'should' not be any user activities in the Workstation service.

|||I disagree with the other posts here.

ALWAYS run anti-virus on ALL machines on the network, servers and pcs, with current virus defs.

On SQL server, exclude the data and log directories from the scanning and virus protection.

Many viruses will infect all machines on the entire network, and if you don't have AV on ALL machines, when you remove it from all your PCs, it will hide on your SQL server box until it infects the entire network again and again and again. I know because this has happened to me, with more than one customer who has the same "performance" concerns.
|||Yes, I agree with Tlom. There are several approaches, defined by the policy of the companies which way you can take if you secure SQL Server. You can either exclude the data file and directories or exclude the appropuiate MDF / LDF extensions (which assumes that you are using these extensions with your files) I prefer the extensions exclusion which will makes it even not possible to inject a virus in the data directories of SQL Server.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||Thank you everyone for your replies. I really appreciate it.

So if you exclude the data and log files, are there any performance issues and other issues like communication/blocking etc ?

Thanks
|||

I hope this will help you:

Guidelines for choosing antivirus software to run on the computers that are running SQL Server

http://support.microsoft.com/kb/309422/en-us