Aliasing From 65 To 70
Jul 13, 2000
Hi,
I brought two databases from 65(server1) to 70(server2). Both the servers are having different sort order and character set. So i just generated a script in 65(server1) , and ran the same script in 70 at server2. SO i got all the user objects, permissions and required logins.
But i didn't see the aliases in 70(server2). I have lot of users defined as aliases in 65(server1). SO anyone suggest me how i have to get those aliases. I observer all aliases are having dbo permissions in65(server1).
So i checked all roles including db_owner role in server2(70), but no use.
pls suggest me how i have to get aliases in 70. i know there is no alias concept in 70.
Thank you.
--RK
View 2 Replies
Jun 13, 2000
URGENT HELP NEEDED ASAP!!! In 6.5, you could alias a login as dbo. How do I do this in 7.0?? When assigning ownership to a login, it creates tables with that login as owner rather than dbo as owner. In the online books, info is given about running the sp_addalias in order to do this but my login already has a login name assigned to it in the master databases. Does this have to be updated to dbo before the sp can be run??? Why can't I assign dbo as the loginname when I create the login like in 6.5???
View 4 Replies
View Related
Sep 14, 2004
Hello all,
When I assign an alias name for a table in a select statement, how can I use it after the select statement is executed. I want to accomplish somewhat Like this:-
Declare @name as varchar(20)
Select TOP 1 * from Table1 t1 -- Making sure it returns only one record
Set @name = t1.[Name]
When I do this i get the following error :-
The column prefix 't1' does not match with a table name or alias name used in the query.
Here I would like to get the result set as well as access the values in the result set. By doing this I dont have to execute the Select statement two times for better performance. Is there any way to accomplish this? or in SQL Server are we restricted to such a behavior.
Any input is highly appreciated,
TIA,
darbhas.
View 3 Replies
View Related
Jul 20, 2005
Hi,Here is my original query:select rosterid, lastname, firstname from tableorder by lastnameI would like to use column aliasing to displaylastname, firstname in a column entitled name.I tried the following syntax, but it's not working:select rosterid, lastname+', '+firstname as namefrom tableorder by nameThis results in a 2 column table with the headings "ROSTERID" and"NAME". However, NAME contains th last name only, rather than "lastname,firstname".Any help greatly appreciated.Thanks,Google Jeny*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
View 4 Replies
View Related
Nov 6, 2006
Hi,
I'm trying to write a SQL event (view or storied proceedure). I have a table that is meant for reporting....the data is arranged verticle. I deal in Fiscal Years ie 2006/2007, 2007/2008, ect. The table in question has generic column lables ie FY1, FY2. I'm writing a report off the table and I want to dynamically turn FY1 into the current FiscalYear, FY2 into current FiscalYear + 1. I tried:
SELECT dbo.tblBudgetConfig.CurrentBudgetYear, dbo.tblBudgetProjectedCurrent.FY4 AS Left ([dbo.tblbudgetConfig.CurrentBudgetYear],4)+3 & "/" & Right([dbo.tblbudgetConfig.CurrentBudgetYear],4)+3
FROM dbo.tblBudgetConfig INNER JOIN
dbo.tblBudgetProjectedCurrent ON dbo.tblBudgetConfig.CurrentBudgetYear = dbo.tblBudgetProjectedCurrent.CurrentBudgetYear
But SQL squawks everytime I try this and tells me that there is something a miss near 'Left'.
Any help will be appreciated.
View 4 Replies
View Related
May 18, 2006
I require the column of a nested table (KOL s) as part of the output of my DMX query, which needs to be written out to a relational table. Hence, I flatten the <select_list> of the SELECT DMX query as below:
SELECT FLATTENED
([Speciality].[SPECIALITY ID]) as [Speciality_Id],
(0) as [Bool_NameInAuthors],
(0) as [Bool_EmailInAbstract],
(0) as [Bool_AffiliationInAbstract],
(SELECT ([KOL ID]) as [Id], ([FIRST NAME]) as [FirstName], ([MIDDLE NAME]) as [MiddleName], ([LAST NAME]) as [LastName], ([AFFILIATION]) as [Affiliation], ([EMAILADDRESS]) as [EmailAddress] FROM [Speciality].[KO Ls]),
(SELECT ([Speciality Term DESCRIPTION]) as [Term] FROM [Speciality].[SPECIALITYTERMS]) AS Spec
From
[Speciality]
PREDICTION JOIN
OPENQUERY([ETL Profiler DB],
'SELECT
[SPECIALITY_ID]
FROM
[dbo].[KOLs]
') AS t
ON
[Speciality].[SPECIALITY ID] = t.[SPECIALITY_ID]
However, this causes the subquery columns (ID, FirstName, ...) to be aliased as Expression.ID, Expression.FirstName...
How do I alias these flattened columns properly?
I tried to alias the subquery to a derived table (as follows), but it just replaces the Expression word by the derived table alias (KOL in this case). So, does not solve my problem.
(SELECT ([KOL ID]) as [Id], ([FIRST NAME]) as [FirstName], ([MIDDLE NAME]) as [MiddleName], ([LAST NAME]) as [LastName], ([AFFILIATION]) as [Affiliation], ([EMAILADDRESS]) as [EmailAddress] FROM [Speciality].[KO Ls]) AS KOL
View 1 Replies
View Related
Oct 17, 2007
hi all,
can any body help me on creating alias of SQL Server using script.
thanks in advance
Regards
Ganesh Gorla
View 10 Replies
View Related
Jan 6, 2015
Is there a way in SQL server to alias column names for a particular table and store the aliases somewhere such that you can access the aliases while querying? I have a table where I cannot change column names and I am trying to figure out if there is a way to alias them to make them more user friendly.
View 2 Replies
View Related