Showing posts with label sql-server. Show all posts
Showing posts with label sql-server. Show all posts

Wednesday, March 21, 2012

loop through each table of my DB

Is there a way to loop using a cursor in SQL-server so i can see if each columns of each tables that i loop through my DB have a specific string value and change it to something else, renaming the column if the match if correct.

any threads that i can read from or website..

thanx !!Won't you get there using:SELECT * FROM INFORMATION_SCHEMA.COLUMNS-PatP|||Table name = nMontantBilletTVQ
Table name = nMontantBilletTPS

here an example of what i try to find.

i would like to search the word 'TVQ' in my string 'nMontantBilletTVQ'

is there a string functions for that ?? just cant get one working

thanx|||Use LIKE.

-PatP

Wednesday, March 7, 2012

Looking for SQL-Server ODBC parameters

I've been browsing all over the net, through technet and MSDN as well, all to no avail.

I'm looking for the parameters I can use with SQL-Server drivers of MDAC 2.7 when using dbcconfig in scripts.

E.g. with mysql you can do a line "DSN=Test;Description=Test Odbc DSN;Server=Test_server;user=stars"

Using odbcconf configsysdsn "SQL Server" "DSN=Test DSN;Description=For stars;User=Stars" I get the error "Unable to create a data source name for the "sql-server" driver, drivers configdsn, config driver or configtranslator failed.

If i remove everything but the DSN name, it works, so I must be getting the parameters wrong. But exactly where, I'm not sure..

Thanks for your help!

FlixFirst of all, you should consider to use the native SQL Server OLE DB provider, instead of the ODBC provider. Microsoft declared this provider already obsolete.

Secondly, you reporting two different things: Your MySQL line specifies the ConnectionString as required for the ODBC OLE DB provider. Your SQL Server line, however, does the same, but you are trying to mix that with ODBCConfig.

So, I'm not sure what you want to achieve:

1) specify a DSN-based connection string
2) dynamically define a DSN
3) specify a DSN-less connection string

For 1) and 3) look here (www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForODBCDatabases)|||The old ODBC providor is merely contained to an older system not yet phased out. Based on a SQL-Server 6.5. As all programming ressources on that system has died out, its merely a question of time before an entirely different system is set in place.

My problem (literally) is to keep the system alive as is, and in this case it is to define a DSN through loginscripts using ODBCconfig, as I would otherwise have to churn around with 150 machines creating a host of different DSN's.

In my testing case I am able to give a MySQL DSN more specific arguments using ODBCconfig as opposed to the SQL-Server DSN. Namely which user the DSN should use, and what DB to access... and I can't see the sense in that, as I need to specify user and DB as you would normally do using your ODBC administrating tool.

Hope this clarify's my situation just a whee bit.

Thanks,

Flix|||Okay, if I understand you right, your primary problem isn't to generate a DSN, but to connect via ODBC? Why don't you follow my point 3): use an DSN-less ODBC connection.|||That would require a recoding of this ancient Access 95/97 and SQL 6.5 based system, which is practically like sticking your hand into a wasp-nest. Or do I read the stuff wrong?

Its the database front-end that needs the system DSN's, and in the database there are hordes of linked tables, queries and code all built up against the presence of the system DSN's.

Recoding of the app is pretty much out of the question, as it is destined to be replaced within 6 - 12 months.. so I just need a way to distribute the system DSN to our workstations, in which case I chose odbcconf as it could be called from the login-script.

Cheers, Flix|||Okay, this (http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q171/1/46.ASP&NoWebContent=1) should help you.

Looking for SQL-Server documenter

Hi everybody,
I'm looking for a documenter for the SQL-Server. It should describe the
tables, views with its structure (fieldnames, type, length, etc.) and
equally important it should be possible to export this information in a file
(XML, CSV, whatever).
Does anybody knows a tool like that and if so, where to get it?
Thx in advance
MichaelTry SQl Scribe Docuemtnation Builder
http://www.ag-software.com
--
kind regards
Greg O
Need to document your databases. Use the first and still the best AGS SQL
Scribe
http://www.ag-software.com
"Michael Bender" <technik@.salescom.de> wrote in message
news:df69m7$kjp$03$1@.news.t-online.com...
> Hi everybody,
> I'm looking for a documenter for the SQL-Server. It should describe the
> tables, views with its structure (fieldnames, type, length, etc.) and
> equally important it should be possible to export this information in a
> file
> (XML, CSV, whatever).
> Does anybody knows a tool like that and if so, where to get it?
> Thx in advance
> Michael
>|||Michael Bender wrote:
> Hi everybody,
> I'm looking for a documenter for the SQL-Server. It should describe the
> tables, views with its structure (fieldnames, type, length, etc.) and
> equally important it should be possible to export this information in a file
> (XML, CSV, whatever).
> Does anybody knows a tool like that and if so, where to get it?
> Thx in advance
> Michael
SchemaToDoc (http://www.schematodoc.com) will produce a Word document
that includes information about the tables and fields in your database.
The program documents: Primary Keys, Field Information (type, size,
defaults, nullable), Indexes, Check Constraints, Descriptions/Comments,
Foreign Keys, and Triggers. The program also lets you annotate your
tables and fields, and include those comments in the Word doc.

Looking for SQL-Server documenter

Hi everybody,
I'm looking for a documenter for the SQL-Server. It should describe the
tables, views with its structure (fieldnames, type, length, etc.) and
equally important it should be possible to export this information in a file
(XML, CSV, whatever).
Does anybody knows a tool like that and if so, where to get it?
Thx in advance
Michael
Try SQl Scribe Docuemtnation Builder
http://www.ag-software.com
kind regards
Greg O
Need to document your databases. Use the first and still the best AGS SQL
Scribe
http://www.ag-software.com
"Michael Bender" <technik@.salescom.de> wrote in message
news:df69m7$kjp$03$1@.news.t-online.com...
> Hi everybody,
> I'm looking for a documenter for the SQL-Server. It should describe the
> tables, views with its structure (fieldnames, type, length, etc.) and
> equally important it should be possible to export this information in a
> file
> (XML, CSV, whatever).
> Does anybody knows a tool like that and if so, where to get it?
> Thx in advance
> Michael
>
|||Michael Bender wrote:
> Hi everybody,
> I'm looking for a documenter for the SQL-Server. It should describe the
> tables, views with its structure (fieldnames, type, length, etc.) and
> equally important it should be possible to export this information in a file
> (XML, CSV, whatever).
> Does anybody knows a tool like that and if so, where to get it?
> Thx in advance
> Michael
SchemaToDoc (http://www.schematodoc.com) will produce a Word document
that includes information about the tables and fields in your database.
The program documents: Primary Keys, Field Information (type, size,
defaults, nullable), Indexes, Check Constraints, Descriptions/Comments,
Foreign Keys, and Triggers. The program also lets you annotate your
tables and fields, and include those comments in the Word doc.

Looking for SQL-Server documenter

Hi everybody,
I'm looking for a documenter for the SQL-Server. It should describe the
tables, views with its structure (fieldnames, type, length, etc.) and
equally important it should be possible to export this information in a file
(XML, CSV, whatever).
Does anybody knows a tool like that and if so, where to get it?
Thx in advance
MichaelTry SQl Scribe Docuemtnation Builder
http://www.ag-software.com
--
kind regards
Greg O
Need to document your databases. Use the first and still the best AGS SQL
Scribe
http://www.ag-software.com
"Michael Bender" <technik@.salescom.de> wrote in message
news:df69m7$kjp$03$1@.news.t-online.com...
> Hi everybody,
> I'm looking for a documenter for the SQL-Server. It should describe the
> tables, views with its structure (fieldnames, type, length, etc.) and
> equally important it should be possible to export this information in a
> file
> (XML, CSV, whatever).
> Does anybody knows a tool like that and if so, where to get it?
> Thx in advance
> Michael
>|||Michael Bender wrote:
> Hi everybody,
> I'm looking for a documenter for the SQL-Server. It should describe the
> tables, views with its structure (fieldnames, type, length, etc.) and
> equally important it should be possible to export this information in a fi
le
> (XML, CSV, whatever).
> Does anybody knows a tool like that and if so, where to get it?
> Thx in advance
> Michael
SchemaToDoc (http://www.schematodoc.com) will produce a Word document
that includes information about the tables and fields in your database.
The program documents: Primary Keys, Field Information (type, size,
defaults, nullable), Indexes, Check Constraints, Descriptions/Comments,
Foreign Keys, and Triggers. The program also lets you annotate your
tables and fields, and include those comments in the Word doc.