Showing posts with label mssql. Show all posts
Showing posts with label mssql. Show all posts

Thursday, March 22, 2012

ASP script to display database structure?

Posted this to SQLServer.Tools, but maybe it belongs here...
Does anyone have an ASP script that I can use to dump the structure of an MS
SQL 2000 database?
The firewall here won't allow any remote connections through, and our DB
host does not have any web administration.
I just need the table names, field names, and field data types.
Thx!would information_schema.tables and information_schema.columns do?
Just join the views and select the columns you need.
SELECT *
FROM information_schema.tables t
JOIN information_schema.columns c
ON t.table_schema = c.table_schema
AND t.table_name = c.table_name
"Noozer" wrote:

> Posted this to SQLServer.Tools, but maybe it belongs here...
>
> Does anyone have an ASP script that I can use to dump the structure of an
MS
> SQL 2000 database?
> The firewall here won't allow any remote connections through, and our DB
> host does not have any web administration.
> I just need the table names, field names, and field data types.
> Thx!
>
>|||Thanks!
That did the trick!
"Nigel Rivett" <NigelRivett@.discussions.microsoft.com> wrote in message
news:46273214-5138-4D9F-A0EB-7C1AC0B70344@.microsoft.com...
> would information_schema.tables and information_schema.columns do?
> Just join the views and select the columns you need.
> SELECT *
> FROM information_schema.tables t
> JOIN information_schema.columns c
> ON t.table_schema = c.table_schema
> AND t.table_name = c.table_name

Monday, March 19, 2012

ask for ASP connection string to ODBC

do anyone know the connection string for ASP connect to ODBC?
i have created an ODBC for MSSQL named "DMZ-SQL" already.
Thank you very much!!I have an example for DSN-less connection via ADO, so u don't have to always create your Data Source Name in the ODBC properties everytime u move your development.

Set DBConn = Server.CreateObject("ADODB.Connection")
DBConn.Open "Driver={SQL Server};SERVER=127.0.0.1;UID=sa;PWD1234=;DATABASE= Mydatabase"|||Thank you very much!

asdb suspect

Hi,
I am having some issuse with Arcserve DB. Client ran out of space on C: .
Arcserve database engine would not start. Found out MSSQL is seeing asdb
marked as suspect. I have tried to reset status but have not had any result
returned. I also have tried update sysdatabases ,still with no result
returned. Is there anothe rway to clear the status of this asdb? Novice to
SQL by the way.
Thanks for any and all help.
John
"Learn from the mistakes of others! You can't live long enough to make them
all yourself!!"
Hopefully following article can help you:
http://www.karaszi.com/sqlserver/inf...suspect_db.asp
"john" wrote:

> Hi,
> I am having some issuse with Arcserve DB. Client ran out of space on C: .
> Arcserve database engine would not start. Found out MSSQL is seeing asdb
> marked as suspect. I have tried to reset status but have not had any result
> returned. I also have tried update sysdatabases ,still with no result
> returned. Is there anothe rway to clear the status of this asdb? Novice to
> SQL by the way.
> Thanks for any and all help.
> John
> --
> "Learn from the mistakes of others! You can't live long enough to make them
> all yourself!!"

asdb suspect

Hi,
I am having some issuse with Arcserve DB. Client ran out of space on C: .
Arcserve database engine would not start. Found out MSSQL is seeing asdb
marked as suspect. I have tried to reset status but have not had any result
returned. I also have tried update sysdatabases ,still with no result
returned. Is there anothe rway to clear the status of this asdb? Novice to
SQL by the way.
Thanks for any and all help.
John
--
"Learn from the mistakes of others! You can't live long enough to make them
all yourself!!"Hopefully following article can help you:
http://www.karaszi.com/sqlserver/in..._suspect_db.asp
"john" wrote:

> Hi,
> I am having some issuse with Arcserve DB. Client ran out of space on C: .
> Arcserve database engine would not start. Found out MSSQL is seeing asdb
> marked as suspect. I have tried to reset status but have not had any resul
t
> returned. I also have tried update sysdatabases ,still with no result
> returned. Is there anothe rway to clear the status of this asdb? Novice to
> SQL by the way.
> Thanks for any and all help.
> John
> --
> "Learn from the mistakes of others! You can't live long enough to make the
m
> all yourself!!"

asdb suspect

Hi,
I am having some issuse with Arcserve DB. Client ran out of space on C: .
Arcserve database engine would not start. Found out MSSQL is seeing asdb
marked as suspect. I have tried to reset status but have not had any result
returned. I also have tried update sysdatabases ,still with no result
returned. Is there anothe rway to clear the status of this asdb? Novice to
SQL by the way.
Thanks for any and all help.
John
--
"Learn from the mistakes of others! You can't live long enough to make them
all yourself!!"Hopefully following article can help you:
http://www.karaszi.com/sqlserver/info_corrupt_suspect_db.asp
"john" wrote:
> Hi,
> I am having some issuse with Arcserve DB. Client ran out of space on C: .
> Arcserve database engine would not start. Found out MSSQL is seeing asdb
> marked as suspect. I have tried to reset status but have not had any result
> returned. I also have tried update sysdatabases ,still with no result
> returned. Is there anothe rway to clear the status of this asdb? Novice to
> SQL by the way.
> Thanks for any and all help.
> John
> --
> "Learn from the mistakes of others! You can't live long enough to make them
> all yourself!!"

Thursday, February 16, 2012

Arithmetic overflow error converting expression to data type int.

Hi,
I using the following query

select dateadd(s, 1185255439727, '01-01-1970 05:30:00')

on MSSQL 2005. I get the error

Arithmetic overflow error converting expression to data type int.

If I use the query

select dateadd(ss, 1088728808 , '01-01-1970 05:30:00') I dont get this error. Looks big numbers are having problem. Please help

Quote:

Originally Posted by Hulikal

Hi,
I using the following query

select dateadd(s, 1185255439727, '01-01-1970 05:30:00')

on MSSQL 2005. I get the error

Arithmetic overflow error converting expression to data type int.

If I use the query

select dateadd(ss, 1088728808 , '01-01-1970 05:30:00') I dont get this error. Looks big numbers are having problem. Please help


maybe you should consider adding year instead of seconds on your date...that's a lot of seconds|||I would take the number of seconds, divide it out;


There are 31536000 Seconds in a year so store that value in a variable as 1 or 2, ect depending upon how many years you have.

Subtract 31536000 * (the value stored from above) from your starting value to get the remaining time. Then do the same for days, then minutes, then seconds.

Do not do this for months as each month has varying number of days.

This way you will date add to Year, Days, Minutes, Seconds.

This will be more manageable.

Monday, February 13, 2012

Arithmetic overflow

Hello.
On one my box (Win2k + SP2, MSSQL 2000 EE + SP2) I have some problem.
Suddenly i became to recive error "Arithmetic overflow occurred." Even if i
run "use db".
I haven't any error in logs.
I will be glad any suggestions.
--
Dmitry Burtsev [burtsev@.removethis.km.ru]Hi,Dima
Let's start with why don't you apply SP3 yet?
What are you doing when you get the error? Please show us your query,table
structutre.
"Burtsev Dmitry" <burtsev@.removethispart.km.ru> wrote in message
news:eC4sbqT0EHA.1188@.tk2msftngp13.phx.gbl...
> Hello.
> On one my box (Win2k + SP2, MSSQL 2000 EE + SP2) I have some problem.
> Suddenly i became to recive error "Arithmetic overflow occurred." Even if
i
> run "use db".
> I haven't any error in logs.
> I will be glad any suggestions.
>
> --
> Dmitry Burtsev [burtsev@.removethis.km.ru]
>
>

Arithmetic overflow

Hello.
On one my box (Win2k + SP2, MSSQL 2000 EE + SP2) I have some problem.
Suddenly i became to recive error "Arithmetic overflow occurred." Even if i
run "use db".
I haven't any error in logs.
I will be glad any suggestions.
Dmitry Burtsev [burtsev@.removethis.km.ru]
Hi,Dima
Let's start with why don't you apply SP3 yet?
What are you doing when you get the error? Please show us your query,table
structutre.
"Burtsev Dmitry" <burtsev@.removethispart.km.ru> wrote in message
news:eC4sbqT0EHA.1188@.tk2msftngp13.phx.gbl...
> Hello.
> On one my box (Win2k + SP2, MSSQL 2000 EE + SP2) I have some problem.
> Suddenly i became to recive error "Arithmetic overflow occurred." Even if
i
> run "use db".
> I haven't any error in logs.
> I will be glad any suggestions.
>
> --
> Dmitry Burtsev [burtsev@.removethis.km.ru]
>
>

Arithmetic overflow

Hello.
On one my box (Win2k + SP2, MSSQL 2000 EE + SP2) I have some problem.
Suddenly i became to recive error "Arithmetic overflow occurred." Even if i
run "use db".
I haven't any error in logs.
I will be glad any suggestions.
Dmitry Burtsev [burtsev@.removethis.km.ru]Hi,Dima
Let's start with why don't you apply SP3 yet?
What are you doing when you get the error? Please show us your query,table
structutre.
"Burtsev Dmitry" <burtsev@.removethispart.km.ru> wrote in message
news:eC4sbqT0EHA.1188@.tk2msftngp13.phx.gbl...
> Hello.
> On one my box (Win2k + SP2, MSSQL 2000 EE + SP2) I have some problem.
> Suddenly i became to recive error "Arithmetic overflow occurred." Even if
i
> run "use db".
> I haven't any error in logs.
> I will be glad any suggestions.
>
> --
> Dmitry Burtsev [burtsev@.removethis.km.ru]
>
>

Thursday, February 9, 2012

Are indexed updated?

Dear MSSQL DBAs,
I am trying to research about indexes and find out performance issues
related with indexes. My Questions are :
1) are indexes useful if we are using Bulk operations?
2) does indexes have any effect on simple INSERT or DELETE statements?
3) Do we need to drop indexes before Bulk operations
4) Is individual insert statement in a loop treated as a bulk insertion?
Regards,
Abdul-RahmanFor bulk insert issues, please see the whitepaper below:
[url]http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/incbulkload.mspx[/u
rl]
Indexes do have an effect on DML (insert/update/delete) performance. Any DML
you perform has to be reflected in the non-clustered indexes. For example,
if you have a table with 10 non-clustered indexes and you insert a single
row, a row must be inserted into each non-clustered index. This is called
index maintenance and depending on the way you define the indexes can have a
noticeable effect on performance.
Please let me know if you have any further questions.
Regards
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Abdul-Rahman" <rahman.mahmood@.pk.softecheww.com> wrote in message
news:ev$STuHCFHA.3664@.TK2MSFTNGP14.phx.gbl...
> Dear MSSQL DBAs,
> I am trying to research about indexes and find out performance issues
> related with indexes. My Questions are :
> 1) are indexes useful if we are using Bulk operations?
> 2) does indexes have any effect on simple INSERT or DELETE statements?
> 3) Do we need to drop indexes before Bulk operations
> 4) Is individual insert statement in a loop treated as a bulk insertion?
> Regards,
> Abdul-Rahman
>