Viewing 15 posts - 1 through 15 (of 17 total)
You can make use of WHILE[/url] loop or Recursive Queries Using Common Table Expressions
======================================
Blog: www.irohitable.com
April 25, 2012 at 3:07 am
I think the second solution I posted (with small script) will do the job.
======================================
Blog: www.irohitable.com
April 25, 2012 at 1:25 am
@Phil:
I added WHERE clause in the script mentioned in the first link of my post. After adding the WHERE clause, it looks like this:
SELECT
t.NAME AS...
======================================
Blog: www.irohitable.com
April 25, 2012 at 1:23 am
OK Guys.
This code returns all tables and total rows in each table. I also used WHERE clause:
CREATE TABLE #temp
(
...
======================================
Blog: www.irohitable.com
April 25, 2012 at 1:11 am
The links below may help. You can add a WHERE clause to meet your requirements for the number of rows.
Query to list number of records in each table in a...
======================================
Blog: www.irohitable.com
April 25, 2012 at 12:34 am
A trigger is similar to stored procedures with a little difference. Trigger is attached to a table and the code gets executed automatically when row is inserted, updated or deleted...
======================================
Blog: www.irohitable.com
April 23, 2012 at 3:54 am
You provided very little information. What exactly you want to do?
======================================
Blog: www.irohitable.com
April 23, 2012 at 2:30 am
Create an AFTER INSERT trigger and add that query into it.
======================================
Blog: www.irohitable.com
April 23, 2012 at 2:07 am
Refer to these article:
Using SQL Server 2005/2008 Pivot on Unknown Number of Columns (Dynamic Pivot)[/url]
SQL Server Pivot: Converting Rows to Columns with Dynamic Query
Retrieving rows as columns using a single...
======================================
Blog: www.irohitable.com
April 23, 2012 at 2:02 am
Refer to this links:
SQL Server: Best way to Update row if exists, Insert if not
======================================
Blog: www.irohitable.com
April 23, 2012 at 12:42 am
@Data Analyst:
Provide us more details. If you take time to craft your question well, you have more chances of correct answer.
What is the structure of the two tables and what...
======================================
Blog: www.irohitable.com
April 22, 2012 at 10:56 pm
Ok. That's good.
======================================
Blog: www.irohitable.com
April 21, 2012 at 4:56 am
Each forum has its own plus and minus. Stack Overflow is not dedicated to SQL Server but a common platform to ask any type of questions.
Any forum answer is not...
======================================
Blog: www.irohitable.com
April 21, 2012 at 4:36 am
The person asking the question will come to know whether the answer is correct or not by trying out and seeing the output. This is applicable to forums where the...
======================================
Blog: www.irohitable.com
April 21, 2012 at 4:01 am
Probably something like this:
DECLARE @Query1 Varchar(1000)
DECLARE @Query2 Varchar(1000)
DECLARE @FinalQuery Varchar(max)
SET @Query1 = 'SELECT * FROM Employees A'
SET @Query2 = 'SELECT EmpDept, EmpID FROM EmpDepartments'
SET @FinalQuery = @Query1 + ' LEFT...
======================================
Blog: www.irohitable.com
April 19, 2012 at 11:30 am
Viewing 15 posts - 1 through 15 (of 17 total)