Click here to Skip to main content
15,902,275 members
Home / Discussions / Database
   

Database

 
GeneralRe: When it comes to database, I suck:( Pin
Muammar©9-Oct-08 10:56
Muammar©9-Oct-08 10:56 
GeneralRe: When it comes to database, I suck:( Pin
Wendelius9-Oct-08 11:01
mentorWendelius9-Oct-08 11:01 
AnswerRe: When it comes to database, I suck:( Pin
i.j.russell9-Oct-08 11:49
i.j.russell9-Oct-08 11:49 
AnswerRe: When it comes to database, I suck:( Pin
nelsonpaixao9-Oct-08 12:59
nelsonpaixao9-Oct-08 12:59 
GeneralRe: When it comes to database, I suck:( Pin
Muammar©10-Oct-08 0:40
Muammar©10-Oct-08 0:40 
QuestionPass Table Name to a function dynamically Pin
Mohammad Al Hoss8-Oct-08 22:01
Mohammad Al Hoss8-Oct-08 22:01 
AnswerRe: Pass Table Name to a function dynamically Pin
Ashfield8-Oct-08 22:57
Ashfield8-Oct-08 22:57 
AnswerRe: Pass Table Name to a function dynamically Pin
Mycroft Holmes9-Oct-08 16:15
professionalMycroft Holmes9-Oct-08 16:15 
I knew this would come up sooner or later.

SQL Server Central had an article (sorry no link) that used XML to pass the table and data to a function.
Stored proc expamle
Declare @X xml<br />
Set @X = (SELECT RegionID, sum(Amount) Amount <br />
						FROM FactTran<br />
						where PeriodID = @PeriodID<br />
							and WFGroupID = @WFGroupID<br />
							and TranTypeID = @TranTypeID<br />
							and ISNULL(BUID,7) = 7<br />
						Group By <br />
							RegionID<br />
						 For XML Raw ('RegionID'), ROOT('Regions'))


Function example
LEFT OUTER JOIN (SELECT <br />
                                    x.item.value('@RegionID[1]', 'VARCHAR(100)') AS RegionID,<br />
                                    x.item.value('@Amount[1]', 'Decimal(30,2)') AS Amount<br />
                                    FROM @x.nodes('//Regions/RegionID') AS x(item)) R on R.RegionID = A.RegionID<br />


These are my usage and may give you some idea if you cannot find the article.


Never underestimate the power of human stupidity
RAH

Questionerror installing SQL Server 2008 Express Pin
Jassim Rahma8-Oct-08 21:21
Jassim Rahma8-Oct-08 21:21 
AnswerRe: error installing SQL Server 2008 Express Pin
Frank Kerrigan8-Oct-08 21:59
Frank Kerrigan8-Oct-08 21:59 
GeneralRe: error installing SQL Server 2008 Express Pin
Jassim Rahma8-Oct-08 22:10
Jassim Rahma8-Oct-08 22:10 
GeneralRe: error installing SQL Server 2008 Express Pin
Jassim Rahma8-Oct-08 22:37
Jassim Rahma8-Oct-08 22:37 
Questionwhat is @identity in sql server 2005 Pin
Roney8-Oct-08 20:55
Roney8-Oct-08 20:55 
AnswerRe: what is @identity in sql server 2005 Pin
Ashfield8-Oct-08 21:10
Ashfield8-Oct-08 21:10 
AnswerRe: what is @identity in sql server 2005 Pin
Frank Kerrigan8-Oct-08 22:03
Frank Kerrigan8-Oct-08 22:03 
GeneralRe: what is @identity in sql server 2005 [modified] Pin
Roney9-Oct-08 0:25
Roney9-Oct-08 0:25 
Questionsp_fulltext_catalog [modified] Pin
dangquoctrang8-Oct-08 20:23
dangquoctrang8-Oct-08 20:23 
AnswerRe: sp_fulltext_catalog Pin
Ashfield8-Oct-08 21:08
Ashfield8-Oct-08 21:08 
QuestionSpecial Characters [modified] Pin
Dushan1238-Oct-08 19:03
Dushan1238-Oct-08 19:03 
AnswerRe: Special Characters Pin
Parwej Ahamad8-Oct-08 19:19
professionalParwej Ahamad8-Oct-08 19:19 
QuestionOverride Stored Connection String Pin
chrisace8-Oct-08 15:22
chrisace8-Oct-08 15:22 
AnswerRe: Override Stored Connection String Pin
Mycroft Holmes8-Oct-08 21:34
professionalMycroft Holmes8-Oct-08 21:34 
AnswerRe: Override Stored Connection String Pin
Frank Kerrigan8-Oct-08 22:05
Frank Kerrigan8-Oct-08 22:05 
GeneralRe: Override Stored Connection String Pin
chrisace9-Oct-08 12:42
chrisace9-Oct-08 12:42 
Questionhow can we restore database if i have DBscripts Pin
Aslesh8-Oct-08 5:36
Aslesh8-Oct-08 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.