Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Wednesday, March 21, 2012

Recover stored procedures

Before my hard disk failed , I had backup MSSQL7 folder.After I re format it and attached the database [MDF ,LDF ] I lost my stored procedures.Can someone help me or show me how to recover my stored procedures.
Thanks.The SPs are part of the database and should be there if the database is not corrupt.
Maybe they are owned by a different user or mapped to a different login.
Try select * from sysobjects where type = 'P'
and look in syscomments

select text from syscomments where text like '%myspname%'|||Thanks for your fast response , I am so lucky that get back my 150 stored procedures back from my old 500 MB hard disk !!!

Thanks.sql

Tuesday, March 20, 2012

Recover RDL file

Hello,
I've got a huge problem with SQL Server 2005. I've lost the RDL file built
with SQL Server BI Studio (developper hard disk format, with no backup), and
the only thing that I've got now is the server itself, with the ReportServer
database.
Is it possible to re-create a RDL file from the tables in this database?
Thanks for your help.
JN.In report manager click on the report, properties tab, click the edit button
under Report Definition. Give is a local directory (different from where the
project will be). Then create a new project and add and existing item to it.
It will copy the rdl over into the project directly. Not very discoverable
but works as advertized.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Jean-Nicolas BERGER" <j-n.enlevezmoi.berger@.club-internet.fr> wrote in
message news:O3BwKmCMHHA.3668@.TK2MSFTNGP02.phx.gbl...
> Hello,
> I've got a huge problem with SQL Server 2005. I've lost the RDL file built
> with SQL Server BI Studio (developper hard disk format, with no backup),
> and the only thing that I've got now is the server itself, with the
> ReportServer database.
> Is it possible to re-create a RDL file from the tables in this database?
> Thanks for your help.
> JN.
>

Monday, February 20, 2012

RecordCount -1

This is a multi-part message in MIME format.
--=_NextPart_000_0057_01C44D4D.A2D86E10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello,
I am using the function below to get some values form database.
However for RecordCount it always returns -1.
Any clues hot to fix it?
Thx
YuriW
Function RunSQL (sConnection_String, sSQL_QUERY) Dim db_object Dim sSQL_string
'connection_string =3D "DSN=3DMagnetic;UID=3Dlaurel;PWD=3Duklever"
sSQL_string =3D sSQL_QUERY
' Create the conection object.
Set db_object =3D CreateObject("ADODB.Connection")
' or use this method if a DSN entry was created.
db_object.Open(sConnection_String)
' Get the recordset returned from a select query.
Set recordset =3D db_object.Execute(sSQL_string)
' Display the results of the query.
sOut =3D recordset.RecordCount
RunSQL =3D sOut
' Close the database connection.
db_object.Close
Set db_object =3D Nothing
End Function
--=_NextPart_000_0057_01C44D4D.A2D86E10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Hello,
I am using the function below to get some values form = database.
However for RecordCount it always returns -1.
Any clues hot to fix it?

Thx
YuriW

Function RunSQL (sConnection_String, sSQL_QUERY) Dim = db_object Dim sSQL_string 'connection_string =3D "DSN=3DMagnetic;UID=3Dlaurel;PWD=3Duklever" sSQL_string =3D sSQL_QUERY
' Create the conection object. Set db_object =3D CreateObject("ADODB.Connection")

' or use this method if a DSN entry was = created. db_object.Open(sConnection_String)

' Get the recordset returned from a select query. = Set recordset =3D db_object.Execute(sSQL_string)

' Display the results of the query.

sOut =3D recordset.RecordCount
RunSQL =3D sOut

' Close the database connection. = db_object.Close Set db_object =3D Nothing

End Function
</FONT></FONT>
--=_NextPart_000_0057_01C44D4D.A2D86E10--http://www.aspfaq.com/2193
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Yuri Weinstein (HotMail)" <yuriw_NOSPAM@.hotmail.com> wrote in message
news:7Mnxc.68469$yx3.34214@.newssvr29.news.prodigy.com...
Hello,
I am using the function below to get some values form database.
However for RecordCount it always returns -1.
Any clues hot to fix it?
Thx
YuriW
Function RunSQL (sConnection_String, sSQL_QUERY)
Dim db_object
Dim sSQL_string
'connection_string = "DSN=Magnetic;UID=laurel;PWD=uklever"
sSQL_string = sSQL_QUERY
' Create the conection object.
Set db_object = CreateObject("ADODB.Connection")
' or use this method if a DSN entry was created.
db_object.Open(sConnection_String)
' Get the recordset returned from a select query.
Set recordset = db_object.Execute(sSQL_string)
' Display the results of the query.
sOut = recordset.RecordCount
RunSQL = sOut
' Close the database connection.
db_object.Close
Set db_object = Nothing
End Function|||Thanks you. I am still not clear how to change the code in order to fix it?
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eyU6tjYTEHA.3580@.TK2MSFTNGP09.phx.gbl...
> http://www.aspfaq.com/2193
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Yuri Weinstein (HotMail)" <yuriw_NOSPAM@.hotmail.com> wrote in message
> news:7Mnxc.68469$yx3.34214@.newssvr29.news.prodigy.com...
> Hello,
> I am using the function below to get some values form database.
> However for RecordCount it always returns -1.
> Any clues hot to fix it?
> Thx
> YuriW
> Function RunSQL (sConnection_String, sSQL_QUERY)
> Dim db_object
> Dim sSQL_string
> 'connection_string = "DSN=Magnetic;UID=laurel;PWD=uklever"
> sSQL_string = sSQL_QUERY
> ' Create the conection object.
> Set db_object = CreateObject("ADODB.Connection")
> ' or use this method if a DSN entry was created.
> db_object.Open(sConnection_String)
> ' Get the recordset returned from a select query.
> Set recordset = db_object.Execute(sSQL_string)
> ' Display the results of the query.
> sOut = recordset.RecordCount
> RunSQL = sOut
> ' Close the database connection.
> db_object.Close
> Set db_object = Nothing
> End Function
>|||Maybe you need to look at the article again?
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Yuri Weinstein (HotMail)" <yuriw_NOSPAM@.hotmail.com> wrote in message
news:dnoxc.68491$iR3.59055@.newssvr29.news.prodigy.com...
> Thanks you. I am still not clear how to change the code in order to fix
it?
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:eyU6tjYTEHA.3580@.TK2MSFTNGP09.phx.gbl...
> > http://www.aspfaq.com/2193
> >
> > --
> > http://www.aspfaq.com/
> > (Reverse address to reply.)
> >
> >
> >
> >
> > "Yuri Weinstein (HotMail)" <yuriw_NOSPAM@.hotmail.com> wrote in message
> > news:7Mnxc.68469$yx3.34214@.newssvr29.news.prodigy.com...
> > Hello,
> > I am using the function below to get some values form database.
> > However for RecordCount it always returns -1.
> > Any clues hot to fix it?
> >
> > Thx
> > YuriW
> >
> > Function RunSQL (sConnection_String, sSQL_QUERY)
> > Dim db_object
> > Dim sSQL_string
> >
> > 'connection_string = "DSN=Magnetic;UID=laurel;PWD=uklever"
> > sSQL_string = sSQL_QUERY
> >
> > ' Create the conection object.
> > Set db_object = CreateObject("ADODB.Connection")
> >
> > ' or use this method if a DSN entry was created.
> > db_object.Open(sConnection_String)
> >
> > ' Get the recordset returned from a select query.
> > Set recordset = db_object.Execute(sSQL_string)
> >
> > ' Display the results of the query.
> >
> > sOut = recordset.RecordCount
> >
> > RunSQL = sOut
> >
> > ' Close the database connection.
> > db_object.Close
> > Set db_object = Nothing
> >
> > End Function
> >
> >
>|||This is a multi-part message in MIME format.
--=_NextPart_000_00C3_01C44D70.C4F36D60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Recordcount is not supported with the default forward-only cursor. You =can try to set the type of cursor before you excute your SQL code.
"Yuri Weinstein (HotMail)" <yuriw_NOSPAM@.hotmail.com> wrote in message =news:7Mnxc.68469$yx3.34214@.newssvr29.news.prodigy.com...
Hello,
I am using the function below to get some values form database.
However for RecordCount it always returns -1.
Any clues hot to fix it?
Thx
YuriW
Function RunSQL (sConnection_String, sSQL_QUERY) Dim db_object Dim sSQL_string
'connection_string =3D "DSN=3DMagnetic;UID=3Dlaurel;PWD=3Duklever"
sSQL_string =3D sSQL_QUERY
' Create the conection object.
Set db_object =3D CreateObject("ADODB.Connection")
' or use this method if a DSN entry was created.
db_object.Open(sConnection_String)
' Get the recordset returned from a select query.
Set recordset =3D db_object.Execute(sSQL_string)
' Display the results of the query.
sOut =3D recordset.RecordCount
RunSQL =3D sOut
' Close the database connection.
db_object.Close
Set db_object =3D Nothing
End Function
--=_NextPart_000_00C3_01C44D70.C4F36D60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Recordcount is not supported with the default forward-only cursor. =You can try to set the type of cursor before you excute your SQL code.
"Yuri Weinstein (HotMail)" = wrote in message news:7Mnxc=.68469$yx3.34214@.newssvr29.news.prodigy.com...
Hello,
I am using the function below to get some values form =database.
However for RecordCount it always returns -1.
Any clues hot to fix it?

Thx
YuriW

Function RunSQL (sConnection_String, sSQL_QUERY) Dim =db_object Dim sSQL_string 'connection_string =3D "DSN=3DMagnetic;UID=3Dlaurel;PWD=3Duklever" sSQL_string =3D sSQL_QUERY
' Create the conection object. Set db_object =3D = CreateObject("ADODB.Connection")

' or use this method if a DSN entry was =created. db_object.Open(sConnection_String)

' Get the recordset returned from a select =query. Set recordset =3D db_object.Execute(sSQL_string)

' Display the results of the query.

sOut =3D recordset.RecordCount
RunSQL =3D sOut

' Close the database connection. db_object.Close Set db_object =3D Nothing

End Function

--=_NextPart_000_00C3_01C44D70.C4F36D60--|||Got it, thx!
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eyU6tjYTEHA.3580@.TK2MSFTNGP09.phx.gbl...
> http://www.aspfaq.com/2193
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Yuri Weinstein (HotMail)" <yuriw_NOSPAM@.hotmail.com> wrote in message
> news:7Mnxc.68469$yx3.34214@.newssvr29.news.prodigy.com...
> Hello,
> I am using the function below to get some values form database.
> However for RecordCount it always returns -1.
> Any clues hot to fix it?
> Thx
> YuriW
> Function RunSQL (sConnection_String, sSQL_QUERY)
> Dim db_object
> Dim sSQL_string
> 'connection_string = "DSN=Magnetic;UID=laurel;PWD=uklever"
> sSQL_string = sSQL_QUERY
> ' Create the conection object.
> Set db_object = CreateObject("ADODB.Connection")
> ' or use this method if a DSN entry was created.
> db_object.Open(sConnection_String)
> ' Get the recordset returned from a select query.
> Set recordset = db_object.Execute(sSQL_string)
> ' Display the results of the query.
> sOut = recordset.RecordCount
> RunSQL = sOut
> ' Close the database connection.
> db_object.Close
> Set db_object = Nothing
> End Function
>|||In "Display the results of the query" you should iterate through recordset
with MoveFirst/MoveNext. Add counter into this cycle
dim counter
counter = 0
rs.MoveFirst
while not rs.EOF
... display record
counter = counter + 1
rs.MoveNext
wend
'here counter contains number of records
//--
Regards,
Vassiliev V. V.
http://www-sharp.com -
Scripting/HTA/.Net Framework IDE
"Yuri Weinstein (HotMail)" <yuriw_NOSPAM@.hotmail.com> '?/'' ?
'' '?: news:7Mnxc.68469$yx3.34214@.newssvr29.news.prodigy.com...
Hello,
I am using the function below to get some values form database.
However for RecordCount it always returns -1.
Any clues hot to fix it?
Thx
YuriW
Function RunSQL (sConnection_String, sSQL_QUERY)
Dim db_object
Dim sSQL_string
'connection_string = "DSN=Magnetic;UID=laurel;PWD=uklever"
sSQL_string = sSQL_QUERY
' Create the conection object.
Set db_object = CreateObject("ADODB.Connection")
' or use this method if a DSN entry was created.
db_object.Open(sConnection_String)
' Get the recordset returned from a select query.
Set recordset = db_object.Execute(sSQL_string)
' Display the results of the query.
sOut = recordset.RecordCount
RunSQL = sOut
' Close the database connection.
db_object.Close
Set db_object = Nothing
End Function