Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 querystring

Author  Topic 

CoolMoon2011
Starting Member

31 Posts

Posted - 2011-10-07 : 15:11:58
Sorry. It is hard to descirble part of my problem since I am not very clear about the querystring function. I need do some other reserch about it... Anyway, I appreciated for your attention.

Have a wonderful weekend for your all!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-10-07 : 16:15:57
I don't think your post is clear enough. What is it currently returning? It's hard for us to help without the DDL to test out on our side.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

CoolMoon2011
Starting Member

31 Posts

Posted - 2011-10-07 : 16:37:41
Currently it builds a query as a string, and then uses the exec command to execute the string (where it says exec (@execstring1 + @execstring2 +@execstring3)). It does that for 3 different queries, using 2 tables (monthlyvalfile_XXXXXX and tbl_vmf_check09_XXXXXXXX)

I would like to make it so that those two tables are read into staging tables in the database, and then the large queries select from the staging tables instead.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-10-07 : 16:46:34
You're going to need to really draw this out for us as I can't figure out what you want based upon what you've written.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jassi.singh
Posting Yak Master

122 Posts

Posted - 2011-10-08 : 09:32:11
Hi,

Please post your querie i.e. queire after making print statement before exec statement i.e. print @execstring1 + @execstring2 + @execstring3. We will need entire queire to solve your problem

Please mark answer as accepted if it helped you.

Thanks,
Jassi Singh
Go to Top of Page
   

- Advertisement -