String Concatination From XML In SQL Server 2005

Jul 17, 2006

I have a stored procedure where I want to loop through the nodes of an XML type and use its values to perform string concatination.

I'm new to the XML type in SQL Server and to XQuery in T-SQL and am wondering if someone can point me in the right direction. The XML samples I've found so far focuses on returning a set of nodes or building XML to store, not reading it in T-SQL and building strings.

View 1 Replies


ADVERTISEMENT

Concatination Help!!

Feb 7, 2002

How can we find out the position of the last space(' ')in a sentence?

Example sentence:
My name is John.

Result: 11 (since the last space starts at 11th character in the sentence)

Any clue??
thanks.
John.

View 2 Replies View Related

Concatination Help!!

Feb 7, 2002

How can we find out the position of the last space(' ')in a sentence?

Example sentence:
My name is John.

Result: 11 (since the last space starts at 11th character in the sentence)

Any clue??
thanks.
John.

View 2 Replies View Related

Concatination Help!

Jul 22, 2002

How do I get the file name appended by today's date in the following format dynamically?

example:
filename= orderfile.xls
new file name should be: orderfile_020722.xls

Thanks for any help.
Sonia.

View 2 Replies View Related

SQL Server 2005 Connection String In Visual Studio 2005

Nov 14, 2006

Hey
I need to know what shall i specify in this connection string in visual studio web.confug file inorder to connect to ma registered server (locally) not directly to my dedicated server ....cuz i am facing network connection problems ....
b4 i used to use this connection string :
<add key="conn" value="data source=IP addresseel,1433;initial catalog=xxx;user id=username on the dedicated server;Password=password on the dedicated server;timeout=60"></add>
So how can i change it ???? to be able to connect locally ????
Please Help ???!
Thanks in advance
Hiba

View 13 Replies View Related

Concatination Help!! URGENT!!!

Feb 7, 2002

We need to concatinate the following two fields and make a third field upto max. of 100 char. While concatinating these two fields, the second field should not be cut in the middle of a word after concatination and should end in "..." as shown in the example below:

Product_name_field1: This is varchar(32)
Example: Classic-Fit Pleated-Front Khakis: This is varchar(1000)

Product_name_field2: (length varies from 120-1000 char)
Example: We make our khakis of 100% cotton twill and then garment-wash them and ship them for ...

Result: incorrect way:
Classic-Fit Pleated-Front Khakis,We make our khakis of 100% cotton twill and then garment-wash th...

Result: Correct way:
Classic-Fit Pleated-Front Khakis,We make our khakis of 100% cotton twill and then garment-wash...

I appreciate for any help.Thanks.
John.

View 2 Replies View Related

SSIS Concatination

Nov 30, 2007

I have a query in SSIS which works fine.

SELECT SUBSTR(DOB_CHAR, 7, 2) AS EXP3, SUBSTR(DOB_CHAR, 5, 2) AS EXPR1, SUBSTR(DOB_CHAR, 1, 4) AS EXPR2
FROM WAITLIST

results





20


12


1948



07


09


1982



29


07


1960

However, when I try to concatinate, it falls over

SELECT SUBSTR(DOB_CHAR, 7, 2) + '/' + SUBSTR(DOB_CHAR, 5, 2) + '/' + SUBSTR(DOB_CHAR, 1, 4) AS EXPR2
FROM WAITLIST

The syntax works ok on SQL Server query, but not in SSIS.

(Reading from Oracle, number 19481220, an is varchar2)



Select will work with pipes (as in oracle) but it must be of the form | | '/' | |

that is

SUBSTR(DOB_CHAR, 7, 2) | | '/' | | SUBSTR(DOB_CHAR, 5, 2) | | '/' | | SUBSTR(DOB_CHAR, 1, 4) AS EXP2

I would like to know if this is correct, or is it because I am reading from Oracle?

I do get an error message in query builder, but the query then runs as required.
Error in list of function arguments: '|' not recognized.
Error in list of function arguments: ',' not recognized.
Error in list of function arguments: ')' not recognized.
Unable to parse query text.

Any views?

View 4 Replies View Related

Concatination Query?

Mar 22, 2007

I have a need to query some data and string all my results by id. I am fairly close to the results but stuck on the final piece. Any help would be greatly appreciated.

Here's the scenario: My data looks as follows:








UserID
Results

1095
,,,,,,,

1095
,,,,,8,,

1095
,,,,,,,

1095
,,,,,8,,

1247
,2,3,,,6,,,

1247
,2,3,,,6,,,

1247
,2,3,,,6,,,

1247
,2,3,,,6,,,

4069
,,,,,,,

4069
,,,,,,,

4069
,,,,,,,

4069
,,,,,,,

4070
,,6,,,,,

4070
,,6,,,,,

4070
,,6,,,,,

4070
,,6,,,,,

I want to query it and end up with the results all strung together under each UserID as follows:








1095
,,,,,,,,,,,,8,,,,,,,,,,,,,,8,,

1247
,2,3,,,6,,,,2,3,,,6,,,,2,3,,,6,,,,2,3,,,6,,,

4069
,,,,,,,,,,,,,,,,,,,,,,,,,,,,

4070
,,6,,,,,,,6,,,,,,,6,,,,,,,6,,,,,

I know if I use the following code I can string all the results together

select *, Cast((SELECT Results + ',' FROM #temp1 FOR XML PATH('')) as varchar(max) ) as Results from #temp1

But I can't figure out how to break it down by individual UserID. Any help is greatly appreciated. Thanks in advance

View 11 Replies View Related

Concatination Help Required From Gurus!!

Oct 17, 2001

I need to execute the following code by passing the username as a parameter.Can I get help to complete the SQL statement??

exec ('sp_changeobjectowner '+ @Table_name +','+@ToUser) ---> This works fine.

But I need to have something like this:

exec ('sp_changeobjectowner '@username.+ @Table_name +','+@ToUser)

Note:
Here is the sample working syntax:
sp_changeobjectowner 'user1.eb_sku', user2

So,I need user1 and user2 as two different parameters.

As you see,I need to qualify the table name with the owner name which itself I want to pass as a parameter.

Any help with syntax is greatly appreciated!!
Di.

View 3 Replies View Related

Concatination For A Columns For Group By

May 15, 2008



hi all,

The situation is something like this
id name
------------------
1 lad
1 big
2 sen
2 zen

The output would be
id name
------------------
1 lad,big
2 sen,zen

Is there a way to implement this is Reporting services.This has to be achieved on the fly which the report is being executed !
Any help on this is highly appreciated .

View 1 Replies View Related

Concatination Problem With Single Quotes

Jun 26, 2001

hello,

i have a problem to concatinte sigle quotes to variable value

declared a variable name @a as varchar(30)

set @a='keerthi'
now i would like to concatinate sigle quotes in front of string and back of string.

set @a= "'" + @a + "'"
here it is giving error.

plese give me some solution

thanks
ravi

View 5 Replies View Related

Concatination Of Empty Field And Removal Of Symbols

Mar 21, 2006

Hello...

I am going crazy trying to figure out how to do this. I have a flat file which I am massaging the data and loading into a table here is an example of a line out of the flat file:

"ABC NUTRITIONAL PRODUCTS","550","","","N","FAIR OAKS","","","COLORADO SPRINGS","C0","","","","","","","","A","","",""

My problem is that I have one field which is this address in a concatinated form. The fields that do not apply to this entry are suite#, floor# and other columns which are designated by the "" characters. The final concatinated addres field looks like this:

"550""""N""FAIR OAKS"""

I would like to remove the "" characters in the concatinated string. I just don't know the best way to do this? I was told DTS had a way of removing the "" from the flat file source. Since I have not used DTS extensively I am not sure if this is true. I was wondering how in SSIS I could go about removing the "" marks without removing the "" say if someone is quoted eg. John said "This is only a test". Removing the quotation marks in this instance would be changing the data. I am not sure how to do this and any help or advice is greatly appreciated!

Thank you...

View 1 Replies View Related

Microsoft SQL Server 2005, Connection String

Jul 27, 2006

<connectionStrings>
<add name="AppConnectionString1" connectionString="Data Source=&quot;.SQLEXPRESS&quot;;AttachDbFilename=&quot;C:Program FilesMicrosoft SQL ServerMSSQLDataAdventureWorks2000_Data.mdf&quot;;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
I'm running Microsoft SQL server 2005. what is the error in the above code.

View 2 Replies View Related

SQL Server 2005 Enterprise Connection String.

Jan 2, 2007

Hi,
I have just uninstalled SQLEXPRESS and installed the 180 day trial SQL server 2005 enterprise edition.
I have since started to have problems with my ASP.Net Configuration Tool., can not connect to the database.
I think that the connection string in my machine.config file is incorrect, before installing I had,..:
datasource=./SQLEXPRESS,....
So i decided to change that part to the following. Would anybody know what I have put in the datasource part for the SQL server 2005 enterprise edition? At the moment I tried SQLSERVER2005 but that is incorrect,..
<add name="LocalSqlServer" connectionString="data source=./SQLSERVER2005;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
 

View 1 Replies View Related

Connection String For Sql Server 2005 Express

Jan 10, 2008

does anyone kbnow the connection string used to connect to the database in sql server 2005 express?
can someone one give me sample codes for it? thanks.


thanks

View 1 Replies View Related

Extracting A Portion Of A String In SQL Server 2005

Apr 22, 2008

Hello, this seems simple but I've been banging my head a while.

I have a data field that is formated like this: NYT/2000-Subways/7510-Electronics Mtc/7540-Data Svcs.

I need to pull out the string after the second / and before the third / in this case the value is 7510-Electronics Mtc but it does change.

I have this function that returns the first value (NYT):

USE [Data_Warehouse]
GO
/****** Object: UserDefinedFunction [dbo].[Get_Dept] Script Date: 04/22/2008 09:22:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- Provide the phrase before (ex. 'Worklog Related to'), the field searched (ex. UPDATE_ACTION), and
-- the phrase after (ex. ']').
-- This function returns the string found after any phrase and before any phrase, within any field searched.

ALTER FUNCTION [dbo].[Get_Dept](@in_Phrase_Before varchar(250),@in_Search_Field varchar(250))
RETURNS varchar(250)
AS
BEGIN
Declare @str_String As varchar(250)
Declare @tmp_String as varchar(250)
Set @str_String = null -- to clear the variable buffer

Set @in_Phrase_Before=char(37)+(LTrim(Rtrim(@in_Phrase_Before)))+char(37) -- if 'Null', all strings will be returned

If Left(@in_Search_Field,4) = 'NYT/'
BEGIN
Set @tmp_String = Right(@in_Search_Field,(len(@in_Search_Field) - 4 ) )
Set @in_Search_Field = @tmp_String
END

If (PatIndex(@in_Phrase_Before, @in_Search_Field)) > 0 --Checks to see if the phrase before is in the search field
Set @str_String=SubString(@in_Search_Field,1, (PatIndex(@in_Phrase_Before, @in_Search_Field)-1) )

RETURN @str_String

END

Thanks in advance for the help

View 10 Replies View Related

Connection String Question - SQL Server 2005

Mar 12, 2007

What is the impact of the differences in the following 2 connection strings:

Initial Catalog=xxx;Data Source=xxxxxx;Trusted_Connection=True;

Driver={SQL Server};Server=xxxxx;database=xxx;Trusted_Connection=yes;

To outline the differences I'm concerned with are


Missing Driver on first string

Difference in Trusted_Connection parameter (true vs. yes)

Initial Catalog vs. database parameter

View 6 Replies View Related

Connection String To SQL Server 2005 Express Database

Apr 10, 2008

Hi, all. I am using VS.NET 2005 and SQL Server 2005 Express. I tried to use the following code to connect to a database named "AMSPROD" that I attached to SQL Server 2005 Express:
 dbConn = new OleDbConnection(Data Source=.SQLEXPRESS;AttachDbFilename="C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataAMSPROD_Data.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True);
dbConn.Open();
I got an error asking for provider with the above connection string, then I changed the conncection string to be like follows:
Data Source=.SQLEXPRESS;AttachDbFilename="C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataAMSPROD_Data.MDF";Provider=SQLNCLI;Integrated Security=True;Connect Timeout=30;User Instance=True
I got error: No error message available, result code: DB_E_ERRORSOCCURRED(0x80040E21)
Then I changed the Provider to be like: Provider=SQLOLEDB, now I am getting the following error:
Message: "Invalid authorization specification
Invalid connection string attribute"
Source: "Microsoft SQL Native Client"
StackTrace: " at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at ISESAMSData.DbConnections.MakeConnection() in C:\ISES\ISESCommon\ISESAMSData\DbConnections.cs:line 74"
TargetSite: {Void .ctor(System.Data.OleDb.OleDbConnectionString, System.Data.OleDb.OleDbConnection)}
Strange thing is, when I use the Connect To Database under Tool menu of VS.NET 2005, I could make the connection to this database. Then I copied this connection string to the code, the connection couln't be made. I feel very confused.
I am wondering if I need to add ASP.NET user to SQLExpress. But I don't know how to do it?
Can anyone please help me out! Many thanks!

View 7 Replies View Related

SQL Server 2005 Express Edition Connection String (dns-less)

Jun 12, 2006

Junifer writes "Hello guys,

Can you give me a simple example of a dns-less connection to SQL Server 2005 Express Edition?



Thanks."

View 1 Replies View Related

Connection String For Classic ASP Global.asa To SQL Server 2005

Dec 1, 2005

I migrated my SQL Server 7 database to the new SQL Server 2005 that I installed on my PC.  I have classic ASP programs on my PC that used to access the SQL Server 7 database.  However, global.asa and these ASP programs can no longer connect to the new SS 2005 database.

View 9 Replies View Related

SQL Express 2005 Connection String Vs SQL Server (latest)

Oct 28, 2007

I'm a student at Boise State university and we're using SQL Express as part of one of our projects for ASP.NET programming. I liked it and I'm trying to use it to power a wiki that I'll be hosting from my home internet connection. The wiki is compatible with MSSQL server, but it won't connect to SQL Express.

I suspect that the problem is in the connection string, mainly because the apps we're developing for class use a connection string like:
<add name="AspNetForumConnectionString" connectionString="Data Source=localhostsqlexpress;Initial Catalog=gaming.forum.nxnw;User ID=*********;Password=*********;" providerName="System.Data.SqlClient"/>

and note the Data Source. The wiki I'm using is PHP based and uses ADObd to connect databases and has a driver for MSSQL, but not SQL Express (no surprise, really). I know just enough php to be dangerous to code and I've tried modifying the adodb-mssql.inc.php, but I can't seem to make the right change.

So, all that said, my question is: Is there a way to change what SQL Express 2005 will accept as a connection string? I've been looking, but I'm not even sure what the setting would be called.

Thanks,
Les

View 6 Replies View Related

How To Remove Non-Numeric Or Non-alphameric Characters From A String In Sql Server 2005

May 16, 2007

Hi to all,
I am having a string like  (234) 522-4342.
i have to remove the non numeric characters from the above string.
Please help me in this regards.
Thanks in advance.
M.ArulMani
 
 

View 2 Replies View Related

How To Remove Non-Numeric Or Non-alphameric Characters From A String In Sql Server 2005

May 16, 2007

Hi to all,
I am having a string like  (234) 522-4342.
i have to remove the non numeric characters from the above string.
Please help me in this regards.
Thanks in advance.
M.ArulMani
 
 

View 2 Replies View Related

A Simple Question On The Connection String Format On Sql Server 2005!

Feb 22, 2006

Hi everyone!
I am new to visual studio 2005 and sql server 2005.
Up to now i was using visual studio 2003 and ms access.

When i wanted to create  a web application that communicates with
an access database,  i just had to take the *.mdb file and put it
into a specific folder inside my application's folder and then use
Server.MapPath on the connection string (so it can run on any pc).

Now, i want to do the same with sql server 2005 and visual studio 2005.
I use the connection string: "Server=MYSERVER;Initial
Catalog=test_db;Integrated Security=SSPI".

My problems are:
1) Can i just take the *.mdf file put it inside the App_Data folder like i did on access?
2) What should be the connection string so that my application can run on any pc (with sql server 2005)?

Thanx in advance guys!

View 1 Replies View Related

Do I Need To Change Connection String If I Upgrage SQL Server From 2000 To 2005?

Apr 5, 2006

Do I need to change connection string if I upgrage SQL server from 2000 to 2005 in ASP.NET 2.0?

View 1 Replies View Related

How To Set Connection String Value By Using SET Switch Of Dtexec Sql Server 2005 Command

May 2, 2007

hi

I need to load a text file into sql server table using SSIS package.

the idea is to load this file with the help of dtexec command by giving the file path and name in the SET switch of dtexec command.



anyone having an idea; would be of great help.

Regards,

Salman Shehbaz.

View 4 Replies View Related

[OT] User-Defined String Functions MS SQL Server 2005 Transact-SQL SQLCLR .Net

Feb 7, 2006

User-Defined string Functions MS SQL Server 2005 Transact-SQL SQLCLR (VB. Net, C#.Net, C++. Net)

Ladies and Gentlemen,

I am pleased to offer, free of charge, the following string functions MS SQL Server 2005 Transact-SQL SQLCLR (VB. Net, C#.Net, C++. Net):

AT(): Returns the beginning numeric position of the nth occurrence of a character expression within another character expression, counting from the leftmost character.
RAT(): Returns the numeric position of the last (rightmost) occurrence of a character string within another character string.
OCCURS(): Returns the number of times a character expression occurs within another character expression (including overlaps).
OCCURS2(): Returns the number of times a character expression occurs within another character expression (excluding overlaps).
PADL(): Returns a string from an expression, padded with spaces or characters to a specified length on the left side.
PADR(): Returns a string from an expression, padded with spaces or characters to a specified length on the right side.
PADC(): Returns a string from an expression, padded with spaces or characters to a specified length on the both sides.
CHRTRAN(): Replaces each character in a character expression that matches a character in a second character expression with the corresponding character in a third character expression.
STRTRAN(): Searches a character expression for occurrences of a second character expression, and then replaces each occurrence with a third character expression. Unlike a built-in function Replace, STRTRAN has three additional parameters.
STRFILTER(): Removes all characters from a string except those specified.
GETWORDCOUNT(): Counts the words in a string.
GETWORDNUM(): Returns a specified word from a string.
GETALLWORDS(): Inserts the words from a string into the table.
PROPER(): Returns from a character expression a string capitalized as appropriate for proper names.
RCHARINDEX(): Similar to the Transact-SQL function Charindex, with a Right search.
ARABTOROMAN(): Returns the character Roman numeral equivalent of a specified numeric expression (from 1 to 3999).
ROMANTOARAB(): Returns the number equivalent of a specified character Roman numeral expression (from I to MMMCMXCIX).

AT, PADL, PADR, CHRTRAN, PROPER: Similar to the Oracle functions PL/SQL INSTR, LPAD, RPAD, TRANSLATE, INITCAP.

Plus, there are CHM files in English, French, Spanish, German and Russian.

Plus, there are versions for MS SQL SERVER, SYBASE ASA, DB2, Oracle.

More than 8000 people have already downloaded my functions. I hope you will find them useful as well.

For more information about string UDFs MS SQL Server 2005 Transact-SQL SQLCLR (VB. Net, C#.Net, C++. Net) please visit the
http://www.universalthread.com/wconnect/wc.dll?LevelExtreme~2,54,33,29527

Please, download the file
http://www.universalthread.com/wconnect/wc.dll?LevelExtreme~2,2,29527

With the best regards.

View 1 Replies View Related

CONNECTION STRING TO A REMOTE SERVER WITH SQL EXPRESS 2005, FIXED IP ADDRESS

Jan 28, 2008



I'M HAVING AN ISSUE, UNDERSTANDING, THE CONNECTION STRING.
I WANT TO CONNECT TO AN INSTANCE OF SQLEXPRESS ON A REMOTE SERVER WITH A FIXED IP ADDRESS
THE TCP PORT IS OPEN TO 1433
I OPENED THE PORT ON THE ROUTER AND THE WINDOWS 2003 FIREWALL

MY CODE IS AS FOLLOWS:
S = "Provider=SQLNCLI;"
S = S & "DATA SOURCE=44.66.777.888,1433SQLEXPRESS;"
S = S & "INITIAL CATALOG=TESTDB;"
S = S & "Persist Security Info=false;"
S = S & "UID=TEST999;"
S = S & "Pwd="TEST999888;"
CnMgt.ConnectionString = S
CnMgt.Open S

I'VE FOLLOWED THE STEPS OUTLINED IN ARTICLE 914277

CAN SOMEONE HELP?
THANK YOU


PS. IF THE CLIENT IS LOCAL, I HAVE NO ISSUE OPENING THE DATABASE.
I DO NEED TO OPEN THE DB FROM FROM CLIENTS.

View 5 Replies View Related

Call Vb.Net Developed Dll In SQL Server 2005 With Configuration Level 80 Then Gets Error Invalid Class String

Jul 14, 2006

Hi,
I want to call a dll from Stored procedure developed in SQL Server 2005 at configuration level 80. but when I execute the stored procedure I get the following error.

Error Source: ODSOLE Extended Procedure
Description: Invalid class string

Code of stored procedure and vb.net class is given below:

VB.Net
Imports System
Imports System.IO
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Imports Microsoft.VisualBasic
Imports System.Diagnostics

Public Class PositivePay

Public Shared Sub LogToTextFile(ByVal LogName As String, ByVal newMessage As String)
' impersonate the calling user
Dim newContext As System.Security.Principal.WindowsImpersonationContext
newContext = SqlContext.WindowsIdentity.Impersonate()
Try
Dim w As StreamWriter = File.AppendText(LogName)
LogIt(newMessage, w)
w.Close()
Catch Ex As Exception

Finally
newContext.Undo()
End Try
End Sub
End Class
===============================================================

STORED PROCEDURE
Create PROCEDURE [dbo].[PPGenerateFile]
AS

BEGIN
Declare @retVal INT
Declare @comHandler INT
declare @errorSource nvarchar(500)
declare @errorDescription nvarchar(500)
declare @retString nvarchar(100)

-- Intialize the COM component
EXEC @retVal = sp_OACreate 'PositivePay.class', @comHandler OUTPUT
IF(@retVal <> 0)
BEGIN
--Trap errors if any
EXEC sp_OAGetErrorInfo @comHandler,@errorSource OUTPUT, @errorDescription OUTPUT
SELECT [error source] = @errorsource, [Description] = @errordescription
Return
END

-- Call a method into the component
EXEC @retVal = sp_OAMethod @comHandler,'LogToTextFile',@retString OUTPUT, @LogName = 'D: ext.txt',@newMessage='Hello'
IF (@retVal <>0 )
BEGIN
EXEC sp_OAGetErrorInfo @comHandler,@errorSource OUTPUT, @errorDescription OUTPUT
SELECT [error source] = @errorsource, [Description] = @errordescription
Return
END
select @retString

END

View 6 Replies View Related

Connection String For Default Instance Of SQL Server 2005, On A Box Also Running A Named Instance Of SQL Server 2000

Nov 15, 2007

The box I am trying to connect to is running two instances of SQL Server.
There is a SQL Server 2005 instance which is the default. There is a SQL Server 2000 instance which is named 'SQLSERVER'.
 I can connect to the SQL Server 2000 instance no problem:<add key="ConnectionString" value="server=MYPCSQLSERVER;database=mydatabase;user id=****;password=****" />
However,  I am having trouble connecting to the Default SQL Server 2005 instance. I have tried:
<add key="ConnectionString" value="server=MYPC;database=mydatabase;user id=****;password=****" />
 but it doesn't work. I have tried explicitly setting SQL Server 2005 to use port 1434 (as SQL Server 2000 is running on port 1433), and then used:
<add key="ConnectionString" value="server=MYPC,1434;database=mydatabase;user id=****;password=****" />
but this doesn't work either.
 
Am I mssing something here? Any help much appreciated
Thanks...
 

View 2 Replies View Related

SQL Server 2008 :: Search Each And Every String In Comma Delimited String Input (AND Condition)

Mar 10, 2015

I have a scenario where in I need to use a comma delimited string as input. And search the tables with each and every string in the comma delimited string.

Example:
DECLARE @StrInput NVARCHAR(2000) = '.NET,Java, Python'

SELECT * FROM TABLE WHERE titleName = '.NET' AND titleName='java' AND titleName = 'Python'

As shown in the example above I need to take the comma delimited string as input and search each individual string like in the select statement.

View 3 Replies View Related

SQL Server 2012 :: Finding Longest String Within A String Field

Mar 20, 2014

We have some URLs within a bulk block of text some of which are very long. I need to identify rows where such urls exceed say 100 characters in length in amongst other text.So the rule would be return a record if within the string there is a string (without spaces) longer than 100 characters.

View 9 Replies View Related

SQL Server 2014 :: Find String With Spaces And Replace Them With Other String

Sep 8, 2015

I have following query which return me SP/Views and Functions script using:

select DEFINITION FROM .SYS.SQL_MODULESNow, the result looks like
Create proc
create procedure
create proc
create view
create function

I need its result as:

Alter Procedure
Alter Procedure
Alter Procedure
Alter View
Alter Function

I used following

select replace(replace(replace(DEFINITION,'CREATE PROCEDURE','Alter Procedure'), 'create proc','Alter Procedure'),'create view','Alter View') FROM .SYS.SQL_MODULESto but it is checking fixed space like create<space>proc, how can i check if there are two or more spaces in between create view or create proc or create function, it should replace as i want?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved