Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL string format utility? 1

Status
Not open for further replies.

jkelly295

MIS
Aug 14, 2001
15
US
Does anyone know of a utility that you can paste a sql statement from say Query Analyzer and it will create a formatted string for use in an ASP.NET page. Most of the time I use sprocs but sometimes when building dynamic sql statements it would be nice to have this utility.
 
What do you mean by a formatted string? You mean to replace all the spaces, tabs and carriage returns so that you could assign it to a string?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Select *
FROM Table
Where Field='TheOne'


equals

tSQL = "Select * "
tSQL += "FROM Table "
tSQL += "Where Field='TheOne' "


 
You'd presumably have to write an add in for VS or you could create your own simple program to do it. It would be fairly straight forward...


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Just didn't want to re-invent the wheel if it already existed.
 
Fair enough. Something like this may be useful for you then:


although I don't think there's a 2005 version of it out yet.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
That is even more than what I was looking for!
I Had found a few stand alone vb examples but this is the best by far.

Thanks!
 
Both VS.NET and VS 2005 have similar functionality built-in.

VS 2005:

VS.NET:

Also, in VS.NET, try dragging a table/stored procedure from the Server Explorer->Data Connections->[your database] onto your web form and check out the magic!

...okay, perhaps that's a bit melodramatic, but it will generate the connection, and commands for you so you don't have to write the SQL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top