Ir a contenido


MENSAJE DE BIENVENIDA Foro vínculado con Twitter, más info aquí.

“El secreto para progresar es empezar por algún lugar. El secreto para empezar por algún lugar es fragmentar tus complejas y abrumadoras tareas de tal manera que queden convertidas en pequeñas tareas que puedas realizar y entonces simplemente comenzar por la primera.” - Mark Twain

Foto

Consultar Varias Tablas Dinamicamente


  • Please log in to reply
No replies to this topic

#1 Alberto Dominguez

Alberto Dominguez

    Gurú

  • Administradores
  • 1.059 Mensajes:
  • LocationMadrid

Escrito 04 abril 2011 - 19:52

Dejo ejemplo de como hacer un SELECT con UNION ALL a varias tablas cuyo nombre comienza por 'A$':

DECLARE @TVP AS TABLE
  (                     
        [ID] int IDENTITY (1,1) NOT NULL,                
        [NOMBRETABLA] [nvarchar](50) NULL
  )
DECLARE @CUENTA AS int
  
INSERT @TVP
SELECT Name FROM sys.tables WHERE name LIKE 'A$%' 

SELECT @CUENTA=COUNT(NOMBRETABLA) FROM @TVP

DECLARE @i int
DECLARE @N nvarchar(50)
DECLARE @SQLQuery nvarchar(MAX)
SET @SQLQuery = ''  

SET @i=1
WHILE (@i <= @CUENTA)
BEGIN
  SELECT @N=NombreTabla FROM @TVP WHERE ID=@i
  IF ((@CUENTA-@i) = 0)
	SET @SQLQuery=@SQLQuery+'SELECT * FROM '+@N
  ELSE
    SET @SQLQuery=@SQLQuery+'SELECT * FROM '+@N+' UNION ALL ' 
  SET @i=@i+1
END

EXEC (@SQLQuery)

Saludos,

Alberto Dominguez

Enterprise Architect y Trainer
MCT, MCPD, MCITP, MCITP Dynamics, MCSE, MCSA, MCTS, MCP...
ITIL V3 Foundation Qualification in IT Service Management
Imagen enviadaPerfil Profesional Imagen enviadaTwitter
Imagen enviadaImagen enviadaImagen enviadaImagen enviada

#2 porsercok

porsercok

    Experto

  • Miembros
  • PipPipPipPip
  • 442 Mensajes:
  • LocationParis

Escrito 11 julio 2017 - 15:47

iShowU Instant Advanced 1.1.9 MAC OS X - ReleaseLoad

DOWNLOAD
Jay Hardway - Golden Pineapple
Sabrina Secrets Of A Teenage Witch
Trahison Stockholm


OglД…daj

Down - Marian Hill
Project A Part 2
ASIAN KUNG-FU GENERATION - Rewrite



SanLuis - Mis Ilusiones ft Voz Veis y Apache Video Oficial [Isohunt.to]

The Royals 27
Lady Jewelpet
Niall Horan
Sahara Cansados de ser el chivo expiatorio de su comunidad, Ajar una serpiente y su amigo Pitt, el escorpion, deciden probar suerte en un cercano oasis habitado por la alta burguesia del desierto del Sahara y volver a encontrar a Eva, una hermosa serpiente de la que se enamoro Ajar locamente. Este es el comienzo de divertidas aventuras que les conduciran ...


Dragon Ball Super

Mothers Days 1980 UNRATED BRRip XviD MP3-RARBG
41488 / 86
Scooby Doo! Abracadabra-Doo (Movie)
Award Winning
Welcome 2 Karachi (2015) DVDScr Hindi Full HD Movie Watch Online Free


True Blood

Tenkai Knight
Dracula de Bram Stoker
virtual dj
When Love Walked In


#3 porsercok

porsercok

    Experto

  • Miembros
  • PipPipPipPip
  • 442 Mensajes:
  • LocationParis

Escrito 11 julio 2017 - 16:49

Soul Nomad And The World Eaters (PS2) 2007

Tom and Jerry: The Fast and the Furry (2005) Online
The Imitation Game "poster":"%2f%73%74%61%74%69%63%2f%39%30%2f%33%35%2f%54%68%65%5f%49%6d%69%74%61%74%69%6f%6e%5f%47%61%6d%65%2d%36%39%33%30%35%38%2e%4a%50%45%47","link":"%2f%46%69%6c%6d%2f%54%68%65%2d%49%6d%69%74%61%74%69%6f%6e%2d%47%61%6d%65","name":"%3c%73%70%61%6e%20%69%74%65%6d%70%72%6f%70%3d%22%6e%61%6d%65%22%3e%54%68%65%20%49%6d%69%74%61%74%69%6f%6e%20%47%61%6d%65%20%28%3c%73%70%61%6e%20%69%74%65%6d%70%72%6f%70%3d%22%63%6f%70%79%72%69%67%68%74%59%65%61%72%22%3e%32%30%31%34%3c%2f%73%70%61%6e%3e%29%3c%2f%73%70%61%6e%3e","type":"%46%69%6c%6d","description":"%44%75%72%69%6e%67%20%57%6f%72%6c%64%20%57%61%72%20%49%49%2c%20%6d%61%74%68%65%6d%61%74%69%63%69%61%6e%20%41%6c%61%6e%20%54%75%72%69%6e%67%20%74%72%69%65%73%20%74%6f%20%63%72%61%63%6b%20%74%68%65%20%65%6e%69%67%6d%61%20%63%6f%64%65%20%77%69%74%68%20%68%65%6c%70%20%66%72%6f%6d%20%66%65%6c%6c%6f%77%20%6d%61%74%68%65%6d%61%74%69%63%69%61%6e%73%2e","genre":"%42%69%6f%67%72%61%70%68%79%2c%44%72%61%6d%61%2c%54%68%72%69%6c%6c%65%72","genrePhrase":"%47%65%6e%72%65"
Read more
Игорь Петренко


BitLord.com

The Mummy
Детская литература
18-летняя девственница / 18-Year-Old Virgin (2009) HDRip-AVC от ImperiaFilm | P



Great Battles – Medieval (X-BOX360) 2010

Detective Conan Stagione 10 Streaming ITA – (2009)
Linkedin
CS Captain Underpants: The First Epic Movie
Керри Вашингтон
mkv Torrents


WiFi Hacking for Beginners Learn Hacking by Hacking WiFi networks (Penetratio...

Una Historia de Venganza BluRay MicroHD
Resident Evil Cap?tulo Final.. TS-Screener
Watch The
Box Set House Hunt


Zoo S03E02 720p HDTV X264-DIMENSION[eztv] mkv

Season 3 Episode 9 Heroin Robin Hood
Arrival (2016) Full Movie Online HD
(2012, Budenzauber)
Madhuri Dixit
Radin (2016) Manual de un tacano


#4 porsercok

porsercok

    Experto

  • Miembros
  • PipPipPipPip
  • 442 Mensajes:
  • LocationParis

Escrito 11 julio 2017 - 16:53

Grenadier

- Americas Got Talent S12E03 480p x264-mSD
Season 3 Episode 6 TBA
Watch El
Derniere page


Astrophysics for People in a Hurry - Neil deGrasse Tyson

His and Her Circumstances
Download
JSS season 06 episode 02



Mission Pays Basque French Film Torrent BRrip 720p

3. Sezon 5. Bolum
Return to Oz season 02 episode 01
Dragon Ball Z: La resurreccion de F (BR-SCREENER)
La Foret


Drama, Sci-Fi, Thriller Rating: 5.3 MPAA Rating: PG-13 Budget: $18,000,000 Gross: $31,197,844 A woman lands a dream job at a powerful tech company called the Circle, only to uncover an agenda that will affect the lives of all of humanity. Quality: 1080p WEBRip (High)Category: Movies

Web Therapy (season 1, 2, 3, 4)
Rings (2017)


PS2 Adulto

Love Island, Season: 2, Episode: 44
A Gathering St season 03 episode 00


#5 porsercok

porsercok

    Experto

  • Miembros
  • PipPipPipPip
  • 442 Mensajes:
  • LocationParis

Escrito 11 julio 2017 - 17:00

Angebote

Privacy Policy
WentworthS05E10
Rob Corddry
Marvels Agent Carter HDTV 720p AC3 5.1


BitLord.com

Natures Miracle Orphans 1
Assistir ? Episodio 06
Verbrechen nach Ferdinand von Schirach
LOTFI EL ABDELLI MADE IN TUNISIA COMPLET



Dios Por DarГ­o Sztajnszrajber Mp3

Drake Josh
Tabi Machi Late Show


Season 3 Episode 16 Most Outrageous Celebrity Patients

Orange Is Th...S05E01
AuroraVid
Last Post
Oznacz jako przeczytany
Popular Episodes


IObit Malware Fighter Pro 4.5.0.3457 Multilingual+Activat [Isohunt.to]

Beauty and the Beast (2017)
Riviste 17 05 17
Johnny Hallyday-Allume le feu-Stade De France-3cd-...(A)
Nocturnal Activity
The Get Down


#6 porsercok

porsercok

    Experto

  • Miembros
  • PipPipPipPip
  • 442 Mensajes:
  • LocationParis

Escrito 11 julio 2017 - 17:04

BRAZZERS - BTIS - Jessica Jaymes R84 XXX PORN .mp4

Venezüella
Vivir De Noche BluRayRip AC3 5.1
The Invincible Iron Man (Movie)


The White Princess

Alternatif
TheVideo
Sig Hansen



Download

Katie Cassidy
Lobos sucios (2015) hd pelicula completa


[Mashin] [161130] PS4PS Vitaг‚Ігѓјгѓ гЂЊAKIBA'S BEATгЂЌдё»йЎЊж­ЊгЂЊagainгЂЌпјЏClariS [320K+BK]

Hyena Road
Comedie Musicales
Daddy 2017 Movie Trailer mp4 song
Futurama
Lila kodben


Mega-Bauwerke

Most Updated Movies
Coke Studio Allan Faqeer Mp3
(2004)Rammstein - Reise, Reise
The Haves And The Have Nots (season 1-5)
Nightwish


#7 porsercok

porsercok

    Experto

  • Miembros
  • PipPipPipPip
  • 442 Mensajes:
  • LocationParis

Escrito 11 julio 2017 - 17:30

Toni Collette,

Farsi/Persian Power Rangers 2017.ALL.WEB-DL
Правила оформления раздач в разделе Игр для PC
Czterej pancerni i pi..
A Fond 2016 Truefrench 720p x264 AAC PIXEL(A)
Clem Bevans


Scream 8.5

The Late Late Show with James Corden
Joan Sebastian Soy Un Idiota LETRA Mp3
Robots (2005) MULTi-VF2 Blu-ray Remux 1080p AVC DT...(N) (A)
Reckless



ver Baby Driver 2017 megashare lГ­nea gratis

(2015-2017) WEB-DLRip 720p от ExKinoRay
Tucheezbadihaimast
Randy Cheveldave


勇闯天涯

Clipped US
Criminalit
The Wizard of Lies 2017 BluRay MicroHD
Supah Ninjas


[H-Manga] [Okayusan] Choukyou Girl Collection (Set) - [おかゆさん] иЄїж•...

SNIS-942 2017-06-12 Click: 146 ?
ROMANCE
Riese: Kingdom Falling
Shipwrecks, Monsters, and Mysteries of the Great Lakes





0 usuarios están leyendo este tema

0 miembro/s, 0 invitado/s, 0 usuario/s anónimo/s