 




<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Answers &#187; SQL Server development</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/tag/sql-server-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers</link>
	<description></description>
	<lastBuildDate>Sat, 25 May 2013 06:08:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Selecting Field Defined as L in SQL Server</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/selecting-field-defined-as-l/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/selecting-field-defined-as-l/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 19:06:21 +0000</pubDate>
		<dc:creator>Canuhp</dc:creator>
				<category><![CDATA[Date convert]]></category>
		<category><![CDATA[Embedded SQL]]></category>
		<category><![CDATA[Field Defined L]]></category>
		<category><![CDATA[SQL Server development]]></category>
		<category><![CDATA[V6R1]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I am building 4 part SQL select across 4 files using union alls. All 4 files have a date field which is one of the fields I am selecting. My problem is that on one file the date field is defined as L type where the other three files have a date field defined as [...]]]></description>
				<content:encoded><![CDATA[<p>I am building 4 part SQL select across 4 files using union alls. All 4 files have a date field which is one of the fields I am selecting. My problem is that on one file the date field is defined as L type where the other three files have a date field defined as 8S 0. Since the field I am selecting into has to be compatible across all 4 files and L data type is not an option in RPG&#8230;.  How can I define or convert this L field so that it will pull it in to the D data type field I currently have defined? Or how can I define the field I am fetching into so that it will be compatible across all 4 files?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/selecting-field-defined-as-l/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SQL Server 2008 Code to find fields containing similar text</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/code-to-find-fields-containing-similar-text/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/code-to-find-fields-containing-similar-text/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 15:37:05 +0000</pubDate>
		<dc:creator>Davewaltonuk</dc:creator>
				<category><![CDATA[SQL commands]]></category>
		<category><![CDATA[SQL Fields]]></category>
		<category><![CDATA[SQL Server 2008 administration]]></category>
		<category><![CDATA[SQL Server development]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I want to find fields that may be the same in some parts but not 100% identical For example Field 1 Has the word &#8220;Smith&#8221; Field 2 has &#8220;Smith AB&#8221; in it Is there any code i can write to find these, without writing code for every single name I am using SQL server 2008 [...]]]></description>
				<content:encoded><![CDATA[<p>I want to find fields that may be the same in some parts but not 100% identical <br/><br/> For example <br/><br/> Field 1 Has the word &#8220;Smith&#8221; <br/><br/> Field 2 has &#8220;Smith AB&#8221; in it <br/><br/> Is there any code i can write to find these, without writing code for every single name I am using SQL server 2008 Thanking you in advance<br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/code-to-find-fields-containing-similar-text/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>composite WHERE condition in SQL Server</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/composite-where-condition/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/composite-where-condition/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 14:42:45 +0000</pubDate>
		<dc:creator>MarcW</dc:creator>
				<category><![CDATA[SQL Server development]]></category>
		<category><![CDATA[SQL Server tables]]></category>
		<category><![CDATA[WHERE condition]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[In Oracle, I can do: Select * from table where field1 &#124;&#124; field2 in (&#8217;01XX&#8217;,&#8217;02YY&#8217;,&#8217;03ZZ&#8217;) ; Where field1 has values of 01,02,03 and field2 has values of XX,YY,ZZ etc Can I do the same thing in SQL Server, or do I need define some derived fields to get the same effect?]]></description>
				<content:encoded><![CDATA[<p>In Oracle, I can do: Select * from table where field1 || field2 in (&#8217;01XX&#8217;,&#8217;02YY&#8217;,&#8217;03ZZ&#8217;) ; Where field1 has values of 01,02,03 and field2 has values of XX,YY,ZZ etc Can I do the same thing in SQL Server, or do I need define some derived fields to get the same effect?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/composite-where-condition/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>comparing variable to a field with comma-separated values</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/comparing-variable-to-a-field-with-comma-separated-values/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/comparing-variable-to-a-field-with-comma-separated-values/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 14:00:37 +0000</pubDate>
		<dc:creator>Caruncles</dc:creator>
				<category><![CDATA[Comma Separated Values]]></category>
		<category><![CDATA[SQL Server 2000]]></category>
		<category><![CDATA[SQL Server development]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA["m trying to compare a variable (@item) to a field which has multiple item numbers separated by commas. I've used "LIKE" and "IN" to no avail. I've also tried appending wildcard characters to the variable (@item2), which also hasn't worked. Full-text indexing is not activated on the DB (SQL Server 2000), so I can't use [...]]]></description>
				<content:encoded><![CDATA[<pre>"m trying to compare a variable (@item) to a field which has multiple item numbers separated by commas. I've used "LIKE" and "IN" to no avail. I've also tried appending wildcard characters to the variable (@item2), which also hasn't worked. Full-text indexing is not activated on the DB (SQL Server 2000), so I can't use "CONTAINS". So, in the code below, I"m trying to compare @item which may look like "0282" to ItemString which may look like "0004,0089,0282". ItemString is varchar(255). If ItemString only has one item number in it, it will work using "IN". Any takers? CREATE PROCEDURE dbo.pGetOrderLotData @order char(8), @item char(5), @package char(20) output, @sodship char(30) output, @soistring varchar(60) output, @soqstring varchar(60) output, @item2 varchar(7) output AS set nocount on -- DECLARE @item2 varchar(6) SET @item2 = '%' + @item + '%' Drop Table tCLsearchorder1 Create Table tCLsearchorder1 (sopackage char(8), soorder char(8), sodateship datetime, soitemstring varchar(60), soqtystring varchar(60)) Select @order = OrderNumber, @package = PackageNumber, @sodship = DateShipped, @soistring = ItemString, @soqstring = QuantityString From tblPackage Where OrderNumber = @order AND @item2 LIKE ItemString -- may have to use shipdate instead of @item --SELECT DATEPART(mm, @sodship) + "/" + DATEPART(dd, @sodship) + "/" + DATEPART(yyyy, @sodship) AS '@sodship' IF @package IS NULL Begin Set @package = 'Invalid Order#!' GOTO nomatch End Else Insert INTO tCLsearchorder1 (sopackage, soorder, sodateship, soitemstring, soqtystring) VALUES (@package, @order, @sodship, @soistring, @soqstring) nomatch: GO </pre>
<p><br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/comparing-variable-to-a-field-with-comma-separated-values/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Find exact point where SQL Server 2000 job fails</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/find-exact-point-where-sql-server-2k-job-fails/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/find-exact-point-where-sql-server-2k-job-fails/#comments</comments>
		<pubDate>Wed, 27 May 2009 08:21:00 +0000</pubDate>
		<dc:creator>fbellos</dc:creator>
				<category><![CDATA[SQL Server 2000]]></category>
		<category><![CDATA[SQL Server development]]></category>
		<category><![CDATA[SQL Server error messages]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I am running an SQL Server Job, that executes a stored procedure with about 900 commands (mostly insert commands). The job was working OK, but suddenly fails, due to erroneous data (error message : overflow in converting numeric data to dadatype numeric !!). How can I find the exact point (command) where the job fails [...]]]></description>
				<content:encoded><![CDATA[<p>I am running an SQL Server Job, that executes a stored procedure with about 900 commands (mostly insert commands).<br />
The job was working OK, but suddenly fails, due to erroneous data (error message : overflow in converting numeric data to dadatype numeric !!).<br />
How can I find the exact point (command) where the job fails ? (SQl Server error description is not very useful).</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/find-exact-point-where-sql-server-2k-job-fails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Purpose of creating SQL Server stored procedures at run time</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/purpose-of-creating-stored-procedures-at-run-time/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/purpose-of-creating-stored-procedures-at-run-time/#comments</comments>
		<pubDate>Wed, 27 May 2009 07:33:25 +0000</pubDate>
		<dc:creator>Skothamasu</dc:creator>
				<category><![CDATA[RunTime]]></category>
		<category><![CDATA[SQL Server 2000]]></category>
		<category><![CDATA[SQL Server development]]></category>
		<category><![CDATA[SQL Server stored procedures]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hi Experts, I am a programmer in SQL. Please explain me the purpose of creating stored procedures during run time and it&#8217;s effects on performance and memory. Please provide me if there is any best alternative for this. Thanks in advance]]></description>
				<content:encoded><![CDATA[<p>Hi Experts,<br />
I am a programmer in SQL. Please explain me the purpose of creating stored procedures during run time and it&#8217;s effects on performance and memory. Please provide me if there is any best alternative for this.</p>
<p>Thanks in advance</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/purpose-of-creating-stored-procedures-at-run-time/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>What are the steps involved in copying the website from production to preproduction server</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/what-are-the-steps-involved-in-copying-the-website-from-production-to-preproduction-server/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/what-are-the-steps-involved-in-copying-the-website-from-production-to-preproduction-server/#comments</comments>
		<pubDate>Wed, 06 May 2009 11:10:02 +0000</pubDate>
		<dc:creator>Sangeeth</dc:creator>
				<category><![CDATA[IIS]]></category>
		<category><![CDATA[Production Servers]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server development]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[what are the steps involved in copying the website from production to preproduction server]]></description>
				<content:encoded><![CDATA[<p>what are the steps involved in copying the website from production to preproduction server</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/what-are-the-steps-involved-in-copying-the-website-from-production-to-preproduction-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can you force a user input in a SQL statement, then have the statement continue running</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/can-one-in-an-sql-statement-when-run-in-sql-force-a-user-input/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/can-one-in-an-sql-statement-when-run-in-sql-force-a-user-input/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 11:55:29 +0000</pubDate>
		<dc:creator>Bugsy</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server development]]></category>
		<category><![CDATA[SQL statements]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hi, Can one in an sql statement , when run in sql, force a user input to be entered and when entered, the sql continues to completing]]></description>
				<content:encoded><![CDATA[<p>Hi,  Can one in an sql statement , when run in sql, force a user input to be entered and when entered, the sql continues to completing</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/can-one-in-an-sql-statement-when-run-in-sql-force-a-user-input/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL to insert comma-delimited string value to table column</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/string-value-to-table-column/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/string-value-to-table-column/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 06:38:55 +0000</pubDate>
		<dc:creator>23121983</dc:creator>
				<category><![CDATA[Comma-delimited]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL queries]]></category>
		<category><![CDATA[SQL Server development]]></category>
		<category><![CDATA[SQL Server Query]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have string like &#8217;1,2,3,45,6,7,8&#8242; I want to insert each comma separated value in a table column&#8230;my output look like this: COLUMN 1 2 3 45 6 7 8]]></description>
				<content:encoded><![CDATA[<p>I have string like &#8217;1,2,3,45,6,7,8&#8242;</p>
<p>I want to insert each comma separated value in a table column&#8230;my output look like this:</p>
<p>COLUMN<br />
1<br />
2<br />
3<br />
45<br />
6<br />
7<br />
8</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/string-value-to-table-column/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Error while referencing external assembly in SQL Server 2005.</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/error-while-referencing-external-assembly-in-sql-server-2005/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/error-while-referencing-external-assembly-in-sql-server-2005/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 09:47:19 +0000</pubDate>
		<dc:creator>Batsa</dc:creator>
				<category><![CDATA[.NET Framework 3.5]]></category>
		<category><![CDATA[Database programming]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server development]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>
		<category><![CDATA[WCFServiceLibrary]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Sir, I created a dll (SqlWcfServiceLibrary1.dll) using .net frammework 2008. My code has a reference of another assemble (WcfServiceLibrary1.dll) also. I want to create assemble in sql and use that assemble in a procedure. I am getting error that &#8220;Error while referencing external assembly&#8220;. I am pasting all code that I used&#8230;. .cs page code [...]]]></description>
				<content:encoded><![CDATA[<p>Sir,</p>
<p>I created a dll (SqlWcfServiceLibrary1.dll) using .net frammework 2008. My code has a reference of another assemble (WcfServiceLibrary1.dll) also. I want to create assemble in sql and use that assemble in a procedure. </p>
<p>I am getting error that &#8220;<b>Error while referencing external assembly</b>&#8220;.</p>
<p>I am pasting all code that I used&#8230;.</p>
<p>.cs page code &#8211; </p>
<p>namespace SqlWcfServiceLibrary1<br />
{<br />
    public class SqlService1<br />
    {<br />
        void SendToSql(string message)<br />
        {<br />
            SqlMetaData[] table = new SqlMetaData[1];<br />
            table[0] = new SqlMetaData(&#8220;Message&#8221;, SqlDbType.VarChar, 1000);</p>
<p>            SqlDataRecord row = new SqlDataRecord(table);<br />
            row.SetValue(0, message);</p>
<p>            SqlPipe pipe = SqlContext.Pipe;<br />
            pipe.SendResultsStart(row);<br />
            pipe.SendResultsRow(row);<br />
            pipe.SendResultsEnd();<br />
        }</p>
<p>        public static void GetMessage(SqlString name)<br />
        {<br />
            Assembly assembly = LoadAssembly(&#8220;D:\\OutCast\\WcfServiceLibrary1\\WcfServiceLibrary1\\bin\\Debug\\WcfServiceLibrary1.dll&#8221;, true);</p>
<p>            Type type = LoadType(assembly, &#8220;WcfServiceLibrary1.Service1&#8243;, true);</p>
<p>            String message = &#8220;&#8221;;<br />
            using (ServiceHost host = new ServiceHost(type))<br />
            {<br />
                host.Open();<br />
                IService1 service1 = InitChannel();<br />
                message = service1.GetMessage(name.ToString());<br />
                host.Close();<br />
            }<br />
        }</p>
<p>        static IService1 InitChannel()<br />
        {<br />
            Uri address = new Uri(&#8220;net.tcp://localhost:8731/Design_Time_Addresses/WcfServiceLibrary1/Service1/&#8221;);</p>
<p>            ChannelFactory&lt;IService1&gt; factory = new ChannelFactory&lt;IService1&gt;(new NetTcpBinding(), new EndpointAddress(address));<br />
            return factory.CreateChannel();<br />
        }</p>
<p>        static Assembly LoadAssembly(String assemblyName, bool throwOnError)<br />
        {<br />
            Assembly assembly = null;</p>
<p>            try { assembly = Assembly.LoadFrom(assemblyName); }<br />
            catch { }</p>
<p>            if (assembly == null &#038;&#038; throwOnError)<br />
                throw new Exception(&#8220;Hello Sujeet, Error while referencing external assembly.\r\n \r\nAssembly &#8216;&#8221; + assemblyName + &#8220;&#8216; doesn&#8217;t exist.&#8221;);</p>
<p>            return assembly;<br />
        }</p>
<p>        static Type LoadType(Assembly assembly, String typeName, bool throwOnError)<br />
        {<br />
            Type type = null;</p>
<p>            try { type = assembly.GetType(typeName, false, true); }<br />
            catch { }</p>
<p>            if (type == null &#038;&#038; throwOnError)<br />
                throw new Exception(&#8220;Error while loading type.\r\n \r\nType &#8216;&#8221; + typeName + &#8220;&#8216; doesn&#8217;t exist.&#8221;);</p>
<p>            return type;<br />
        }<br />
    }</p>
<p>    [ServiceContract]<br />
    public interface IService1<br />
    {<br />
        [OperationContract]<br />
        string GetMessage(string name);<br />
    }<br />
}</p>
<p>using above code I created a dll and using it in sql.</p>
<p>SQL Code &#8211; </p>
<p>&#8211; create assembly<br />
CREATE ASSEMBLY SqlWcfServiceLibrary1 FROM<br />
 &#8216;D:\OutCast\SqlWcfServiceLibrary1\SqlWcfServiceLibrary1\bin\Debug\SqlWcfServiceLibrary1.dll&#8217;<br />
WITH PERMISSION_SET = EXTERNAL_ACCESS<br />
GO</p>
<p>&#8211;create procedure<br />
&#8211; external name is composed by <assembly name].[Namespace+type name].ProcedureName<br />
CREATE PROCEDURE GetMessage ( @name nvarchar(max) )<br />
AS EXTERNAL NAME SqlWcfServiceLibrary1.[SqlWcfServiceLibrary1.SqlService1].GetMessage</p>
<p>&#8211;Execute<br />
exec GetMessage &#8216;Sujeet&#8217;</p>
<p>I am able to create assemble, procedure but when I am EXECUTING procedure, it is giving error&#8230;..</p>
<p>Msg 6522, Level 16, State 1, Procedure GetMessage, Line 0<br />
A .NET Framework error occurred during execution of user defined routine or aggregate &#8216;GetMessage&#8217;:<br />
System.Exception: Hello Sujeet, Error while referencing external assembly.</p>
<p>Assembly &#8216;D:\OutCast\WcfServiceLibrary1\WcfServiceLibrary1\bin\Debug\WcfServiceLibrary1.dll&#8217; doesn&#8217;t exist.<br />
System.Exception:<br />
   at SqlWcfServiceLibrary1.SqlService1.LoadAssembly(String assemblyName, Boolean throwOnError)<br />
   at SqlWcfServiceLibrary1.SqlService1.GetMessage(SqlString name)</p>
<p>Please provide me solution on this.</p>
<p>Thanks in advance.<br />
Sujeet Batsa</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/error-while-referencing-external-assembly-in-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/10 queries in 0.017 seconds using memcached
Object Caching 913/916 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-25 07:01:13 -->