<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlserver.ro/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Intrebari</title><link>http://sqlserver.ro/forums/14/ShowForum.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Re: relationare intre tabele in SQL</title><link>http://sqlserver.ro/forums/thread/4744.aspx</link><pubDate>Wed, 23 Apr 2008 12:52:22 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:4744</guid><dc:creator>B_gd_n[ ]Sahlean</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/4744.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=4744</wfw:commentRss><description>Merge si in Access dar trebuie sa executi cele 2 interogari CREATE TABLE separat si fara GO.&lt;br&gt;</description></item><item><title>Re: relationare intre tabele in SQL</title><link>http://sqlserver.ro/forums/thread/4743.aspx</link><pubDate>Wed, 23 Apr 2008 12:43:13 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:4743</guid><dc:creator>Michella</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/4743.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=4743</wfw:commentRss><description>ultima varianta e mai pe intelesul meu. o ultima intrebare totusi. merge pe SQL-ul din Acces2003? eu pe asta il folosesc.</description></item><item><title>Re: relationare intre tabele in SQL</title><link>http://sqlserver.ro/forums/thread/4732.aspx</link><pubDate>Tue, 22 Apr 2008 15:14:02 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:4732</guid><dc:creator>B_gd_n[ ]Sahlean</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/4732.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=4732</wfw:commentRss><description>Sau în momentul în care se creează tabelele:&lt;br&gt;Tabela1(&lt;b&gt;cp11&lt;/b&gt; - &lt;i&gt;cheie primară&lt;/i&gt;, câmp12, câmp13)&lt;br&gt;Tabela2(cp21 - cheie primară, camp22, câmp23, &lt;b&gt;cp11&lt;/b&gt; - &lt;i&gt;cheie externă&lt;/i&gt;)&lt;br&gt;&lt;br&gt;În concluzie avem o legătură de la Tabela1 la Tabela2 dată de corespondenţa dintre cheia externă &lt;b&gt;&lt;u&gt;Tabel2&lt;/u&gt;.cp11&lt;/b&gt; şi cheia primară &lt;b&gt;&lt;u&gt;Tabel1&lt;/u&gt;.cp11&lt;/b&gt; !&lt;br&gt;&lt;br&gt;Scriptul pentru crearea tabelei care conţine cheia primară:&lt;br&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;CREATE&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;TABLE&lt;/span&gt; Tabela1&lt;br&gt;(&lt;br&gt;    cp11 &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;INT&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;PRIMARY&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;KEY&lt;/span&gt;,&lt;br&gt;    camp11 &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;INT&lt;/span&gt;,&lt;br&gt;    camp13 &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;INT&lt;/span&gt;&lt;br&gt;);&lt;br&gt;GO&lt;/span&gt;&lt;br&gt;&lt;br&gt;Scriptul pentru crearea tabelei care conţine cheia externă:&lt;br&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;CREATE&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;TABLE&lt;/span&gt; Tabela2&lt;br&gt;(&lt;br&gt;cp21 &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;INT&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;PRIMARY&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;KEY&lt;/span&gt;,&lt;br&gt;camp21 &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;INT&lt;/span&gt;,&lt;br&gt;camp23 &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;INT&lt;/span&gt;,&lt;br&gt;&lt;/span&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;cp11 &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;INT&lt;/span&gt; &lt;span style="color:Silver;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;NOT&lt;/span&gt; &lt;span style="color:Silver;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;NULL&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;REFERENCES&lt;/span&gt; Tabela1(cp11)&lt;/span&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;br&gt;);&lt;br&gt;GO&lt;br&gt;&lt;br&gt;&lt;/span&gt;Linia &lt;br&gt;&lt;font color="#0000ff"&gt;&lt;b&gt;cp11&lt;/b&gt;&lt;/font&gt; INT NOT NULL REFERENCES &lt;font color="#ff0000"&gt;&lt;b&gt;Tabela1&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff0000"&gt;&lt;b&gt;cp11&lt;/b&gt;&lt;/font&gt;)&lt;br&gt;defineşte legătura de la câmpul &lt;font color="#0000ff"&gt;&lt;b&gt;cp11&lt;/b&gt;&lt;/font&gt; (cheia externă din Tabela2)&amp;nbsp; la câmpul &lt;font color="#ff0000"&gt;&lt;b&gt;cp11 &lt;/b&gt;&lt;/font&gt;(cheie primară din &lt;font color="#ff0000"&gt;&lt;b&gt;Tabela1&lt;/b&gt;&lt;/font&gt;).&lt;br&gt;&lt;br&gt;Cheile pot fi compuse.&lt;br&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;/span&gt;</description></item><item><title>Re: relationare intre tabele in SQL</title><link>http://sqlserver.ro/forums/thread/4731.aspx</link><pubDate>Tue, 22 Apr 2008 13:58:18 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:4731</guid><dc:creator>Gherry</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/4731.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=4731</wfw:commentRss><description>cam asa ar fi in SQL Server 2005&lt;br&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;span style="color:Teal;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/&lt;/span&gt;&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;BEGIN&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;TRANSACTION&lt;/span&gt;&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;SET&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;QUOTED_IDENTIFIER&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ON&lt;/span&gt;&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;SET&lt;/span&gt; ARITHABORT &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ON&lt;/span&gt;&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;SET&lt;/span&gt; NUMERIC_ROUNDABORT &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;OFF&lt;/span&gt;&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;SET&lt;/span&gt; CONCAT_NULL_YIELDS_NULL &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ON&lt;/span&gt;&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;SET&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ANSI_NULLS&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ON&lt;/span&gt;&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;SET&lt;/span&gt; ANSI_PADDING &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ON&lt;/span&gt;&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;SET&lt;/span&gt; ANSI_WARNINGS &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ON&lt;/span&gt;&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;COMMIT&lt;/span&gt;&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;BEGIN&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;TRANSACTION&lt;/span&gt;&lt;br&gt;GO&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;COMMIT&lt;/span&gt;&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;BEGIN&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;TRANSACTION&lt;/span&gt;&lt;br&gt;GO&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ALTER&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;TABLE&lt;/span&gt; dbo.Table1 &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ADD&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;CONSTRAINT&lt;/span&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;FK_Table1_Table2 &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;FOREIGN&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;KEY&lt;/span&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;(&lt;br&gt;&amp;nbsp;&amp;nbsp;t2_id&lt;br&gt;&amp;nbsp;&amp;nbsp;) &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;REFERENCES&lt;/span&gt; dbo.Table2&lt;br&gt;&amp;nbsp;&amp;nbsp;(&lt;br&gt;&amp;nbsp;&amp;nbsp;id_t2&lt;br&gt;&amp;nbsp;&amp;nbsp;) &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ON&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;UPDATE&lt;/span&gt;  NO ACTION &lt;br&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ON&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;DELETE&lt;/span&gt;  NO ACTION &lt;br&gt;&amp;nbsp;&amp;nbsp;&lt;br&gt;GO&lt;br&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;COMMIT&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;Am tabelul &lt;u&gt;&lt;b&gt;Table1 &lt;/b&gt;&lt;/u&gt;cu chiea primara &lt;u&gt;&lt;b&gt;id_t1 (int)&lt;/b&gt;&lt;/u&gt; si coloana &lt;u&gt;&lt;b&gt;t2_id - nchar(10)&lt;/b&gt;&lt;/u&gt; si tabelul &lt;u&gt;&lt;b&gt;Table2 &lt;/b&gt;&lt;/u&gt;care are ca si cheie primara coloana &lt;u&gt;&lt;b&gt;id_t2 - nchar(10)&lt;/b&gt;&lt;/u&gt; iar scriptul de mai sus face &lt;b&gt;legatura intre id_t2 si t2_id&lt;/b&gt; . &lt;br&gt;&lt;br&gt;Eu am obtinut scriptul facand legatura intre tabele pe diagrama si folosind optiunea "&lt;b&gt;Generate Change Script&lt;/b&gt;" din meniul "&lt;b&gt;Table Designer&lt;/b&gt;" &lt;b&gt;&lt;u&gt;inainte sa dau save&lt;/u&gt;&lt;/b&gt;&lt;br&gt;</description></item><item><title>Re: relationare intre tabele in SQL</title><link>http://sqlserver.ro/forums/thread/4729.aspx</link><pubDate>Tue, 22 Apr 2008 13:19:14 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:4729</guid><dc:creator>Michella</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/4729.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=4729</wfw:commentRss><description>sa fiu sincera nu prea am inteles mare lucru. se poate un exemplu concret sau link-ul de la asta?</description></item><item><title>Re: relationare intre tabele in SQL</title><link>http://sqlserver.ro/forums/thread/4698.aspx</link><pubDate>Mon, 21 Apr 2008 19:40:48 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:4698</guid><dc:creator>ggciubuc</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/4698.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=4698</wfw:commentRss><description>In script se poate folosi ALTER TABLE table_name cu&amp;nbsp; , citez din Books Online "&amp;lt; column_constraint &amp;gt; ::= &lt;BR&gt;&amp;nbsp;&amp;nbsp; [ NULL | NOT NULL ] &lt;BR&gt;&amp;nbsp;&amp;nbsp; [ CONSTRAINT &lt;I&gt;constraint_name&lt;/I&gt; ] &lt;BR&gt;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | { PRIMARY KEY | UNIQUE } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | REFERENCES &lt;I&gt;ref_table&lt;/I&gt; [ (&lt;I&gt;ref_column&lt;/I&gt;) ] &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ ON DELETE { CASCADE | NO ACTION | SET DEFAULT |SET NULL } ] &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ ON UPDATE { CASCADE | NO ACTION | SET DEFAULT |SET NULL } ] "&lt;BR&gt;&lt;BR&gt;altfel, daca va referiti la aspectul crearii automate a relatiilor intre tabele se poate folosi "Database Diagrams" unde legati cheile potrivite dintre tabele.</description></item><item><title>relationare intre tabele in SQL</title><link>http://sqlserver.ro/forums/thread/4697.aspx</link><pubDate>Mon, 21 Apr 2008 16:03:43 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:4697</guid><dc:creator>Michella</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/4697.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=14&amp;PostID=4697</wfw:commentRss><description>exista vreun script in SQL care sa faca asa ceva?</description></item></channel></rss>