I Couldn't Find TRIM Function
Oct 18, 2006Hi,
I found rtrim and ltrim functions, but I didn't find trim, so should I use rtrim(ltrim(' a ' ))? Am I right?
cheers,
Alessandro Camargo
Hi,
I found rtrim and ltrim functions, but I didn't find trim, so should I use rtrim(ltrim(' a ' ))? Am I right?
cheers,
Alessandro Camargo
Hi,
I have just installed sql server 2005 enterprise edition. I am totally new to sqlserver. I want to create a database in sql server and access that from my VB.net application. I couldn't find sql server management studio to create a database. can somebody help me with this...
thanks,
Leela
Because forum HTML codes are OFF I had to put my question between code tags. Because to tell my question I had to show the database tables and wanted output. I succeeded retrieving the datas but combining these three tables together with SQL or ASP codes is too complex. Please help me determining the table. As I am subscribed to this forum you can ask me anything about my question. I can clarify my question if you need. Your answers will be replied immediately.
(To see my question pls save the codes below as htm file or see it with a wysiwyg editor.)
<p><b><font size="2">tbl_PRODUCTIONS</font></b></p>
<table border="1" width="971" id="table1">
<tr>
<td height="19" width="54"><b><font size="2">fld_DATE</font></b></td>
<td width="161" height="19"><b><font size="2">fld_PRODUCER_UNITCODE</font></b></td>
<td height="19" width="124"><b><font size="2">fld_PRODUCT_CODE</font></b></td>
<td height="19" width="222"><b><font size="2">fld_DAILY_PRODUCTION_PROGRAM</font></b></td>
<td height="19" width="176"><b><font size="2">fld_PRODUCTION_QUANTITY</font></b></td>
<td height="19" width="136"><b><font size="2">fld_STOCK_QUANTITY</font></b></td>
<td height="19" width="52"><b><font size="2">fld_SELL</font></b></td>
</tr>
<tr>
<td width="54" >......</td>
<td width="161" >....</td>
<td width="124">....</td>
<td width="222">....</td>
<td width="176">....</td>
<td width="136">.....</td>
<td width="52">....</td>
</tr>
<tr>
<td width="54" ><font size="2">18.01.2007</font></td>
<td width="161" ><font size="2">IST</font></td>
<td width="124"><font size="2">1.10</font></td>
<td width="222"><font size="2">100</font></td>
<td width="176"><font size="2">115</font></td>
<td width="136"><font size="2">100</font></td>
<td width="52"><font size="2">10</font></td>
</tr>
<tr>
<td width="54" ><font size="2">18.01.2007</font></td>
<td width="161" ><font size="2">IST</font></td>
<td width="124"><font size="2">1.20</font></td>
<td width="222"><font size="2">200</font></td>
<td width="176"><font size="2">190</font></td>
<td width="136"><font size="2">200</font></td>
<td width="52"><font size="2">54</font></td>
</tr>
<tr>
<td width="54" ><font size="2">18.01.2007</font></td>
<td width="161" ><font size="2">ANK</font></td>
<td width="124"><font size="2">2.110.12</font></td>
<td width="222"><font size="2">300</font></td>
<td width="176"><font size="2">350</font></td>
<td width="136"><font size="2">450</font></td>
<td width="52"><font size="2">745</font></td>
</tr>
<tr>
<td width="54" ><font size="2">18.01.2007</font></td>
<td width="161" ><font size="2">ANK</font></td>
<td width="124"><font size="2">12.128.43</font></td>
<td width="222"><font size="2">150</font></td>
<td width="176"><font size="2">150</font></td>
<td width="136"><font size="2">4664</font></td>
<td width="52"><font size="2">55</font></td>
</tr>
<tr>
<td width="54" ><font size="2">18.01.2007</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">6.142.42</font></td>
<td width="222"><font size="2">100</font></td>
<td width="176"><font size="2">100</font></td>
<td width="136"><font size="2">234</font></td>
<td width="52"><font size="2">77</font></td>
</tr>
<tr>
<td width="54" ><font size="2">18.01.2007</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">9.86.50</font></td>
<td width="222"><font size="2">125</font></td>
<td width="176"><font size="2">135</font></td>
<td width="136"><font size="2">654</font></td>
<td width="52"><font size="2">80</font></td>
</tr>
<tr>
<td width="54" ><font size="2">18.01.2007</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">12.43.250</font></td>
<td width="222"><font size="2">75</font></td>
<td width="176"><font size="2">80</font></td>
<td width="136"><font size="2">233</font></td>
<td width="52"><font size="2">101</font></td>
</tr>
<tr>
<td width="54" ><font size="2">19.01.2007</font></td>
<td width="161" ><font size="2">IST</font></td>
<td width="124"><font size="2">1.10</font></td>
<td width="222"><font size="2">100</font></td>
<td width="176"><font size="2">99</font></td>
<td width="136"><font size="2">100</font></td>
<td width="52"><font size="2">10</font></td>
</tr>
<tr>
<td width="54" ><font size="2">19.01.2007</font></td>
<td width="161" ><font size="2">IST</font></td>
<td width="124"><font size="2">1.20</font></td>
<td width="222"><font size="2">200</font></td>
<td width="176"><font size="2">210</font></td>
<td width="136"><font size="2">200</font></td>
<td width="52"><font size="2">54</font></td>
</tr>
<tr>
<td width="54" ><font size="2">19.01.2007</font></td>
<td width="161" ><font size="2">ANK</font></td>
<td width="124"><font size="2">2.110.12</font></td>
<td width="222"><font size="2">300</font></td>
<td width="176"><font size="2">309</font></td>
<td width="136"><font size="2">450</font></td>
<td width="52"><font size="2">745</font></td>
</tr>
<tr>
<td width="54" ><font size="2">19.01.2007</font></td>
<td width="161" ><font size="2">ANK</font></td>
<td width="124"><font size="2">12.128.43</font></td>
<td width="222"><font size="2">150</font></td>
<td width="176"><font size="2">155</font></td>
<td width="136"><font size="2">4664</font></td>
<td width="52"><font size="2">55</font></td>
</tr>
<tr>
<td width="54" ><font size="2">19.01.2007</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">6.142.42</font></td>
<td width="222"><font size="2">100</font></td>
<td width="176"><font size="2">100</font></td>
<td width="136"><font size="2">234</font></td>
<td width="52"><font size="2">77</font></td>
</tr>
<tr>
<td width="54" ><font size="2">19.01.2007</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">9.86.50</font></td>
<td width="222"><font size="2">125</font></td>
<td width="176"><font size="2">90</font></td>
<td width="136"><font size="2">654</font></td>
<td width="52"><font size="2">80</font></td>
</tr>
<tr>
<td width="54" ><font size="2">19.01.2007</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">12.43.250</font></td>
<td width="222"><font size="2">75</font></td>
<td width="176"><font size="2">60</font></td>
<td width="136"><font size="2">233</font></td>
<td width="52"><font size="2">101</font></td>
</tr>
<tr>
<td width="54" ><font size="2">20.01.2007</font></td>
<td width="161" ><font size="2">IST</font></td>
<td width="124"><font size="2">1.10</font></td>
<td width="222"><font size="2">100</font></td>
<td width="176"><font size="2">90</font></td>
<td width="136"><font size="2">100</font></td>
<td width="52"><font size="2">10</font></td>
</tr>
<tr>
<td width="54" ><font size="2">20.01.2007</font></td>
<td width="161" ><font size="2">IST</font></td>
<td width="124"><font size="2">1.20</font></td>
<td width="222"><font size="2">200</font></td>
<td width="176"><font size="2">190</font></td>
<td width="136"><font size="2">200</font></td>
<td width="52"><font size="2">54</font></td>
</tr>
<tr>
<td width="54" ><font size="2">20.01.2007</font></td>
<td width="161" ><font size="2">ANK</font></td>
<td width="124"><font size="2">2.110.12</font></td>
<td width="222"><font size="2">300</font></td>
<td width="176"><font size="2">350</font></td>
<td width="136"><font size="2">450</font></td>
<td width="52"><font size="2">745</font></td>
</tr>
<tr>
<td width="54" ><font size="2">20.01.2007</font></td>
<td width="161" ><font size="2">ANK</font></td>
<td width="124"><font size="2">12.128.43</font></td>
<td width="222"><font size="2">150</font></td>
<td width="176"><font size="2">156</font></td>
<td width="136"><font size="2">4664</font></td>
<td width="52"><font size="2">55</font></td>
</tr>
<tr>
<td width="54" ><font size="2">20.01.2007</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">6.142.42</font></td>
<td width="222"><font size="2">100</font></td>
<td width="176"><font size="2">120</font></td>
<td width="136"><font size="2">234</font></td>
<td width="52"><font size="2">77</font></td>
</tr>
<tr>
<td width="54" ><font size="2">20.01.2007</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">9.86.50</font></td>
<td width="222"><font size="2">125</font></td>
<td width="176"><font size="2">140</font></td>
<td width="136"><font size="2">654</font></td>
<td width="52"><font size="2">80</font></td>
</tr>
<tr>
<td width="54" ><font size="2">20.01.2007</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">12.43.250</font></td>
<td width="222"><font size="2">75</font></td>
<td width="176"><font size="2">90</font></td>
<td width="136"><font size="2">233</font></td>
<td width="52"><font size="2">101</font></td>
</tr>
<tr>
<td width="54" >...</td>
<td width="161" >....</td>
<td width="124">....</td>
<td width="222">....</td>
<td width="176">....</td>
<td width="136">....</td>
<td width="52">....</td>
</tr>
</table>
<p>Â </p>
<p><b><font size="2">tbl_ANNUAL_PRG</font></b></p>
<table border="1" width="552" id="table2">
<tr>
<td width="62"><b><font size="2">fld_YEARS</font></b></td>
<td><b><font size="2">fld_PRODUCER_UNITCODE</font></b></td>
<td><b><font size="2">fld_PRODUCT_CODE</font></b></td>
<td width="177"><b><font size="2">fld_PRODUCTION_PROGRAM</font></b></td>
</tr>
<tr>
<td width="62"><font size="2">2006</font></td>
<td width="161" ><font size="2">IST</font></td>
<td width="124"><font size="2">1.10</font></td>
<td width="177"><font size="2">15000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2006</font></td>
<td width="161" ><font size="2">IST</font></td>
<td width="124"><font size="2">1.20</font></td>
<td width="177"><font size="2">22000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2006</font></td>
<td width="161" ><font size="2">ANK</font></td>
<td width="124"><font size="2">2.110.12</font></td>
<td width="177"><font size="2">35000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2006</font></td>
<td width="161" ><font size="2">ANK</font></td>
<td width="124"><font size="2">12.128.43</font></td>
<td width="177"><font size="2">50000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2006</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">6.142.42</font></td>
<td width="177"><font size="2">170000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2006</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">9.86.50</font></td>
<td width="177"><font size="2">12000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2006</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">12.43.250</font></td>
<td width="177"><font size="2">123000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2007</font></td>
<td width="161" ><font size="2">IST</font></td>
<td width="124"><font size="2">1.10</font></td>
<td width="177"><font size="2">18000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2007</font></td>
<td width="161" ><font size="2">IST</font></td>
<td width="124"><font size="2">1.20</font></td>
<td width="177"><font size="2">25000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2007</font></td>
<td width="161" ><font size="2">ANK</font></td>
<td width="124"><font size="2">2.110.12</font></td>
<td width="177"><font size="2">32000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2007</font></td>
<td width="161" ><font size="2">ANK</font></td>
<td width="124"><font size="2">12.128.43</font></td>
<td width="177"><font size="2">55000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2007</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">6.142.42</font></td>
<td width="177"><font size="2">190000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2007</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">9.86.50</font></td>
<td width="177"><font size="2">10000</font></td>
</tr>
<tr>
<td width="62"><font size="2">2007</font></td>
<td width="161" ><font size="2">IZM</font></td>
<td width="124"><font size="2">12.43.250</font></td>
<td width="177"><font size="2">129000</font></td>
</tr>
</table>
<p>Â </p>
<p><b><font size="2">tbl_PRODUCT_GROUPS<br>
(This table gives the names to the product of the tbl_PRODUCTIONS table)</font></b></p>
<table border="1" width="366" id="table3">
<tr>
<td><b><font size="2">fld_PRODUCT_GROUP_CODE</font></b></td>
<td width="175"><b><font size="2">fld_PRODUCT_GROUP_CODE</font></b></td>
</tr>
<tr>
<td width="175"><font size="2">1.10</font></td>
<td width="175"><font size="2">Pencil</font></td>
</tr>
<tr>
<td width="175"><font size="2">1.20</font></td>
<td width="175"><font size="2">Rubber</font></td>
</tr>
<tr>
<td width="175"><font size="2">2.110.12</font></td>
<td width="175"><font size="2">Ruler</font></td>
</tr>
<tr>
<td width="175"><font size="2">12.128.43</font></td>
<td width="175"><font size="2">Pencil Box</font></td>
</tr>
<tr>
<td width="175"><font size="2">6.142.42</font></td>
<td width="175"><font size="2">School Bag</font></td>
</tr>
<tr>
<td width="175"><font size="2">9.86.50</font></td>
<td width="175"><font size="2">Pen</font></td>
</tr>
<tr>
<td width="175"><font size="2">12.43.250</font></td>
<td width="175"><font size="2">Calendar</font></td>
</tr>
</table>
<p>Â </p>
<p><font size="2">These 3 tables are in Oracle. I am trying to access the tables
with an asp page. I succeed to retrieve the values to a page, but processing the
values and joining the tables together is too complex for me. The table I want
is like this. Would you help me creating <b>ASP</b> page and <b>SQL</b> queries
to create this table:</font></p>
<p><font size="2">Parameters to send the asp page that process the SQL queries:<br>
startdate=18.01.2007<br>
finishdate=20.01.2007</font></p>
<p><b><font size="2">The Productions of -18.01.2007-20.01.2007</font></b></p>
<table border="1" width="1066" id="table4">
<tr>
<td><font size="2">Comes From tbl_PRODUCTIONS table</font></td>
<td><font size="2">Comes From tbl_PRODUCT_GROUPS table</font></td>
<td width="155"><font size="2">Comes from tbl_ANNUAL_PRG table</font></td>
<td width="208"><font size="2">Comes from tbl_PRODUCTIONS table summing
each value for each product</font></td>
<td width="179"><font size="2">Comes from tbl_PRODUCTIONS table summing
each value for each product</font></td>
<td width="108"><font size="2">Comes from tbl_PRODUCTIONS retrieving the
values for "finishdate". Not cumulative like other values!</font></td>
<td width="187"><font size="2">Comes from tbl_PRODUCTIONS table summing
each value for each product</font></td>
</tr>
<tr>
<td><b><font size="2">Producer Locations</font></b></td>
<td><b><font size="2">Products</font></b></td>
<td width="155"><font size="2"><b>Annual Production Program</b></font></td>
<td width="208"><font size="2"><b>Production Program for wanted period</b></font></td>
<td width="179"><font size="2"><b>Production Quantity for wanted period</b></font></td>
<td width="108"><font size="2"><b>Stock Quantity</b></font></td>
<td width="187"><font size="2"><b>Selling Quantity for wanted period</b></font></td>
</tr>
<tr>
<td width="119" ><font size="2">IST</font></td>
<td width="61"><font size="2">Pencil</font></td>
<td width="155"><font size="2">18000</font></td>
<td width="208"><font size="2">300</font></td>
<td width="179"><font size="2">304 </font></td>
<td width="108"><font size="2">100</font></td>
<td width="187"><font size="2">30</font></td>
</tr>
<tr>
<td width="119" ><font size="2">IST</font></td>
<td width="61"><font size="2">Rubber</font></td>
<td width="155"><font size="2">25000</font></td>
<td width="208"><font size="2">600</font></td>
<td width="179"><font size="2">590</font></td>
<td width="108"><font size="2">200</font></td>
<td width="187"><font size="2">162</font></td>
</tr>
<tr>
<td width="119" ><font size="2">ANK</font></td>
<td width="61"><font size="2">Ruler</font></td>
<td width="155"><font size="2">32000</font></td>
<td width="208"><font size="2">900</font></td>
<td width="179"><font size="2">1009</font></td>
<td width="108"><font size="2">450</font></td>
<td width="187"><font size="2">2235</font></td>
</tr>
<tr>
<td width="119" ><font size="2">ANK</font></td>
<td width="61"><font size="2">Pencil Box</font></td>
<td width="155"><font size="2">55000</font></td>
<td width="208"><font size="2">450</font></td>
<td width="179"><font size="2">461</font></td>
<td width="108"><font size="2">4664</font></td>
<td width="187"><font size="2">165</font></td>
</tr>
<tr>
<td width="119" ><font size="2">IZM</font></td>
<td width="61"><font size="2">School Bag</font></td>
<td width="155"><font size="2">190000</font></td>
<td width="208"><font size="2">300</font></td>
<td width="179"><font size="2">320</font></td>
<td width="108"><font size="2">234</font></td>
<td width="187"><font size="2">231</font></td>
</tr>
<tr>
<td width="119" ><font size="2">IZM</font></td>
<td width="61"><font size="2">Pen</font></td>
<td width="155"><font size="2">10000</font></td>
<td width="208"><font size="2">375</font></td>
<td width="179"><font size="2">365</font></td>
<td width="108"><font size="2">654</font></td>
<td width="187"><font size="2">240</font></td>
</tr>
<tr>
<td width="119" ><font size="2">IZM</font></td>
<td width="61"><font size="2">Calendar</font></td>
<td width="155"><font size="2">129000</font></td>
<td width="208"><font size="2">225</font></td>
<td width="179"><font size="2">230</font></td>
<td width="108">233</td>
<td width="187"><font size="2">303</font></td>
</tr>
</table>
OS: WinXP Pro
DB: Oracle (Version ?)
Script: ASP
I cannot believe that there is yet another version of SQL Server without a TRIM function. So for SQL 2005 (like I've done in 7.0 and 2000) my T-SQL will look like dog poo because I will have to write LTRIM(RTRIM(MyValue)) anytime I want to remove whitespace from both ends of character values instead of just writing TRIM(MyValue).
View 15 Replies View RelatedHi,
I'm new to replication.
I configured Server named TESTER as publisher & distributer. Create new publication for database named TEST ( type : Transactional ), then Create a new push subcriptions for database TESTREPLICATION ( on the same Server : TESTER). Then I open a table in database TEST to input some data but I couldn't see any tables or data in database TESTREPLICATION ( I chose Continuously, not scheduled).
Yet, after the lunch, I could see the tables, no data. I tried to choose Start Synchronizing but not helped.
Please tell me if I configured incorrectly ?
Thanks,
Hi,
I'm not able to browse through http://localhost/reports.
When I'm trying to connect it gives me "Server Error in '/Reports' Application."At the same time I'm able to view Reportserver.At the same time I'm able to view Reportserver.(i.e)http://localhost/reportserver
please can anyone suggest me some solution to this problem..
Server Error in '/Reports' Application.
The trust relationship between the primary domain and the trusted domain failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.SystemException: The trust relationship between the primary domain and the trusted domain failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SystemException: The trust relationship between the primary domain and the trusted domain failed.
]
System.Security.Principal.NTAccount.TranslateToSids(IdentityReferenceCollection sourceAccounts, Boolean& someFailed) +1167
System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean& someFailed) +42
System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess) +46
System.Security.Principal.WindowsPrincipal.IsInRole(String role) +205
System.Web.Configuration.AuthorizationRule.IsTheUserInAnyRole(StringCollection roles, IPrincipal principal) +120
System.Web.Configuration.AuthorizationRule.IsUserAllowed(IPrincipal user, String verb) +300
System.Web.Configuration.AuthorizationRuleCollection.IsUserAllowed(IPrincipal user, String verb) +191
System.Web.Security.UrlAuthorizationModule.OnEnter(Object source, EventArgs eventArgs) +3403086
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
May i have a list of Which queries or codes couldn't use in a Transactions in Sql Server ?
Hi all,
I have created a package to copy 10 tables from a database to another one. I have created a datasource with SQL Authentication mode. And it couldn't run until I changed the datasource connection to Windows Authentication mode. How could it be like that, it's just the authentication mode?
Is there anyone have the right answer for this situation?
Dear All
Please I need an urgent help
After i finished all Transaction Log Shipping Configuration.
I tried to use the database in the secondary database but i couldn't access it
i saw it in SQL Managment Studio as (Restoring......)
i tired to make a database snapshot from it , i had a message
Msg 1822, Level 16, State 1, Line 1
The database must be online to have a database snapshot.
Please urgently
Hi, I have a stored procedure that calls a scalar function. It works fine on my development database, but on my production database, I get this error when trying to execute the procedure: Cannot find either column "dbo" or the user-defined function or aggregate "dbo.MyFunction", or the name is ambiguous. However, I am able to execute the function outside of the procedure like this: select dbo.MyFunction(0, 0) Anyone have idea? I can't figure it out.
View 6 Replies View RelatedI'm looking for a way to pull off a complex find+replace within some code, as follows:
@step_name = N'SAME - OCF Collins (Tabard)', @command = N'DTSRun /~Z0x5F4F7B0688825E7544AC46CFD664F98AC ', @database_name = N'
We have over 200 variants of the above, but following the same syntax (@step_name, Dbname, @Command etc...
Rules:
1) Note the unique identifier "~Z0x5F4F7B0688825E7544AC46CFD664F98AC". I would like it replaced for whatever is between "@step_name = N'" , and @command = N'DTSRun ; (this will form a filename).
2) Note the 'DTSRun /' string. I'd like that replaced with Dtexec /F "D:MyFileLocationFolderHere" (this folder remains constant).
I have a table with two columns: siteID (int primary key) and siteName(varchar(50) unique constraint).I am completely new to databases and UDFs and would like to write afunction that looks for a particular siteName and returns the siteID.If the siteName is not found then it would create a record and returnthat record's siteID.I am pretty sure there is a standard way of doing it and have beenlooking for examples, but have yet to find anything on Google.If anyone could point me in the right direction I would be verygrateful - I am still looking and will reply if I find anything.Many thanksJon
View 6 Replies View Related
Dear all hi,
I would like to create a function that will return to me the width of the column of the table without giving as a parameter the table name. I need it, as I want to exceed my data in this column to the column length. I want to fill the column data with trailing blanks until I reach the column width. The function len returns the length of the data in the column.
I know that If I have the table name I can find the column width through the system tables. I don€™t want this.
Sincerely,
Hellen
Hi,I m searching for some Script / Function ... to find difference in datab/w 2 similar tables (exactly same fields structure) in sql 2000.plz update me asap !thanks in advance !
View 2 Replies View Relatedhi,
i am using a forEach look to import each file within a folder, but i also need to calculate the dataset related ot these files.
the file are named as:
ff_inbound_20071008_1.csv
ff_inbound_20071008_2.csv
where for file ff_inbound_20071008_1.csv:
ff => flat file
inbound => dataset of this csv
20071008 => date
1=> file count
having in mind that they are store in the variable as a full path:
z:myFlatFilesexportsproj01ff_inbound_20071008_2.csv
i need to extract the dataset and the date for each file.
how can i extract these terms from the file name?
many thanks,
nicolas
I'm trying to run the query given below but iFile.Pathname is underlined in red.
Query: SELECT top 1 iFile.Pathname AS 'PathName' FROM Videos
Error: Cannot find either column "iFile" or the user-defined function or aggregate "iFile.Pathname", or the name is ambiguous.
Do I need to run a procedure?
Hello i have this query and I havent been able to solve it
Cannot find either column "dbo" or the user-defined function or aggregate "dbo.FN_NIVELCOMPETENCIACARGO", or the name is ambiguous.
I have tried with dbo and withou dbo, specifyng columns inside it,
Thanks
select a.nmempresa,a.nmtipocompetencia, d.dsnombreciclo, c.dsnombrecargo,a.dstipocompetencia, a.dscatalogo,
b.popeso as PesoTipoCompetencia, f.dsnombrecompetencia as Competencia, e.pocompetencia as PesoCompetencia,
g.DSOPCIONESCALA, g.PESO
from
tgsc_tiposcompetencias a, TGSC_TIPOSCOMPETENCIASxcargo b, tgsc_cargos c, tgsc_ciclos d,
tgsc_competenciasxcargo e, tgsc_competencias f,
(select
dbo.FN_NIVELCOMPETENCIACARGO(a.nmempresa,a.nmciclo, a.nmtipocompetencia,c.nmcargo,f.nmcompetencia)) as g
where a.nmempresa=72 and a.nmciclo=9
and b.nmtipocompetencia=a.nmtipocompetencia
and b.nmcargo=10 and b.nmempresa=72 and b.nmciclo=9
and c.nmcargo=10 and c.nmempresa=72 and c.nmciclo=9 and d.nmciclo=9
and e.nmcargo=10 and e.nmciclo=9 and e.nmempresa=72
and f.nmcompetencia=e.nmcompetencia and f.nmtipocompetencia=a.nmtipocompetencia
and f.nmtipocompetencia=b.nmtipocompetencia
I've written sql code which takes a date and finds the Last Day of the Month one year ago. For example, it takes the date '2015-04-17' and returns the date '2014-04-30'. The code works fine in a query. Now I'm trying to turn this into a function. However, when I try to create the function I get the error:
Operand type clash: date is incompatible with int
Why is this error being returned?
Here is my function:
CREATE FUNCTION dbo.zEOM_LY_D(@Input Date)
      RETURNS date
AS
BEGIN;
 DECLARE @Result date;
 SET @Result = convert(DATE, DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,dateadd(m, -11, @Input)+1),0)),101)
   RETURN @Result;
END;
Hi all,
I couldn't debug SQL Server by "Step into Stored Procedure" on Server Explorer of VS2008 (or VS2005) to SQL 2005 Developer on remote Windows Server 2003 machine, it allway issue exception "Unable to start T-SQL Debugging. Could not attach to SQL Server process on 'Server'. Click Help for more information"
1) The environment:
The Client: Windows XP SP2 (WORKGROUP)
Visual Studio 2008 (or VS2005)
The SQL Server Machine: Windows 2003 Server Sp1 (DOMAIN)
SQL Server 2005 Developer
2) User account and Permission login:
I create the same user account for both Client and Domain Server with the same password, i also add that user to "Administrators" group in both machine.
At the SQL Server on Server machine, i added that account to ServerSecurityLogin with 'sysadmin' role already
3) Connection and authentication:
I used "Windows Authentication" for my connection to SQL server, and i checked sure my account of the connection by SQL command
SELECT SYSTEM_USER,
IS_SRVROLEMEMBER ('sysadmin')
4) Firewall:
I checked firewall like MSDN helping (i also tried to test by turn off firewall in both machine)
5) Visual Studio Remote Debugger:
I read "How to: Enable SQL Server 2005 Debugging" on MSDN with comment "The SQL Server can run on the same machine as the application or on a remote machine. If you are debugging T-SQL code only, then no remote setup is required."
so i didn't config Visual Studio Remote Debugger any thing.
Note: If i "Step Into Store Procedure" at Server locally, it works okey, so on at my PC client locally. But if i move debugging from my client to my Server, it occur error "Unable to start T-SQL Debugging. Could not attach to SQL Server process on 'Server'. Click Help for more information"???
If i execute store procedure on Server Explore, it works okey!
Please help me to find out what problem is???
Thanks,
Haiasc
is there a function trimming string such as Trim in vb?
View 2 Replies View RelatedIN ACCESS
UPDATE 14_Together_final_ICNs INNER JOIN 14_Together_UniqueSKUs ON [14_Together_final_ICNs].SKU = [14_Together_UniqueSKUs].SKU SET [14_Together_final_ICNs].sku_desc = [14_Together_UniqueSKUs].NewDesc
WHERE (((Trim(Nz([NewDesc])))<>""));
THIS IS WHAT I TRY IN SQL SEVER BUT GET A DIFFERNET RESULT
UPDATE [14_Together_final_ICNs]
SET sku_desc = [14_Together_UniqueSKUs].NewDesc
FROM [14_Together_final_ICNs] INNER JOIN
[14_Together_UniqueSKUs] ON [14_Together_final_ICNs].SKU = [14_Together_UniqueSKUs].SKU
WHERE (RTRIM(LTRIM([14_Together_final_ICNs].sku_desc))<> N'')
Guys/Girls
Have a small problem I have received a load of data in a flat file format and each column has dividend up with a comma. I have stuck the whole row in to its own column.
What I want to do is take the first 12 characters of the row and put them in there own column.
I think I need to use the Len function or the trim function, so can some body point me in the right direction on how to do this.
Regards Lee
Okay basic question from the village idiot. How do I return only the date and not the time from a datetime column and also can I return only a set number of digits in a float column?
Thanks in advance peter
The Yak Village Idiot
Hi I have the below paragraph in my datacolum called 'Description'
Ansmann Powerline 5 Super Fast Charger, Microprocessor controlled desktop charger with discharge function for up to 5 NiCd/NiMH cells, For all NiCd and NiMH rechargable batteries including AA/AAA/C/D/9V, Negative Delta V control, faulty cell detection, defined predischarge, trickle charge, separate status indicator for every charging slot, ultra rapid charging, 230V AC. For UK use. Price for 1 Charger.
How do I take only the sentence upto the first comma in my STORED procedure
(ex:Ansmann Powerline 5 Super Fast Charger)
Advance thanks
Vaishu
Hi,Suppose I have a table containing monthly sales figures from my shopbranches:Branch Month Sales-----------------------London Jan 5000London Feb 4500London Mar 5200Cardiff Jan 2900Cardiff Feb 4100Cardiff Mar 3500The question I am trying to ask is this: in which month did each branchachieve its highest sales? So I want a result set something like this:Branch Month----------------London MarCardiff FebI can do a "SELECT Branch, MAX(Sales) FROM MonthlySales GROUP BY Branch" totell me what the highest monthly sales figure was, but I just can't figureout how to write a query to tell me which month corresponded to MAX(Sales).Ideas anyone?Cheers,....Andy
View 5 Replies View Relatedwe need to cut the aprostrophe out of a name (ie...o'brien, o'leary) to create userid's... can this be done....thanks!
View 1 Replies View RelatedWhat is the syntax of left triming characters seperated by space.
e.g elsie reed
and i want elsie to go to one field and reed in another field i do not want to use numbers because they don't all have the same numbers but are all seperated by spaces
What is the best way to trim a string to the space in a select statement? An example string would be:
'asdf and hjkl'
The result would be:
'asdf'
hi guys,
i need to update a column by trimming the right end. i tried many things but its not working. can anyone tell me?
Regards,
David
OK, the problem is like this; say the table is sumthing like this
i have a table 't3' has 3 fields
id(number,2)
date(date/time)
text(varchar,200)
eg. id date text
-----------------------
01 05-jul-07 abcdefghijkl (i want to get rid of the first 6 characters i.e. abcdef)
i want to display 'text' field from t3 table but with the first 6 characters trimmed/removed (i want to get rid of the 6 first characters)
so i did:
select LTRIM(text,6) from t3
but the above code didn't work because LTRIM only trims spaces NOT characters... Is there any way that i can trim off the first 6 characters from every record in the 'text' field?
In my report, i have a TextBox which retrieve the result from the database.I am using this code :
=Fields!Category.Value.ToString().Trim(" ").TrimEnd(",").TrimStart(",")
But i am encountering a problem,wherein,when the value contains '&' (ex. Jog & Hop)
the result became Jog&Hop.
What could be wrong with my trim???
Thanks!!
"select RTrim(columName) from tableName"
it can change the stirng " abc" to "abc". But I want change the string "a bc" to "abc".
Why the TRIM cannot work ?
How do I do ?Thanks.
Whan using the TRIM() function in a SELECT we are getting an invalid function error. What gives? I thought TRIM() was T-SQL & not one of Microsoft's SQL "extras".
Thanks!