Showing posts with label via. Show all posts
Showing posts with label via. Show all posts
Wednesday, March 28, 2012
Help getting linked server to work using multiprotocol!
I'm trying to get two servers to connect via Linked servers using multiprotocol instead of TCP/IP. I can make a Server registration fine using the multiprotocol alias I created in Client Network Utility. I'm not sure how to fill out the linked server properties to make this work with Multiprotocol. It works fine with TCP/IP. Can anyone help?I should add I'm trying to connect two sql 7 servers.|||anyone?
Wednesday, March 21, 2012
help connecting via vbscript to sql 2005 express edition
Hi guys,
I need to connect to a newly created sql 2005 express edition database.
I tried to recycle the connection string used with sql 2000 server but
it doesn't work anymore:
dbConn.Connectionstring="DRIVER=SQL
Server;Trusted_Connection=Yes;DATABASE=" & sSQLDB & ";SERVER=" &
sSQLServer
database, ssqldb and ssqlserver are variables that correspond to
database names, table names, ecc.
IP and NamedPipes are enabled, so are remote connections (I'm actually
trying this from the same computer).
Any help ?Try specifying:
DRIVER={SQL Server};
Notice the parenthesis.
http://www.connectionstrings.com/
http://www.carlprothman.net/Default.aspx?tabid=81
<zerbie45@.gmail.com> wrote in message
news:1140536817.286087.242470@.g47g2000cwa.googlegroups.com...
> Hi guys,
> I need to connect to a newly created sql 2005 express edition database.
> I tried to recycle the connection string used with sql 2000 server but
> it doesn't work anymore:
> dbConn.Connectionstring="DRIVER=SQL
> Server;Trusted_Connection=Yes;DATABASE=" & sSQLDB & ";SERVER=" &
> sSQLServer
> database, ssqldb and ssqlserver are variables that correspond to
> database names, table names, ecc.
> IP and NamedPipes are enabled, so are remote connections (I'm actually
> trying this from the same computer).
> Any help ?
>|||Where are you trying to connect from? Are you sure the app code is running
as a windows authenticated user that has been granted access to the
database?
Also, I would use (more out of habit than anything):
"Provider=SQLOLEDB.1; Data Source=" & sSQLServer & "; Initial Catalog=" &
sSQLDB & "; Trusted_Connection=Yes;"
And I would try using SQL Authentication first, because you would have had
to do a lot more on purpose in order to get a trusted connection working.
<zerbie45@.gmail.com> wrote in message
news:1140536817.286087.242470@.g47g2000cwa.googlegroups.com...
> Hi guys,
> I need to connect to a newly created sql 2005 express edition database.
> I tried to recycle the connection string used with sql 2000 server but
> it doesn't work anymore:
> dbConn.Connectionstring="DRIVER=SQL
> Server;Trusted_Connection=Yes;DATABASE=" & sSQLDB & ";SERVER=" &
> sSQLServer
> database, ssqldb and ssqlserver are variables that correspond to
> database names, table names, ecc.
> IP and NamedPipes are enabled, so are remote connections (I'm actually
> trying this from the same computer).
> Any help ?
>|||Thanks for your answers. I'll give it a try tomorrow at work.
I'm actually trying to connect from the same machine where sql server
2005 express ed is installed. Sql server is using windows auth (I tried
configuring it to use both windows auth and sql auth). The user is
domain administrator, so it should not be a permission issue.
Thanks again for your attention.
I need to connect to a newly created sql 2005 express edition database.
I tried to recycle the connection string used with sql 2000 server but
it doesn't work anymore:
dbConn.Connectionstring="DRIVER=SQL
Server;Trusted_Connection=Yes;DATABASE=" & sSQLDB & ";SERVER=" &
sSQLServer
database, ssqldb and ssqlserver are variables that correspond to
database names, table names, ecc.
IP and NamedPipes are enabled, so are remote connections (I'm actually
trying this from the same computer).
Any help ?Try specifying:
DRIVER={SQL Server};
Notice the parenthesis.
http://www.connectionstrings.com/
http://www.carlprothman.net/Default.aspx?tabid=81
<zerbie45@.gmail.com> wrote in message
news:1140536817.286087.242470@.g47g2000cwa.googlegroups.com...
> Hi guys,
> I need to connect to a newly created sql 2005 express edition database.
> I tried to recycle the connection string used with sql 2000 server but
> it doesn't work anymore:
> dbConn.Connectionstring="DRIVER=SQL
> Server;Trusted_Connection=Yes;DATABASE=" & sSQLDB & ";SERVER=" &
> sSQLServer
> database, ssqldb and ssqlserver are variables that correspond to
> database names, table names, ecc.
> IP and NamedPipes are enabled, so are remote connections (I'm actually
> trying this from the same computer).
> Any help ?
>|||Where are you trying to connect from? Are you sure the app code is running
as a windows authenticated user that has been granted access to the
database?
Also, I would use (more out of habit than anything):
"Provider=SQLOLEDB.1; Data Source=" & sSQLServer & "; Initial Catalog=" &
sSQLDB & "; Trusted_Connection=Yes;"
And I would try using SQL Authentication first, because you would have had
to do a lot more on purpose in order to get a trusted connection working.
<zerbie45@.gmail.com> wrote in message
news:1140536817.286087.242470@.g47g2000cwa.googlegroups.com...
> Hi guys,
> I need to connect to a newly created sql 2005 express edition database.
> I tried to recycle the connection string used with sql 2000 server but
> it doesn't work anymore:
> dbConn.Connectionstring="DRIVER=SQL
> Server;Trusted_Connection=Yes;DATABASE=" & sSQLDB & ";SERVER=" &
> sSQLServer
> database, ssqldb and ssqlserver are variables that correspond to
> database names, table names, ecc.
> IP and NamedPipes are enabled, so are remote connections (I'm actually
> trying this from the same computer).
> Any help ?
>|||Thanks for your answers. I'll give it a try tomorrow at work.
I'm actually trying to connect from the same machine where sql server
2005 express ed is installed. Sql server is using windows auth (I tried
configuring it to use both windows auth and sql auth). The user is
domain administrator, so it should not be a permission issue.
Thanks again for your attention.
Monday, March 12, 2012
Help ! Error after (windows update) of .NET Framework
Hi all,
today i updated my .NET framework to 1.1 SP 1 (via windows update).
After than, my reporting services failed with the error key
"rsReportServerDisabled".
I have just a german full error message, but it is something with
"...decode symetric key ...". I use Win XP Professional as operating system.
Please apologize my english.
Thank your help in advance.
ThomasMost likely the ASP.NET account got reset. If you have the encryption key
saved, you can restore it using rskeymgmt. If not, you will need to reset
the encryption via rskeymgmt -d.
--
Brian Welcker
Group Program Manager
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Thomas" <Thomas@.discussions.microsoft.com> wrote in message
news:D5EEE105-6F19-411C-A820-FBCE3940E699@.microsoft.com...
> Hi all,
> today i updated my .NET framework to 1.1 SP 1 (via windows update).
> After than, my reporting services failed with the error key
> "rsReportServerDisabled".
> I have just a german full error message, but it is something with
> "...decode symetric key ...". I use Win XP Professional as operating
> system.
> Please apologize my english.
> Thank your help in advance.
> Thomas
>
>|||I just tried it and you will probably also need to reconfigure the
connection string via rsconfig before you restore the encryption key.
--
Brian Welcker
Group Program Manager
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian Welcker [MSFT]" <bwelcker@.online.microsoft.com> wrote in message
news:uCvrjDElEHA.3428@.TK2MSFTNGP14.phx.gbl...
> Most likely the ASP.NET account got reset. If you have the encryption key
> saved, you can restore it using rskeymgmt. If not, you will need to reset
> the encryption via rskeymgmt -d.
> --
> Brian Welcker
> Group Program Manager
> SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Thomas" <Thomas@.discussions.microsoft.com> wrote in message
> news:D5EEE105-6F19-411C-A820-FBCE3940E699@.microsoft.com...
>> Hi all,
>> today i updated my .NET framework to 1.1 SP 1 (via windows update).
>> After than, my reporting services failed with the error key
>> "rsReportServerDisabled".
>> I have just a german full error message, but it is something with
>> "...decode symetric key ...". I use Win XP Professional as operating
>> system.
>> Please apologize my english.
>> Thank your help in advance.
>> Thomas
>>
>>
>|||OK, one more correction. :) I was told by the developers that you won't need
to restore the encryption key. After resetting the connection string, you
just need to do an rsactivate -r -c and things will start working again.
--
Brian Welcker
Group Program Manager
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian Welcker [MSFT]" <bwelcker@.online.microsoft.com> wrote in message
news:ePMQzNFlEHA.3452@.TK2MSFTNGP15.phx.gbl...
>I just tried it and you will probably also need to reconfigure the
>connection string via rsconfig before you restore the encryption key.
> --
> Brian Welcker
> Group Program Manager
> SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Brian Welcker [MSFT]" <bwelcker@.online.microsoft.com> wrote in message
> news:uCvrjDElEHA.3428@.TK2MSFTNGP14.phx.gbl...
>> Most likely the ASP.NET account got reset. If you have the encryption key
>> saved, you can restore it using rskeymgmt. If not, you will need to reset
>> the encryption via rskeymgmt -d.
>> --
>> Brian Welcker
>> Group Program Manager
>> SQL Server Reporting Services
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "Thomas" <Thomas@.discussions.microsoft.com> wrote in message
>> news:D5EEE105-6F19-411C-A820-FBCE3940E699@.microsoft.com...
>> Hi all,
>> today i updated my .NET framework to 1.1 SP 1 (via windows update).
>> After than, my reporting services failed with the error key
>> "rsReportServerDisabled".
>> I have just a german full error message, but it is something with
>> "...decode symetric key ...". I use Win XP Professional as operating
>> system.
>> Please apologize my english.
>> Thank your help in advance.
>> Thomas
>>
>>
>>
>|||Thank you Brian !
I will try it at once...
Best regards from Germany
Thomas
"Brian Welcker [MSFT]" wrote:
> OK, one more correction. :) I was told by the developers that you won't need
> to restore the encryption key. After resetting the connection string, you
> just need to do an rsactivate -r -c and things will start working again.
> --
> Brian Welcker
> Group Program Manager
> SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Brian Welcker [MSFT]" <bwelcker@.online.microsoft.com> wrote in message
> news:ePMQzNFlEHA.3452@.TK2MSFTNGP15.phx.gbl...
> >I just tried it and you will probably also need to reconfigure the
> >connection string via rsconfig before you restore the encryption key.
> >
> > --
> > Brian Welcker
> > Group Program Manager
> > SQL Server Reporting Services
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> >
> > "Brian Welcker [MSFT]" <bwelcker@.online.microsoft.com> wrote in message
> > news:uCvrjDElEHA.3428@.TK2MSFTNGP14.phx.gbl...
> >> Most likely the ASP.NET account got reset. If you have the encryption key
> >> saved, you can restore it using rskeymgmt. If not, you will need to reset
> >> the encryption via rskeymgmt -d.
> >>
> >> --
> >> Brian Welcker
> >> Group Program Manager
> >> SQL Server Reporting Services
> >>
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >>
> >> "Thomas" <Thomas@.discussions.microsoft.com> wrote in message
> >> news:D5EEE105-6F19-411C-A820-FBCE3940E699@.microsoft.com...
> >> Hi all,
> >> today i updated my .NET framework to 1.1 SP 1 (via windows update).
> >> After than, my reporting services failed with the error key
> >> "rsReportServerDisabled".
> >> I have just a german full error message, but it is something with
> >> "...decode symetric key ...". I use Win XP Professional as operating
> >> system.
> >> Please apologize my english.
> >>
> >> Thank your help in advance.
> >> Thomas
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
>
>
today i updated my .NET framework to 1.1 SP 1 (via windows update).
After than, my reporting services failed with the error key
"rsReportServerDisabled".
I have just a german full error message, but it is something with
"...decode symetric key ...". I use Win XP Professional as operating system.
Please apologize my english.
Thank your help in advance.
ThomasMost likely the ASP.NET account got reset. If you have the encryption key
saved, you can restore it using rskeymgmt. If not, you will need to reset
the encryption via rskeymgmt -d.
--
Brian Welcker
Group Program Manager
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Thomas" <Thomas@.discussions.microsoft.com> wrote in message
news:D5EEE105-6F19-411C-A820-FBCE3940E699@.microsoft.com...
> Hi all,
> today i updated my .NET framework to 1.1 SP 1 (via windows update).
> After than, my reporting services failed with the error key
> "rsReportServerDisabled".
> I have just a german full error message, but it is something with
> "...decode symetric key ...". I use Win XP Professional as operating
> system.
> Please apologize my english.
> Thank your help in advance.
> Thomas
>
>|||I just tried it and you will probably also need to reconfigure the
connection string via rsconfig before you restore the encryption key.
--
Brian Welcker
Group Program Manager
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian Welcker [MSFT]" <bwelcker@.online.microsoft.com> wrote in message
news:uCvrjDElEHA.3428@.TK2MSFTNGP14.phx.gbl...
> Most likely the ASP.NET account got reset. If you have the encryption key
> saved, you can restore it using rskeymgmt. If not, you will need to reset
> the encryption via rskeymgmt -d.
> --
> Brian Welcker
> Group Program Manager
> SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Thomas" <Thomas@.discussions.microsoft.com> wrote in message
> news:D5EEE105-6F19-411C-A820-FBCE3940E699@.microsoft.com...
>> Hi all,
>> today i updated my .NET framework to 1.1 SP 1 (via windows update).
>> After than, my reporting services failed with the error key
>> "rsReportServerDisabled".
>> I have just a german full error message, but it is something with
>> "...decode symetric key ...". I use Win XP Professional as operating
>> system.
>> Please apologize my english.
>> Thank your help in advance.
>> Thomas
>>
>>
>|||OK, one more correction. :) I was told by the developers that you won't need
to restore the encryption key. After resetting the connection string, you
just need to do an rsactivate -r -c and things will start working again.
--
Brian Welcker
Group Program Manager
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian Welcker [MSFT]" <bwelcker@.online.microsoft.com> wrote in message
news:ePMQzNFlEHA.3452@.TK2MSFTNGP15.phx.gbl...
>I just tried it and you will probably also need to reconfigure the
>connection string via rsconfig before you restore the encryption key.
> --
> Brian Welcker
> Group Program Manager
> SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Brian Welcker [MSFT]" <bwelcker@.online.microsoft.com> wrote in message
> news:uCvrjDElEHA.3428@.TK2MSFTNGP14.phx.gbl...
>> Most likely the ASP.NET account got reset. If you have the encryption key
>> saved, you can restore it using rskeymgmt. If not, you will need to reset
>> the encryption via rskeymgmt -d.
>> --
>> Brian Welcker
>> Group Program Manager
>> SQL Server Reporting Services
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "Thomas" <Thomas@.discussions.microsoft.com> wrote in message
>> news:D5EEE105-6F19-411C-A820-FBCE3940E699@.microsoft.com...
>> Hi all,
>> today i updated my .NET framework to 1.1 SP 1 (via windows update).
>> After than, my reporting services failed with the error key
>> "rsReportServerDisabled".
>> I have just a german full error message, but it is something with
>> "...decode symetric key ...". I use Win XP Professional as operating
>> system.
>> Please apologize my english.
>> Thank your help in advance.
>> Thomas
>>
>>
>>
>|||Thank you Brian !
I will try it at once...
Best regards from Germany
Thomas
"Brian Welcker [MSFT]" wrote:
> OK, one more correction. :) I was told by the developers that you won't need
> to restore the encryption key. After resetting the connection string, you
> just need to do an rsactivate -r -c and things will start working again.
> --
> Brian Welcker
> Group Program Manager
> SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Brian Welcker [MSFT]" <bwelcker@.online.microsoft.com> wrote in message
> news:ePMQzNFlEHA.3452@.TK2MSFTNGP15.phx.gbl...
> >I just tried it and you will probably also need to reconfigure the
> >connection string via rsconfig before you restore the encryption key.
> >
> > --
> > Brian Welcker
> > Group Program Manager
> > SQL Server Reporting Services
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> >
> > "Brian Welcker [MSFT]" <bwelcker@.online.microsoft.com> wrote in message
> > news:uCvrjDElEHA.3428@.TK2MSFTNGP14.phx.gbl...
> >> Most likely the ASP.NET account got reset. If you have the encryption key
> >> saved, you can restore it using rskeymgmt. If not, you will need to reset
> >> the encryption via rskeymgmt -d.
> >>
> >> --
> >> Brian Welcker
> >> Group Program Manager
> >> SQL Server Reporting Services
> >>
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >>
> >> "Thomas" <Thomas@.discussions.microsoft.com> wrote in message
> >> news:D5EEE105-6F19-411C-A820-FBCE3940E699@.microsoft.com...
> >> Hi all,
> >> today i updated my .NET framework to 1.1 SP 1 (via windows update).
> >> After than, my reporting services failed with the error key
> >> "rsReportServerDisabled".
> >> I have just a german full error message, but it is something with
> >> "...decode symetric key ...". I use Win XP Professional as operating
> >> system.
> >> Please apologize my english.
> >>
> >> Thank your help in advance.
> >> Thomas
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
>
>
Friday, February 24, 2012
help
how can i get the result .....A B
JOHN N
OHN HN
HN OHN
N JOHN
where JOHN is an employee in emp table...
Message posted via http://www.droptable.com
The example below uses a derived table containing numbers up to the maximum
size for the FirstName column. You might consider creating a general
purpose permanent table if this is the sort of thing you do often.
SELECT
SUBSTRING(FirstName, Position, LEN(FirstName) - Position + 1) AS A,
RIGHT(FirstName, Position) AS B
FROM dbo.emp
CROSS JOIN (
SELECT 1 AS Position
UNION ALL SELECT 2
UNION ALL SELECT 3
UNION ALL SELECT 4
UNION ALL SELECT 5
UNION ALL SELECT 6
UNION ALL SELECT 7
UNION ALL SELECT 8
UNION ALL SELECT 9
UNION ALL SELECT 10 AS Position) AS Positions
WHERE
FirstName = 'JOHN' AND
Position <= LEN(FirstName)
Hope this helps.
Dan Guzman
SQL Server MVP
"Nishu via droptable.com" <u30587@.uwe> wrote in message
news:6d33e7a43e7ba@.uwe...
> how can i get the result .....A B
> JOHN N
> OHN HN
> HN OHN
> N JOHN
>
>
> where JOHN is an employee in emp table...
> --
> Message posted via http://www.droptable.com
>
|||This assumes a table of integers named Numbers with values that at
least cover the range from 1 to the maximum length of the name.
SELECT RIGHT(E.employee, LEN(E.employee) - N.Nbr + 1),
RIGHT(E.employee, N.Nbr)
FROM Emp as E
JOIN Numbers as N
ON N.Nbr between 1 and LEN(E.employee)
Roy Harvey
Beacon Falls, CT
On Fri, 02 Feb 2007 12:18:38 GMT, "Nishu via droptable.com"
<u30587@.uwe> wrote:
>how can i get the result .....A B
> JOHN N
> OHN HN
> HN OHN
> N JOHN
>
>
>where JOHN is an employee in emp table...
|||thanx roy,it worked well..
Roy Harvey wrote:[vbcol=seagreen]
>This assumes a table of integers named Numbers with values that at
>least cover the range from 1 to the maximum length of the name.
>SELECT RIGHT(E.employee, LEN(E.employee) - N.Nbr + 1),
> RIGHT(E.employee, N.Nbr)
> FROM Emp as E
> JOIN Numbers as N
> ON N.Nbr between 1 and LEN(E.employee)
>Roy Harvey
>Beacon Falls, CT
>[quoted text clipped - 3 lines]
Message posted via http://www.droptable.com
|||thnx dan
Dan Guzman wrote:[vbcol=seagreen]
>The example below uses a derived table containing numbers up to the maximum
>size for the FirstName column. You might consider creating a general
>purpose permanent table if this is the sort of thing you do often.
>SELECT
> SUBSTRING(FirstName, Position, LEN(FirstName) - Position + 1) AS A,
> RIGHT(FirstName, Position) AS B
>FROM dbo.emp
>CROSS JOIN (
> SELECT 1 AS Position
> UNION ALL SELECT 2
> UNION ALL SELECT 3
> UNION ALL SELECT 4
> UNION ALL SELECT 5
> UNION ALL SELECT 6
> UNION ALL SELECT 7
> UNION ALL SELECT 8
> UNION ALL SELECT 9
> UNION ALL SELECT 10 AS Position) AS Positions
>WHERE
> FirstName = 'JOHN' AND
> Position <= LEN(FirstName)
>[quoted text clipped - 3 lines]
Message posted via http://www.droptable.com
JOHN N
OHN HN
HN OHN
N JOHN
where JOHN is an employee in emp table...
Message posted via http://www.droptable.com
The example below uses a derived table containing numbers up to the maximum
size for the FirstName column. You might consider creating a general
purpose permanent table if this is the sort of thing you do often.
SELECT
SUBSTRING(FirstName, Position, LEN(FirstName) - Position + 1) AS A,
RIGHT(FirstName, Position) AS B
FROM dbo.emp
CROSS JOIN (
SELECT 1 AS Position
UNION ALL SELECT 2
UNION ALL SELECT 3
UNION ALL SELECT 4
UNION ALL SELECT 5
UNION ALL SELECT 6
UNION ALL SELECT 7
UNION ALL SELECT 8
UNION ALL SELECT 9
UNION ALL SELECT 10 AS Position) AS Positions
WHERE
FirstName = 'JOHN' AND
Position <= LEN(FirstName)
Hope this helps.
Dan Guzman
SQL Server MVP
"Nishu via droptable.com" <u30587@.uwe> wrote in message
news:6d33e7a43e7ba@.uwe...
> how can i get the result .....A B
> JOHN N
> OHN HN
> HN OHN
> N JOHN
>
>
> where JOHN is an employee in emp table...
> --
> Message posted via http://www.droptable.com
>
|||This assumes a table of integers named Numbers with values that at
least cover the range from 1 to the maximum length of the name.
SELECT RIGHT(E.employee, LEN(E.employee) - N.Nbr + 1),
RIGHT(E.employee, N.Nbr)
FROM Emp as E
JOIN Numbers as N
ON N.Nbr between 1 and LEN(E.employee)
Roy Harvey
Beacon Falls, CT
On Fri, 02 Feb 2007 12:18:38 GMT, "Nishu via droptable.com"
<u30587@.uwe> wrote:
>how can i get the result .....A B
> JOHN N
> OHN HN
> HN OHN
> N JOHN
>
>
>where JOHN is an employee in emp table...
|||thanx roy,it worked well..

Roy Harvey wrote:[vbcol=seagreen]
>This assumes a table of integers named Numbers with values that at
>least cover the range from 1 to the maximum length of the name.
>SELECT RIGHT(E.employee, LEN(E.employee) - N.Nbr + 1),
> RIGHT(E.employee, N.Nbr)
> FROM Emp as E
> JOIN Numbers as N
> ON N.Nbr between 1 and LEN(E.employee)
>Roy Harvey
>Beacon Falls, CT
>[quoted text clipped - 3 lines]
Message posted via http://www.droptable.com
|||thnx dan

Dan Guzman wrote:[vbcol=seagreen]
>The example below uses a derived table containing numbers up to the maximum
>size for the FirstName column. You might consider creating a general
>purpose permanent table if this is the sort of thing you do often.
>SELECT
> SUBSTRING(FirstName, Position, LEN(FirstName) - Position + 1) AS A,
> RIGHT(FirstName, Position) AS B
>FROM dbo.emp
>CROSS JOIN (
> SELECT 1 AS Position
> UNION ALL SELECT 2
> UNION ALL SELECT 3
> UNION ALL SELECT 4
> UNION ALL SELECT 5
> UNION ALL SELECT 6
> UNION ALL SELECT 7
> UNION ALL SELECT 8
> UNION ALL SELECT 9
> UNION ALL SELECT 10 AS Position) AS Positions
>WHERE
> FirstName = 'JOHN' AND
> Position <= LEN(FirstName)
>[quoted text clipped - 3 lines]
Message posted via http://www.droptable.com
help
how can i get the result .....A B
JOHN N
OHN HN
HN OHN
N JOHN
where JOHN is an employee in emp table...
Message posted via http://www.droptable.comThe example below uses a derived table containing numbers up to the maximum
size for the FirstName column. You might consider creating a general
purpose permanent table if this is the sort of thing you do often.
SELECT
SUBSTRING(FirstName, Position, LEN(FirstName) - Position + 1) AS A,
RIGHT(FirstName, Position) AS B
FROM dbo.emp
CROSS JOIN (
SELECT 1 AS Position
UNION ALL SELECT 2
UNION ALL SELECT 3
UNION ALL SELECT 4
UNION ALL SELECT 5
UNION ALL SELECT 6
UNION ALL SELECT 7
UNION ALL SELECT 8
UNION ALL SELECT 9
UNION ALL SELECT 10 AS Position) AS Positions
WHERE
FirstName = 'JOHN' AND
Position <= LEN(FirstName)
Hope this helps.
Dan Guzman
SQL Server MVP
"Nishu via droptable.com" <u30587@.uwe> wrote in message
news:6d33e7a43e7ba@.uwe...
> how can i get the result .....A B
> JOHN N
> OHN HN
> HN OHN
> N JOHN
>
>
> where JOHN is an employee in emp table...
> --
> Message posted via http://www.droptable.com
>|||This assumes a table of integers named Numbers with values that at
least cover the range from 1 to the maximum length of the name.
SELECT RIGHT(E.employee, LEN(E.employee) - N.Nbr + 1),
RIGHT(E.employee, N.Nbr)
FROM Emp as E
JOIN Numbers as N
ON N.Nbr between 1 and LEN(E.employee)
Roy Harvey
Beacon Falls, CT
On Fri, 02 Feb 2007 12:18:38 GMT, "Nishu via droptable.com"
<u30587@.uwe> wrote:
>how can i get the result .....A B
> JOHN N
> OHN HN
> HN OHN
> N JOHN
>
>
>where JOHN is an employee in emp table...|||thanx roy,it worked well..
Roy Harvey wrote:[vbcol=seagreen]
>This assumes a table of integers named Numbers with values that at
>least cover the range from 1 to the maximum length of the name.
>SELECT RIGHT(E.employee, LEN(E.employee) - N.Nbr + 1),
> RIGHT(E.employee, N.Nbr)
> FROM Emp as E
> JOIN Numbers as N
> ON N.Nbr between 1 and LEN(E.employee)
>Roy Harvey
>Beacon Falls, CT
>
>[quoted text clipped - 3 lines]
Message posted via http://www.droptable.com|||thnx dan
Dan Guzman wrote:[vbcol=seagreen]
>The example below uses a derived table containing numbers up to the maximum
>size for the FirstName column. You might consider creating a general
>purpose permanent table if this is the sort of thing you do often.
>SELECT
> SUBSTRING(FirstName, Position, LEN(FirstName) - Position + 1) AS A,
> RIGHT(FirstName, Position) AS B
>FROM dbo.emp
>CROSS JOIN (
> SELECT 1 AS Position
> UNION ALL SELECT 2
> UNION ALL SELECT 3
> UNION ALL SELECT 4
> UNION ALL SELECT 5
> UNION ALL SELECT 6
> UNION ALL SELECT 7
> UNION ALL SELECT 8
> UNION ALL SELECT 9
> UNION ALL SELECT 10 AS Position) AS Positions
>WHERE
> FirstName = 'JOHN' AND
> Position <= LEN(FirstName)
>
>[quoted text clipped - 3 lines]
Message posted via http://www.droptable.com
JOHN N
OHN HN
HN OHN
N JOHN
where JOHN is an employee in emp table...
Message posted via http://www.droptable.comThe example below uses a derived table containing numbers up to the maximum
size for the FirstName column. You might consider creating a general
purpose permanent table if this is the sort of thing you do often.
SELECT
SUBSTRING(FirstName, Position, LEN(FirstName) - Position + 1) AS A,
RIGHT(FirstName, Position) AS B
FROM dbo.emp
CROSS JOIN (
SELECT 1 AS Position
UNION ALL SELECT 2
UNION ALL SELECT 3
UNION ALL SELECT 4
UNION ALL SELECT 5
UNION ALL SELECT 6
UNION ALL SELECT 7
UNION ALL SELECT 8
UNION ALL SELECT 9
UNION ALL SELECT 10 AS Position) AS Positions
WHERE
FirstName = 'JOHN' AND
Position <= LEN(FirstName)
Hope this helps.
Dan Guzman
SQL Server MVP
"Nishu via droptable.com" <u30587@.uwe> wrote in message
news:6d33e7a43e7ba@.uwe...
> how can i get the result .....A B
> JOHN N
> OHN HN
> HN OHN
> N JOHN
>
>
> where JOHN is an employee in emp table...
> --
> Message posted via http://www.droptable.com
>|||This assumes a table of integers named Numbers with values that at
least cover the range from 1 to the maximum length of the name.
SELECT RIGHT(E.employee, LEN(E.employee) - N.Nbr + 1),
RIGHT(E.employee, N.Nbr)
FROM Emp as E
JOIN Numbers as N
ON N.Nbr between 1 and LEN(E.employee)
Roy Harvey
Beacon Falls, CT
On Fri, 02 Feb 2007 12:18:38 GMT, "Nishu via droptable.com"
<u30587@.uwe> wrote:
>how can i get the result .....A B
> JOHN N
> OHN HN
> HN OHN
> N JOHN
>
>
>where JOHN is an employee in emp table...|||thanx roy,it worked well..

Roy Harvey wrote:[vbcol=seagreen]
>This assumes a table of integers named Numbers with values that at
>least cover the range from 1 to the maximum length of the name.
>SELECT RIGHT(E.employee, LEN(E.employee) - N.Nbr + 1),
> RIGHT(E.employee, N.Nbr)
> FROM Emp as E
> JOIN Numbers as N
> ON N.Nbr between 1 and LEN(E.employee)
>Roy Harvey
>Beacon Falls, CT
>
>[quoted text clipped - 3 lines]
Message posted via http://www.droptable.com|||thnx dan

Dan Guzman wrote:[vbcol=seagreen]
>The example below uses a derived table containing numbers up to the maximum
>size for the FirstName column. You might consider creating a general
>purpose permanent table if this is the sort of thing you do often.
>SELECT
> SUBSTRING(FirstName, Position, LEN(FirstName) - Position + 1) AS A,
> RIGHT(FirstName, Position) AS B
>FROM dbo.emp
>CROSS JOIN (
> SELECT 1 AS Position
> UNION ALL SELECT 2
> UNION ALL SELECT 3
> UNION ALL SELECT 4
> UNION ALL SELECT 5
> UNION ALL SELECT 6
> UNION ALL SELECT 7
> UNION ALL SELECT 8
> UNION ALL SELECT 9
> UNION ALL SELECT 10 AS Position) AS Positions
>WHERE
> FirstName = 'JOHN' AND
> Position <= LEN(FirstName)
>
>[quoted text clipped - 3 lines]
Message posted via http://www.droptable.com
Sunday, February 19, 2012
help
what is the exact differnece char and varchar in inputwise means(which
one take alphabets and numerics)?
*** Sent via Developersdex http://www.examnotes.net ***Allowed data is the same for both, the difference between them are the
length of the input.
Examples:
DepartmentId dataset
Aabbaa, aabbbb, aabbcc, aabbdd, aabbee.
Expected data is always 6 characters therefore use char - eg char(6).
FirstName dataset
Andrew, Melody Suk Man, Allan, Cathy, Arthur, Shirly, Anthony, Wendy
Expected data can be any length in character therefore just put an
upperbound on it and use varchar - eg. Varchar(30)
Mel
help
how can i get the result .....A B
JOHN N
OHN HN
HN OHN
N JOHN
where JOHN is an employee in emp table...
--
Message posted via http://www.sqlmonster.comThe example below uses a derived table containing numbers up to the maximum
size for the FirstName column. You might consider creating a general
purpose permanent table if this is the sort of thing you do often.
SELECT
SUBSTRING(FirstName, Position, LEN(FirstName) - Position + 1) AS A,
RIGHT(FirstName, Position) AS B
FROM dbo.emp
CROSS JOIN (
SELECT 1 AS Position
UNION ALL SELECT 2
UNION ALL SELECT 3
UNION ALL SELECT 4
UNION ALL SELECT 5
UNION ALL SELECT 6
UNION ALL SELECT 7
UNION ALL SELECT 8
UNION ALL SELECT 9
UNION ALL SELECT 10 AS Position) AS Positions
WHERE
FirstName = 'JOHN' AND
Position <= LEN(FirstName)
Hope this helps.
Dan Guzman
SQL Server MVP
"Nishu via SQLMonster.com" <u30587@.uwe> wrote in message
news:6d33e7a43e7ba@.uwe...
> how can i get the result .....A B
> JOHN N
> OHN HN
> HN OHN
> N JOHN
>
>
> where JOHN is an employee in emp table...
> --
> Message posted via http://www.sqlmonster.com
>|||This assumes a table of integers named Numbers with values that at
least cover the range from 1 to the maximum length of the name.
SELECT RIGHT(E.employee, LEN(E.employee) - N.Nbr + 1),
RIGHT(E.employee, N.Nbr)
FROM Emp as E
JOIN Numbers as N
ON N.Nbr between 1 and LEN(E.employee)
Roy Harvey
Beacon Falls, CT
On Fri, 02 Feb 2007 12:18:38 GMT, "Nishu via SQLMonster.com"
<u30587@.uwe> wrote:
>how can i get the result .....A B
> JOHN N
> OHN HN
> HN OHN
> N JOHN
>
>
>where JOHN is an employee in emp table...|||thanx roy,it worked well..:)
Roy Harvey wrote:
>This assumes a table of integers named Numbers with values that at
>least cover the range from 1 to the maximum length of the name.
>SELECT RIGHT(E.employee, LEN(E.employee) - N.Nbr + 1),
> RIGHT(E.employee, N.Nbr)
> FROM Emp as E
> JOIN Numbers as N
> ON N.Nbr between 1 and LEN(E.employee)
>Roy Harvey
>Beacon Falls, CT
>>how can i get the result .....A B
>> JOHN N
>[quoted text clipped - 3 lines]
>>where JOHN is an employee in emp table...
--
Message posted via http://www.sqlmonster.com|||thnx dan:)
Dan Guzman wrote:
>The example below uses a derived table containing numbers up to the maximum
>size for the FirstName column. You might consider creating a general
>purpose permanent table if this is the sort of thing you do often.
>SELECT
> SUBSTRING(FirstName, Position, LEN(FirstName) - Position + 1) AS A,
> RIGHT(FirstName, Position) AS B
>FROM dbo.emp
>CROSS JOIN (
> SELECT 1 AS Position
> UNION ALL SELECT 2
> UNION ALL SELECT 3
> UNION ALL SELECT 4
> UNION ALL SELECT 5
> UNION ALL SELECT 6
> UNION ALL SELECT 7
> UNION ALL SELECT 8
> UNION ALL SELECT 9
> UNION ALL SELECT 10 AS Position) AS Positions
>WHERE
> FirstName = 'JOHN' AND
> Position <= LEN(FirstName)
>> how can i get the result .....A B
>> JOHN N
>[quoted text clipped - 3 lines]
>> where JOHN is an employee in emp table...
--
Message posted via http://www.sqlmonster.com
JOHN N
OHN HN
HN OHN
N JOHN
where JOHN is an employee in emp table...
--
Message posted via http://www.sqlmonster.comThe example below uses a derived table containing numbers up to the maximum
size for the FirstName column. You might consider creating a general
purpose permanent table if this is the sort of thing you do often.
SELECT
SUBSTRING(FirstName, Position, LEN(FirstName) - Position + 1) AS A,
RIGHT(FirstName, Position) AS B
FROM dbo.emp
CROSS JOIN (
SELECT 1 AS Position
UNION ALL SELECT 2
UNION ALL SELECT 3
UNION ALL SELECT 4
UNION ALL SELECT 5
UNION ALL SELECT 6
UNION ALL SELECT 7
UNION ALL SELECT 8
UNION ALL SELECT 9
UNION ALL SELECT 10 AS Position) AS Positions
WHERE
FirstName = 'JOHN' AND
Position <= LEN(FirstName)
Hope this helps.
Dan Guzman
SQL Server MVP
"Nishu via SQLMonster.com" <u30587@.uwe> wrote in message
news:6d33e7a43e7ba@.uwe...
> how can i get the result .....A B
> JOHN N
> OHN HN
> HN OHN
> N JOHN
>
>
> where JOHN is an employee in emp table...
> --
> Message posted via http://www.sqlmonster.com
>|||This assumes a table of integers named Numbers with values that at
least cover the range from 1 to the maximum length of the name.
SELECT RIGHT(E.employee, LEN(E.employee) - N.Nbr + 1),
RIGHT(E.employee, N.Nbr)
FROM Emp as E
JOIN Numbers as N
ON N.Nbr between 1 and LEN(E.employee)
Roy Harvey
Beacon Falls, CT
On Fri, 02 Feb 2007 12:18:38 GMT, "Nishu via SQLMonster.com"
<u30587@.uwe> wrote:
>how can i get the result .....A B
> JOHN N
> OHN HN
> HN OHN
> N JOHN
>
>
>where JOHN is an employee in emp table...|||thanx roy,it worked well..:)
Roy Harvey wrote:
>This assumes a table of integers named Numbers with values that at
>least cover the range from 1 to the maximum length of the name.
>SELECT RIGHT(E.employee, LEN(E.employee) - N.Nbr + 1),
> RIGHT(E.employee, N.Nbr)
> FROM Emp as E
> JOIN Numbers as N
> ON N.Nbr between 1 and LEN(E.employee)
>Roy Harvey
>Beacon Falls, CT
>>how can i get the result .....A B
>> JOHN N
>[quoted text clipped - 3 lines]
>>where JOHN is an employee in emp table...
--
Message posted via http://www.sqlmonster.com|||thnx dan:)
Dan Guzman wrote:
>The example below uses a derived table containing numbers up to the maximum
>size for the FirstName column. You might consider creating a general
>purpose permanent table if this is the sort of thing you do often.
>SELECT
> SUBSTRING(FirstName, Position, LEN(FirstName) - Position + 1) AS A,
> RIGHT(FirstName, Position) AS B
>FROM dbo.emp
>CROSS JOIN (
> SELECT 1 AS Position
> UNION ALL SELECT 2
> UNION ALL SELECT 3
> UNION ALL SELECT 4
> UNION ALL SELECT 5
> UNION ALL SELECT 6
> UNION ALL SELECT 7
> UNION ALL SELECT 8
> UNION ALL SELECT 9
> UNION ALL SELECT 10 AS Position) AS Positions
>WHERE
> FirstName = 'JOHN' AND
> Position <= LEN(FirstName)
>> how can i get the result .....A B
>> JOHN N
>[quoted text clipped - 3 lines]
>> where JOHN is an employee in emp table...
--
Message posted via http://www.sqlmonster.com
Subscribe to:
Posts (Atom)