Skip to content
Advertisement

Help finding old SQL tool that rewrote queries [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 7 years ago. Improve this question There was this old sql server tool called Lectoneth or something like that, you’d put sql queries in it, and it would rewrite it

Check if role exists in DB?

I want to add users to the same role in more than one database. However the role may or may not be present in each database. How can I check if the role exists in each database and if it does, add users to that role? e.g. IF role exists BEGIN Add user in role END Answer try:

SQL method to replace repeating blanks with single blanks

Is there a more elegant way of doing this. I want to replace repeating blanks with single blanks…. (its sql server 2000 – but I would prefer generic SQL) Answer Here is a simple set based way that will collapse multiple spaces into a single space by applying three replaces. Your Update statement can now be set based: Use an

generate days from date range

I would like to run a query like select … as days where `date` is between ‘2010-01-20’ and ‘2010-01-24’ And return data like: days ———- 2010-01-20 2010-01-21 2010-01-22 2010-01-23 2010-01-…

How to verify if two tables have exactly the same data?

Basically, we have one table (original table) and it is backed up into another table (backup table); thus the two tables have exactly the same schema. In the beginning, both tables (original table and backup table) contains exactly the same set of data. After some time for some reason, I need to verify whether dataset in the original table has

Finding duplicate rows in SQL Server

I have a SQL Server database of organizations, and there are many duplicate rows. I want to run a select statement to grab all of these and the amount of dupes, but also return the ids that are associated with each organization. A statement like: Will return something like But I’d also like to grab the IDs of them. Is

Advertisement