Showing posts with label program. Show all posts
Showing posts with label program. Show all posts

Monday, March 26, 2012

How to fix corrupt database?

Hello,

I am trying to run the example program: Coding4Fun: Building a Family History Web Service at this URL

http://msdn.microsoft.com/coding4fun/xmlforfun/familyhistory/default.aspx

The project has an SQL Express database Family.mdf. When I try and open Family.mdf in VS 2005, I get this error:

'FAMILY.MDF' cannot be upgraded because its non-release version (587) is not supported by this version of SQL Server. You cannot open a database that is incompatible with this version of sqlservr.exe. You must re-create the database.

I can create a new database, but then the stored procedures will be lost.

Any suggestions how to repair the database?

Thanks

That database was based on a beta build. Beta build were not supposed to be supported after the RTM version is launched. í dont′think that there is a upgrade path for this internal version to the RTM version. If you still have a beta SQL Server 2005 (Yukon) you can try to attach the db to that one and script the structure out.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Hello Jens,

Thanks for taking time to reply to this question. I dont have a beta version of SQL 2005, so I guess I will have to just create a new database.

Thank you,

Tom

Monday, March 19, 2012

how to find that the table column exists through program

i need to check that the column exist in the table if yes the update/insert value in the column else i need to add the new column like new browser name in the table.

after the search i found some thing like and make the procedure like

Dim daAs SqlDataAdapter, dsAs DataSet, dcAs DataColumn, foundsAsBoolean

Try

Conn.Open()

cmd =New SqlCommand(str, Conn)

da =New SqlDataAdapter(cmd)

ds =New DataSet

da.Fill(ds,"tbls")

ForEach dcIn ds.Tables(0).Columns

If UCase(colnames) = UCase(dc.ColumnName)Then

founds =True

ExitFor

Else

founds =False

EndIf

Next

Catch exAs Exception

Finally

Conn.Close()

EndTry

Return founds

sugesstions on this is required.................

How to find Sql Server properties programatically

I am writing a program in .Net to retrieve properties of Sql Server.
How can I find the following properties without querying the database:

1. Replication enabled
2. Default language
3. Processors and threads running.

Thanks,
verveYou're probably looking for SQLDMO, which is a COM interface to MSSQL -
see Books Online for the details.

1. You can use the SQLDMO Replication object to enumerate replicated
databases, individual publications and articles etc.

2. Use the SQLServer.Language property

3. I'm not sure exactly what you want, but WMI might be a better option
for hardware and OS information. If by "threads" you really mean SQL
Server processes, then you can use the SQLServer.EnumProcesses method

In many cases, SQLDMO executes TSQL commands behind the scenes, so you
still need an authenticated connection to the server (and possibly a
user mapping in individual databases) to use it.

Simon|||Hi,
Thanks for the prompt reply but can also tell me which classes I should
be querying in WMI or which interface?

Thanks in advance :)
Verve|||The full WMI reference is on MSDN, but the TechNet scripting library
might be a faster way to get started:

http://www.microsoft.com/technet/sc...c/hwbavb03.mspx
http://www.microsoft.com/technet/sc...d/pcthvb07.mspx

Simon