Thursday, March 29, 2012
drastic change in speed
it. It started executing very fast.
Can Anyone have idea why this happens and what exactly happen when we drop
and recreate sp.When you drop SP it will cause to recompilation ( generating a new execution
plan). The same thing you might achive by creating a stored procedure WITH
RECOMPILE option
For more details see BOL
"Vikram" <aa@.aa> wrote in message
news:%23QQDPBcQGHA.1676@.TK2MSFTNGP14.phx.gbl...
>I was executing sp, which was taking time. I then dropped it and recreated
> it. It started executing very fast.
> Can Anyone have idea why this happens and what exactly happen when we drop
> and recreate sp.
>|||Also, before recompiling all the stored procedures, look into running DBCC
UPDATEUSAGE for critical tables. This will incure that the new execution
plans are compiled using the latest usage statistics.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:euJAtBdQGHA.2012@.TK2MSFTNGP14.phx.gbl...
> When you drop SP it will cause to recompilation ( generating a new
> execution plan). The same thing you might achive by creating a stored
> procedure WITH RECOMPILE option
> For more details see BOL
>
>
> "Vikram" <aa@.aa> wrote in message
> news:%23QQDPBcQGHA.1676@.TK2MSFTNGP14.phx.gbl...
>
drastic change in response time
simple query in ARC brings all app's residing on this
machine to a crawl. Machine resourses are abundant and
available. I know these are VERY sparse details... I'll
provide whatever info I can if someone can let us know
something. ThanxThis is a multi-part message in MIME format.
--=_NextPart_000_04C0_01C3CE1E.3D63B070
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Some suggestions:
1. Run DBCC OPENTRAN for your database. See what SPID has the longest
running txn. Run DBCC INPUTBUFFER on the SPID.
2. Run sp_lock and see who is putting up the most locks.
3. Based on the above, consider killing the offending SPID.
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:07aa01c3ce47$4cc7aca0$a001280a@.phx.gbl...
All processes have slowed to a crawl - 1 user running a
simple query in ARC brings all app's residing on this
machine to a crawl. Machine resourses are abundant and
available. I know these are VERY sparse details... I'll
provide whatever info I can if someone can let us know
something. Thanx
--=_NextPart_000_04C0_01C3CE1E.3D63B070
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Some suggestions:
1. Run DBCC OPENTRAN =for your database. See what SPID has the longest running txn. Run =DBCC INPUTBUFFER on the SPID.
2. Run sp_lock and =see who is putting up the most locks.
3. Based on =the above, consider killing the offending SPID.
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"David" wrote in message news:07aa01c3ce47$4c=c7aca0$a001280a@.phx.gbl...All processes have slowed to a crawl - 1 user running a simple query in =ARC brings all app's residing on this machine to a crawl. Machine resourses are abundant and available. I know these are VERY =sparse details... I'll provide whatever info I can if someone can let us =know something. Thanx
--=_NextPart_000_04C0_01C3CE1E.3D63B070--|||What are your server specs? Can you run other operations on the server
quickly(ie. is it SQL or the whole box)?
Other things to list --
mem usage
Free pages
IO
CPU usage
Cost of the query in question
We have had random slow and stoppage of performance on SQL2K.
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:07aa01c3ce47$4cc7aca0$a001280a@.phx.gbl...
> All processes have slowed to a crawl - 1 user running a
> simple query in ARC brings all app's residing on this
> machine to a crawl. Machine resourses are abundant and
> available. I know these are VERY sparse details... I'll
> provide whatever info I can if someone can let us know
> something. Thanx|||1gb RAM
4gb harddrive available (about 40%)
2 - 933 processors
ALL application are affected. Task Mgr show both 933
processors at 100 capacity. All seem fine until we run a
simple SQL query on an ARC database. THAT qry soaks up
100% RAM.
>--Original Message--
>What are your server specs? Can you run other operations
on the server
>quickly(ie. is it SQL or the whole box)?
>Other things to list --
>mem usage
>Free pages
>IO
>CPU usage
>Cost of the query in question
>We have had random slow and stoppage of performance on
SQL2K.
>"David" <anonymous@.discussions.microsoft.com> wrote in
message
>news:07aa01c3ce47$4cc7aca0$a001280a@.phx.gbl...
>> All processes have slowed to a crawl - 1 user running a
>> simple query in ARC brings all app's residing on this
>> machine to a crawl. Machine resourses are abundant and
>> available. I know these are VERY sparse details... I'll
>> provide whatever info I can if someone can let us know
>> something. Thanx
>
>.
>|||What is the cost of the query? Can you run --
SET SHOWPLAN_ALL ON
GO
<QUERY IN QUESTION>
and post the output.
Also there is a SQL bug on SQL2K that will create mem leaks when jumping
between DBs in a query, is that happening? What version of SQL and SP are
you on?
"DAvid" <anonymous@.discussions.microsoft.com> wrote in message
news:02f501c3ce4c$25d52d70$a301280a@.phx.gbl...
> 1gb RAM
> 4gb harddrive available (about 40%)
> 2 - 933 processors
> ALL application are affected. Task Mgr show both 933
> processors at 100 capacity. All seem fine until we run a
> simple SQL query on an ARC database. THAT qry soaks up
> 100% RAM.
>
> >--Original Message--
> >What are your server specs? Can you run other operations
> on the server
> >quickly(ie. is it SQL or the whole box)?
> >
> >Other things to list --
> >mem usage
> >Free pages
> >IO
> >CPU usage
> >Cost of the query in question
> >
> >We have had random slow and stoppage of performance on
> SQL2K.
> >
> >"David" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:07aa01c3ce47$4cc7aca0$a001280a@.phx.gbl...
> >> All processes have slowed to a crawl - 1 user running a
> >> simple query in ARC brings all app's residing on this
> >> machine to a crawl. Machine resourses are abundant and
> >> available. I know these are VERY sparse details... I'll
> >> provide whatever info I can if someone can let us know
> >> something. Thanx
> >
> >
> >.
> >|||Please elaborate on this "bug"., KB articles, PSS cases, thanks.
--
Kevin Connell, MCDBA
----
The views expressed here are my own
and not of my employer.
----
"Kevin Brooks" <jeepnreb@.yahoo.com> wrote in message
news:uL9#ZMlzDHA.2456@.TK2MSFTNGP10.phx.gbl...
> What is the cost of the query? Can you run --
> SET SHOWPLAN_ALL ON
> GO
> <QUERY IN QUESTION>
> and post the output.
> Also there is a SQL bug on SQL2K that will create mem leaks when jumping
> between DBs in a query, is that happening? What version of SQL and SP are
> you on?
>
> "DAvid" <anonymous@.discussions.microsoft.com> wrote in message
> news:02f501c3ce4c$25d52d70$a301280a@.phx.gbl...
> > 1gb RAM
> > 4gb harddrive available (about 40%)
> > 2 - 933 processors
> >
> > ALL application are affected. Task Mgr show both 933
> > processors at 100 capacity. All seem fine until we run a
> > simple SQL query on an ARC database. THAT qry soaks up
> > 100% RAM.
> >
> >
> > >--Original Message--
> > >What are your server specs? Can you run other operations
> > on the server
> > >quickly(ie. is it SQL or the whole box)?
> > >
> > >Other things to list --
> > >mem usage
> > >Free pages
> > >IO
> > >CPU usage
> > >Cost of the query in question
> > >
> > >We have had random slow and stoppage of performance on
> > SQL2K.
> > >
> > >"David" <anonymous@.discussions.microsoft.com> wrote in
> > message
> > >news:07aa01c3ce47$4cc7aca0$a001280a@.phx.gbl...
> > >> All processes have slowed to a crawl - 1 user running a
> > >> simple query in ARC brings all app's residing on this
> > >> machine to a crawl. Machine resourses are abundant and
> > >> available. I know these are VERY sparse details... I'll
> > >> provide whatever info I can if someone can let us know
> > >> something. Thanx
> > >
> > >
> > >.
> > >
>|||Will have to respond tomorrow - office is closed for the
day
>--Original Message--
>What is the cost of the query? Can you run --
>SET SHOWPLAN_ALL ON
>GO
><QUERY IN QUESTION>
>and post the output.
>Also there is a SQL bug on SQL2K that will create mem
leaks when jumping
>between DBs in a query, is that happening? What version
of SQL and SP are
>you on?
>
>"DAvid" <anonymous@.discussions.microsoft.com> wrote in
message
>news:02f501c3ce4c$25d52d70$a301280a@.phx.gbl...
>> 1gb RAM
>> 4gb harddrive available (about 40%)
>> 2 - 933 processors
>> ALL application are affected. Task Mgr show both 933
>> processors at 100 capacity. All seem fine until we run
a
>> simple SQL query on an ARC database. THAT qry soaks up
>> 100% RAM.
>>
>> >--Original Message--
>> >What are your server specs? Can you run other
operations
>> on the server
>> >quickly(ie. is it SQL or the whole box)?
>> >
>> >Other things to list --
>> >mem usage
>> >Free pages
>> >IO
>> >CPU usage
>> >Cost of the query in question
>> >
>> >We have had random slow and stoppage of performance on
>> SQL2K.
>> >
>> >"David" <anonymous@.discussions.microsoft.com> wrote in
>> message
>> >news:07aa01c3ce47$4cc7aca0$a001280a@.phx.gbl...
>> >> All processes have slowed to a crawl - 1 user
running a
>> >> simple query in ARC brings all app's residing on this
>> >> machine to a crawl. Machine resourses are abundant
and
>> >> available. I know these are VERY sparse details...
I'll
>> >> provide whatever info I can if someone can let us
know
>> >> something. Thanx
>> >
>> >
>> >.
>> >
>
>.
>|||It was a bug that hit us a few years back. We did not open a PSS case, but
you can search KB for it(if they acknowledge it). The client apps where
made in PB and a SQL2K(Compaq) server gold release. We no longer see this
problem and are on SP3a/SP2. It was a sporatic and not a serious outage at
the time, it sounded familar to is problem though.
"Kevin" <ReplyTo@.Newsgroups.only> wrote in message
news:uKFCBJmzDHA.1760@.TK2MSFTNGP10.phx.gbl...
> Please elaborate on this "bug"., KB articles, PSS cases, thanks.
> --
> Kevin Connell, MCDBA
> ----
> The views expressed here are my own
> and not of my employer.
> ----
> "Kevin Brooks" <jeepnreb@.yahoo.com> wrote in message
> news:uL9#ZMlzDHA.2456@.TK2MSFTNGP10.phx.gbl...
> > What is the cost of the query? Can you run --
> >
> > SET SHOWPLAN_ALL ON
> > GO
> > <QUERY IN QUESTION>
> >
> > and post the output.
> >
> > Also there is a SQL bug on SQL2K that will create mem leaks when jumping
> > between DBs in a query, is that happening? What version of SQL and SP
are
> > you on?
> >
> >
> > "DAvid" <anonymous@.discussions.microsoft.com> wrote in message
> > news:02f501c3ce4c$25d52d70$a301280a@.phx.gbl...
> > > 1gb RAM
> > > 4gb harddrive available (about 40%)
> > > 2 - 933 processors
> > >
> > > ALL application are affected. Task Mgr show both 933
> > > processors at 100 capacity. All seem fine until we run a
> > > simple SQL query on an ARC database. THAT qry soaks up
> > > 100% RAM.
> > >
> > >
> > > >--Original Message--
> > > >What are your server specs? Can you run other operations
> > > on the server
> > > >quickly(ie. is it SQL or the whole box)?
> > > >
> > > >Other things to list --
> > > >mem usage
> > > >Free pages
> > > >IO
> > > >CPU usage
> > > >Cost of the query in question
> > > >
> > > >We have had random slow and stoppage of performance on
> > > SQL2K.
> > > >
> > > >"David" <anonymous@.discussions.microsoft.com> wrote in
> > > message
> > > >news:07aa01c3ce47$4cc7aca0$a001280a@.phx.gbl...
> > > >> All processes have slowed to a crawl - 1 user running a
> > > >> simple query in ARC brings all app's residing on this
> > > >> machine to a crawl. Machine resourses are abundant and
> > > >> available. I know these are VERY sparse details... I'll
> > > >> provide whatever info I can if someone can let us know
> > > >> something. Thanx
> > > >
> > > >
> > > >.
> > > >
> >
> >
>|||Problem turned out not to be SQL Server generated. Was
instead a problem with SDE reconciliation...sorry!
david
>--Original Message--
>All processes have slowed to a crawl - 1 user running a
>simple query in ARC brings all app's residing on this
>machine to a crawl. Machine resourses are abundant and
>available. I know these are VERY sparse details... I'll
>provide whatever info I can if someone can let us know
>something. Thanx
>.
>
Wednesday, March 21, 2012
Down time from shrink?
I have a production database in which data file takes 17GB and used 10GB. I want to shrink it. Once I take about one hour to shrink 1GB. So I am worry long shrinking time. Is there down time during the shrinking that doesn't allow user access?
Thanks
ZYThow big is(are) your log file(s)?
dbcc shrinkdatabase does not require the database to be in single user mode but you may want to schedule some down time as you are likely to see a performance hit on the server and you are going to want reindex after the shrink because of the frgamentation shrinking causes.|||Hi, Sean:
Thanks for the reply. The log file is not big, just be about 100MB. Only data files are too.
ZYT
how big is(are) your log file(s)?
dbcc shrinkdatabase does not require the database to be in single user mode but you may want to schedule some down time as you are likely to see a performance hit on the server and you are going to want reindex after the shrink because of the frgamentation shrinking causes.|||Are you shrinking the database on a regular interval? If you do: Don't!
If you are running out of disk space: add more disks.|||17GB is tiny for a database. After your shrink, I would review your automatic growth if you are worried about too much free space.
Monday, March 19, 2012
Doubts regarding Sales Forecast model
I have few more clarification regarding time series.
Firstly
In my model the month level product sales value represented across 1st day of every month.So that the key time column is of datetime datatype containing a sequence of dates representing the 1st day of every month of the year.
Eg: 2006-01-01, 2006-02-01………. etc. all in (yy-mm-dd) format
But
when I make prediction for next five months, though it makes monthly
predictions the date part for the months are random whereas I expect
the date part to be 1st of every month.What is the reason for this and how can I overcome it.
Secondly
Predicted
sales values for some time period are negative though I do not have any
negative value in the training data. What is the reason for this and
how can I rectify it?
Thirdly
In
one of your earlier posts you had said that the time series algorithm
does not have any built in time intelligence but uses the key time
column as a time sequence stamp. So If have to make predictions for a
particular time period where the time slice for each time period is 25
days or 50 days etc, then I understand that the input data used to
train the model should be in the same time sequence.
Or
Can I specify the span of the time period according to which the prediction needs to be made?
Basically
how can I use the same time series model to make monthly, yearly,
quarterly, daily or predictions or for custom time period like I have
mentioned above.
1: There really isn't a workaround - you should use your own logic for dates
2: There is a parameter MINIMUM_PREDICTION_VALUE (or something like that) that you can set to 0, and you won't get negative predictions.
3: You should make unique models for each period you want to analyze - the patterns and periodicities are different, and need different analyses.
|||Thanks JamieDoubt about connections to sql server.
databases. Sometimes i Check the las batch time in enterprise manager to
see if the connection is active, and the date is expressed like this:
"01/01/1900 12:00 am"
Do somebody know why this happen?
Thanks a lot for your help.
*** Sent via Developersdex http://www.codecomments.com ***
See if this helps:
http://support.microsoft.com/default...b;en-us;306625
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"MariaGuzman" <marisa@.devdex.com> wrote in message
news:OF18nL3dFHA.3808@.TK2MSFTNGP14.phx.gbl...
Hi, i have some applications that use a sql server user to connect to
databases. Sometimes i Check the las batch time in enterprise manager to
see if the connection is active, and the date is expressed like this:
"01/01/1900 12:00 am"
Do somebody know why this happen?
Thanks a lot for your help.
*** Sent via Developersdex http://www.codecomments.com ***
Doubt about connections to sql server.
databases. Sometimes i Check the las batch time in enterprise manager to
see if the connection is active, and the date is expressed like this:
"01/01/1900 12:00 am"
Do somebody know why this happen'
Thanks a lot for your help.
*** Sent via Developersdex http://www.codecomments.com ***See if this helps:
http://support.microsoft.com/defaul...kb;en-us;306625
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"MariaGuzman" <marisa@.devdex.com> wrote in message
news:OF18nL3dFHA.3808@.TK2MSFTNGP14.phx.gbl...
Hi, i have some applications that use a sql server user to connect to
databases. Sometimes i Check the las batch time in enterprise manager to
see if the connection is active, and the date is expressed like this:
"01/01/1900 12:00 am"
Do somebody know why this happen'
Thanks a lot for your help.
*** Sent via Developersdex http://www.codecomments.com ***
Sunday, March 11, 2012
double threading a procedure?
When I look at the performance on my server (a dual Xeon HT) I can see that it only uses 1 out of 4 possible "cpus" to work on the calculations, while the three others idle out, and was wondering if I can somehow force it to use max available CPU power?The optimizer is usually pretty good about choosing the execution plan. But it can be influenced.
Have you checked your MAXDOP setting? If it is set to 1, you can bump it up. But as with all advice, caveat executor!|||Me personally, I would have compartmentalized the sproc into smaller units of work, i.e., I would have made many sprocs instead of a mongo one.
To get the to run independantly, we have in the past set these many sprocs to be executed as jobs, then have a sproc that launches all of the jobs. The launch will be serial, but the execution would not be.
With one big sproc, everything is serial, and you are not pushing the CPU hard enough anyway. If you want additional ways to thread, you should set up your tables as partitioned views. then the CPU can thread out.
Other than that, with your methodology, there is no way where it will thread, or use additional cpus
MOO
Friday, February 17, 2012
DOH! Forgot DST patch
It looks like we missed the DST patch on our new domain controllers.
It changed the local time and that propigated to two of my sql
clusters. My question is, what is the best way to rectify this? I
can't let it sit for the week. Should I just change the time and let
it propigate back? Any other ideas?
Thanks
ejHi
Why are you not syncronising on an external source? You should change this
back when the systems are not busy to avoid inconsistencies.
John
"erinrjones@.gmail.com" wrote:
> Hey all,
> It looks like we missed the DST patch on our new domain controllers.
> It changed the local time and that propigated to two of my sql
> clusters. My question is, what is the best way to rectify this? I
> can't let it sit for the week. Should I just change the time and let
> it propigate back? Any other ideas?
> Thanks
> ej
>
Doesnt see DB Table
I'm using an ODBC db connection to connect to my sql server and tryingto insert data into a table I've created, but I keep getting an errorsaying that the table doesn't exist. This is the first time I'veever used ODBC and DSN to connect to a db so I don't konw if there areqerks associated with this, but I've tried everything I can thinkof. I've changed the name of the table, placed it in brackets,placed "dbo" infront of the name, and still I get the same error aboutthe table not existing. My "Intial Catalog" in my connectionstring is the correct db, I just can't seem to get it going.
Any suggestions?
This is usually due to a table ownership discrepancy. If youqualify your table name with the owner do you have better success? E.g.instead of myTable use huffmaster.myTable (substitute the owner name forhuffmaster).
|||No, the owner is "dbo" and that doesn't seem to help.
|||OK, can you post the DSN (obfuscate the password), the connection string, and the exact error message?
|||Here's my Error:
ERROR [42S02] [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.Application'.
And here's my Connection String:
<addkey="LiquorLiabilityConnection_Local" value="Server=macdaddy;InitialCatalog=LiqourLiability;User ID=***;Password=***;" />
|||
It doesn't look like your connection string is incorrect. What about your code? Can you share some?
|||Here's my code that creates the connection and tries to push the insert:******Segment From Web Page Code Behind************
Dim sql As String
sql = "INSERT INTO [dbo].[Application] " & insert & "VALUES " & values
'insert & values are string variables I create based on what was filled out.
Try
ll.InsertApplication(sql)
Catch
pnlIntro.Visible = False
pnlError.Visible = True
divError.Controls.Add(New LiteralControl(Err.Description.ToString &"<br><br>"))
End Try
******Segment From Class File***************
Public Sub InsertApplication(ByVal sql As String)
Dim connection As New OdbcConnection()
connection = New OdbcConnection()
connection.ConnectionString= ConfigurationSettings.AppSettings.Get("LiquorLiabilityConnection")
Dim command As New OdbcCommand(sql, connection)
connection.Open()
command.ExecuteNonQuery()
connection.Close()
End Sub
I think if the connection was bad itwould throw an error on Opening the connection, but it waits until thequery executes. And it's not until it looks for my 'Application'table. I'm just confused.
|||
It seems you may have misspelt the name of the database specified inthe Initial Catalog, but I agree that your problem does not lookconnection-related. Also, I would stick with the attributesoutlined for SQL Server - ODBC athttp://www.connectionstrings.com.
Can you supply us the value contained in command.CommandText immediately before your ExecuteNonQuery?
|||My CommandText looks like this:
INSERT INTO [dbo].[Application] ('4_state', '5_state', '9_state','10_state', '11_state', '14_years', '14_months', '14_man_years','14_man_months', '15_years', '15_months', '15_stories', '21_sqft','21_apl_sqft', '21_apt_sqft', '21_units', '21_lro_sqft','22_mon_thurs_o', '22_mon_thurs_c', '22_fri_o', '22_fri_c', '22_sat_o','22_sat_c', '22_sun_o', '22_sun_c', '23a_open', '23b_open', '23c_open','23d_open', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33','34', '35', '36', '37', '38', '39', '40', '41', '42a', '42b', '42e','42f', '42g', '44', '45_food_p', '45_food_n', '45_alch_p', '45_alch_n','45_alch_tr_p', '45_alch_tr_n', '45_cc_p', '45_cc_n', '45_opc_p','45_opc_n', '45_other_p', '45_other_n', '48_gen', '48_fire', '48_prod','48_med', '48_eac', '48_pers') VALUES ('Alabama', 'Georgia', 'Alabama','Alabama', 'Alabama', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0','0', '0', 'Closed', 'Closed', 'Closed', 'Closed', 'Closed', 'Closed','Closed', 'Closed', 'Open', 'Open', 'Open', 'Open', 'No', 'No', 'No','No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No','No', 'No', 'Average age 21-25', 'No', 'Yes', 'No', 'No', 'No', 'Yes','0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '654','654', '654', '654', '654', '654')
Please ignore the funny values and field names, this is about as short as I could go with it without deleting any of it.
|||FWIW I made a simple page based on your code and it is working OK for me:
I had to enclose the field names beginning with a numeric character insquare brackets, and I used one of the connection string formats fromhttp://www.connectionstrings.com.
<%@. Page Language="VB"%>
<%@. Import Namespace="System.Data.ODBC"%>
<script runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Dim sql As String
sql = "INSERT INTO [dbo].[Application] ([4_state], [5_state]) VALUES ('Alabama','Pennsylvania')"
Try
InsertApplication(sql)
Catch
divError.Controls.Add(New LiteralControl(Err.Description.ToString & "<br><br>"))
End Try
End Sub
Public Sub InsertApplication(ByVal sql As String)
Dim connection As New OdbcConnection()
connection = New OdbcConnection()
connection.ConnectionString = "Driver={SQL Server};Server=(local);Database=test;Trusted_Connection=yes;"Dim command As New OdbcCommand(sql, connection)
connection.Open()
command.ExecuteNonQuery()
connection.Close()
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<div id="divError" runat="server">
Any errors will appear here
</div>
</form>
</body>
</html>
|||I put all my column names in "[]" & that seems to have got thingssolved for me now. I'm no longer getting an error concerning thetable, just data conversion errors (ex. varchar to money). Thanksfor all the help.
|||I still don't understand why you were receiving that "invalid objectname dbo.Application" error message. The error I received aboutthe column names was:
ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '_state
Had that been the message to begin with we would have had this figuredout long ago. In any case, I am glad you got this problem sortedand are moving on to the next. :-)
|||Now that I've moved to my next problem, let me ask a question. Isthere a way to INSERT Null values into a table. For instance ifI'm preparing parameters for a stored procedure:
Dim param as New OdbcParameter("@.name", OdbcType.Varchar)
How would I make the above parameter of value NULL? Do you justnot specify a value (ie, para.Value = ?)? Or it there some otherway of doing this?
|||Dinakar has a nice blog post on how to do this:
Entering NULL values into SQL Server 2000 using Parameterized Queries (including date columns)
|||Now that I've got the DBNull.Value in place, I run my stored proocedure and get a new error:
ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'InsertApplication' expects parameter '@.1', which was not supplied.
This is the first parameter that has DBNull.Value assigned to it. soI'm not sure exactly what is going on. It doesn't have anythingto do with expecting nulls in the stored procedure does it?