SQL 2012 :: Linked Server Naming Convention?

Nov 6, 2015

How do you name sql linked-servers in your company ?

we have many legacy systems (random naming), but mostly newer systems follow this pattern

<ENVIRONMENT><APPLICATION><FUNCTION><VIRTUAL><NUMBER>

e.g.

PRD-FAX-DB-V01, TST-PAY-WEB-P02 etc.

We have link-servers all over the place. The ideal naming convention should satisfy following:

- developers should not have to modify code when deploying between environments DEV->TEST->PROD. This rules out using actual server name as linked-name.

- the name should easily identify actual server without much mental translation. This rules out relevant but generic names like FAXSERVER or PAYSERVER

- also, if the name could state that it is a linked-server e.g starting with LINK_, it works when reading the code.

So, I was thinking the link-name should simply remove the environment :

e.g LINK_FAX_DB_V01

that way, on DEV box, the underlying sql data source could point to the dev server, while on test, it could point to test server etc. without having to change code, and also knowing which server it's pointing to by just adding a TST or PRD in front-of it.

View 0 Replies


ADVERTISEMENT

Naming Convention

Aug 21, 2006

Hi all,
I wanted to ask for the naming conventions in SQL SERVER.as in case of pl/sql server we have ..name_of_package.name_of_procedure thats how we call the procedures i.e. owner of schema then name of package n then procedure name.....i want to ask you all how is it done in SQL SERVER..please try to reply as soon as possible,
i will b waiting for the replies,
regards

View 3 Replies View Related

Naming Convention

May 8, 2006

Would like to know what naming convention you folks use.

What I need specifically is column naming conventions.

For instance, I have a table called 'lst_as400_srvr'. We could go with the vigorous:

CREATE TABLE lst_as400_srvr
(
as400_srvr_idintNOT NULLIDENTITY,
as400_srvr_namevarchar(128)NOT NULL,
as400_srvr_is_activebitNOT NULLDEFAULT 1
)

Or, I could loosen the rules a bit and go with:

CREATE TABLE lst_as400_srvr
(
idintNOT NULLIDENTITY,
namevarchar(128)NOT NULL,
is_activebitNOT NULLDEFAULT 1
)

I would lean towards the vigorous because it would be very obvious what data is being referenced by the name. In the loosened version, I could very easily have many tables with a 'id' column or a 'is_active' column.

Inversely, I would lean towards the loosened version because the names are a lot shorter and, thus, easier / faster to type.

I figure, if I'm going to learn a new standard, now's a good time to do so.

So, thoughts? Appreciate the help folks. :)

View 5 Replies View Related

Naming Convention

Feb 26, 2007

Sorry if this seems trivial, but is it allowed to add hyphens in a physical server name?
eg: PC-01


Will this cause any errors (when connecting, etc)
Thanx.

View 1 Replies View Related

Naming Convention

Dec 5, 2007



Is there any standard naming convention for SQL Server that microsoft suggest it?
the same as naming guidlines in MSDN for designing libararies in .Net Framework.

View 4 Replies View Related

Sql Table Naming Convention

Dec 20, 2003

I have to build a table Physicalcharacterics in sql.

Convention for naming a table

Would I name this table in sql server
tbl_User_PhysicalCharacterics.
My main parent table is tbl_User.


Is that too long of a name.

View 2 Replies View Related

Universal Naming Convention.

Aug 21, 2006

how can i find the servername and sharefolder on my computer to access a file?

for the server name i used the ip aand sharefolder i used computer description.
i think its not right cause its not working.

View 18 Replies View Related

How To Find Objects That Are Not Following Naming Convention

Apr 1, 2008

Hi All,

I have an assignment to change names of the SPs that are not following Standard naming convention in all databases. For this first I need to find out all the SPs that are not following naming convention. Can anybody help me in finding out the objects that are not following standard naming conventions. It is first step in completing this assignment. If anybody deal with this type of task before please guide me.
Hope any one of you will reply me with more information......

Thanks,
Pradeep

View 9 Replies View Related

Recommended Naming Convention For Tables/columns

May 9, 2008

I did a search (google and on the forums) and found a few suggestions here and there, but I'd like something more complete to follow as far as naming conventions are concerned.

I wrote my first DB based on MySQL/Ruby/Active Record type naming convention...

- plural table names
- all lower cased
- underscores between words
- "id" is auto incrementer for each table
- something+"_at" is for datetime fields
- something+"_on" is for date fields
- referencing the primary id in another table is "tablename (singular)" + "_id".

This worked great in Ruby/MySQL, but in C#/SQL Server, its an ambiguity nightmare! All of my "id" fields conflict and alot of my tables have "added_at" datetime fields and they all conflict with each other. Essentially, any field that's named the same in one table as in another conflict on joins.

For example: users post comments to stories submitted by users...

table = articles
field 1 = id
field 2 = title
field 3 = body
field 4 = user_id

table = comments
field 1 = id
field 2 = title
field 3 = body
field 4 = user_id
field 5 = article_id

Trying to join these two tables is an ambiguity nightmare but I'd like to not have to name every field uniquely or start adding table prefixes to them all...

I guess I just need some good suggestions or links to recommended table structure/naming conventions for SQL Server. Thanks in advance!

View 3 Replies View Related

Renaming All Default Contrainsts To Fit Into Naming Convention

Mar 14, 2008

I am currently trying to rename all of the Default constraints in my database to fit in with my naming convention of DF_+TableName+ColumnName. Since there are over 300 of the things, I don't particularly fancy doing them all manually.

I was hoping to use something like...





Code Snippet

--Declare the variables
DECLARE @defname VARCHAR(100), @tblname VARCHAR(100), @colname VARCHAR(100), @cmd VARCHAR(1000)

--Set the table name
SET @tblname = (SELECT object_name(parent_obj) FROM sysobjects
LEFT JOIN sys.columns ON sys.columns.object_id = sysobjects.id
INNER JOIN sysconstraints ON sysobjects.id = sysconstraints.constid
WHERE sysobjects.xtype = 'D')

--Set the column name
SET @colname = (SELECT name FROM sys.columns
INNER JOIN sys.tables ON sys.tables.object_id = sys.columns.object_id
WHERE sys.tables.name = @tblname)

--Set the default constraint
SET @defname = (SELECT name FROM sysobjects JOIN sysconstraints
ON sysobjects.id = sysconstraints.constid
WHERE object_name(sysobjects.parent_obj) = @tblname
AND sysobjects.xtype = 'D'
AND sysconstraints.colid = (SELECT colid FROM syscolumns
WHERE id = object_id(@tblname) AND
name = @colname))

--Set the renaming
SET @cmd = EXEC sp_rename +@defname+, 'DF_'+@tblname+'_'+@colname+, 'OBJECT'

--Execute the renaming
EXEC(@cmd)

I know that the above is not correct in any way, but it is how far I have got before I got really stuck! And I thought it might help you see what I was trying to get at...

Any clues?

View 5 Replies View Related

SQL 2007 Query Designer Using 4 Part Naming Linked Server - Bug ????

Jul 6, 2007

I have a linked server in SQL 2007 form SQL to DB2.(IBM)

If I write a distributed query from SQL to DB2 I get mt data returned.
ie:
select *
from openquery(Movex_Extranet,'Select * From mvxadta.ooline')

If I write a Query from SQL to DB2 using the 4-part naming convention linkserver.catalog.schema.object
then I also get my data returned.


ie:
select *
from MOVEX_EXTRANET.RCHASE5C.MVXADTA.OOLINE

My problem is with the Query Designer in SQL2007.

When I right click the first lot of code and select "Design query in editor"
The Designer GUI opens up and displays my table in graphical form with all columns selected - Great.



But When I repeat this for the code that uses the 4 part naming
The Designer opens up and displays the table but with no columns viewable or available for me to select ??

Anyone know what might be causing this to happen.
Is it a bug in SQL 2007 ??

I have tried linking the server using 2 types of providers ( One from Microsoft & one from IBM) but each time I still cannot see or choose columns in the designer using the 4part naming convention.


The 2 providers I tried where.
Microsoft OLE DB for ODBC Drivers.
IBM DB2 UDB for Iseries IBMDA400 OLE DB Provider



Any help greatly appretiated as I would really love to use the designer using 4part naming convention.

Apparently if you read this the it should work ?
http://msdn2.microsoft.com/en-us/library/aa225987(SQL.80).aspx#dvmscworkingwithtablesfromdifferentdatasources


Ray

View 1 Replies View Related

Linked Servers, Catalog Property And Four Part Naming?

Apr 13, 2007

I've finaly gotten a Linke Server up and running and been playing around with the settings, and one question keeps bugging me.



What is the point of the Catalog property value when you always have to put that database in the four part naming anyways?



Thanks.

View 6 Replies View Related

Integration Services :: SSIS 2012 ISPAC And Project Naming Difference

Nov 29, 2013

We are using MSBuild with a custom activity to build and deploy ISPACs from SSDT BI 2012.  We are building the ISPAC by calling the invoke process activity which inturn performs a build of the solution using devenv.exe.

All of this is working fine until we have solutions/ projects (dtproj) with complex names.  We have a solution named Company.Project.SSIS.Package.sln when we do a build it creates an ISPAC as expected however it is named incorrectly - Company.Project.ispac. 

When we subsequently deploy the ISPAC, it creates a project in the catalog called Company.Project.SSIS again this is wrong.  This also happend if i perform a manual build in VS2012. 

The issue is, the automated deployment of the ISPAC fails as it is looking for a file with a different name. Is there a way of changing these settings?

View 7 Replies View Related

SQL 2012 :: ETL Through Linked Server

Dec 28, 2014

I am currently trying to optimize an ETL process that pulls around 150 tables from a OLAP-esque system through a linked server. It's the AllScripts Touchworks EMR database, if that makes a difference. I am having a difficult time fitting an incremental load into a reasonable window of time. For instance, one table, which has around 40 columns, and a total of about 50 million rows, takes around an hour just to pull one day's worth of records when filtering on a single datetime field. The query is:

SELECT *
FROM OPENQUERY([linkedserver],
'
SELECT *
FROM Works.dbo.Visit
WHERE StartDttm BETWEEN ''2014-12-23'' AND ''2014-12-24''
'
)

Which, in the end, returns only about 30k records. However, in trying different approaches, I decided to test out bcp using the following code:

bcp Works.dbo.Visit out f:etlvisit.dat -n -S linkedserver.this extracted the entire table to flat file, but it only took about 15 minutes....add on another 3-4 to load that into the database on my end. Now, my ability to see what's happening on the remote server's end is very limited, but I know that the server has much higher specs than mine. They have 96GB memory vs. my 32GB, twice the cores I've got, etc. So how is this running faster by pulling the entire table over?

I figured that even in the worst case scenario of a full table scan, picking 30k rows out of the table that match a single criteria would certainly run faster than bringing the whole thing over. This isn't isolated to a single table, either. I finished running a test of the incremental extract/load vs. full extract/load via bcp (200GB of data). The incremental takes about 7 hours, bcp takes about 2 hours.

View 9 Replies View Related

SQL 2012 :: Linked Server To CSV File

Aug 5, 2014

I upgraded my 2008 R2 instance to 2012 and the Linked Server I use for aconnect to a csv file stopped working.

Create script:

EXEC sp_addlinkedserver @server ='Stats_CA',
@srvproduct='',
@provider ='Microsoft.ACE.OLEDB.12.0',
@datasrc='D:RLAPPSStatsStats_CA',
@provstr='Text'

Error message:
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "Stats_CA" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 2
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "Stats_CA".

I uninstalled and reinstalled the AccessDatabaseEngine - no change.

The provider is displayed, so it's not that.

I verified temp and csv location folder permissions

I tried the -g512 startup option

The csv has a schema.ini as required

It was an 'in place' upgrade, so nothing else has change.

View 6 Replies View Related

SQL 2012 :: Triggers With Linked Server

Nov 10, 2014

I have a system where people can apply for registration and also a registration fee is involved. The screen where the application is captured has a couple of inserts into different tables. Each of these tables have triggers on them to transfer data to a linked server and they work fine. Today I just added another trigger on a different table but also part of this same save process. Now I am getting the following error:

Microsoft OLE DB Provider for SQL Server error '80004005'

The statement has been terminated.

/orisys.int.za/applicants/ApplicantInsert.asp, line 111

I do not know this error and think it might be time-out.

View 9 Replies View Related

SQL 2012 :: Tablediff With Linked Server

Jan 26, 2015

I have created a linked server that point to a firebird database, everything is fine, I can query the database with something like

Select * from MYLINKEDSERVER...MYTABLE

Now , can i use tablediff utility with this linked server. If yes, any example ..

I would say also that performance is not very important to me. this would be used at the end of the day to make some sort of replication by generating a sql script with datadiff, and run it on a local sql server database and a web based SQL database. The replication is not an option since i am using a shared web hosting and replication is disabled on it .

View 2 Replies View Related

SQL 2012 :: Oracle Linked Server

Jun 8, 2015

I have a SQL Server 2012 instance set up with a linked server to an Oracle Database. I need to build a stored procedure (single NVARCHAR(6) parameter in: @accountID) which executes a select statement against the Oracle DB.

Everything's working fine when testing with 'EXEC (''<oraclecodeblock>'') at LINKEDSERVERNAME' if I hard code the value of @accountID in <oraclecodeblock> but when I encapsulate it all within sp_executesql and attempt to parameterize @accountID it's throwing ORA-01722 'invalid number' errors on the Oracle DB. The parameterized value is NVARCHAR as are the account numbers.

Working:
DECLARE @accountID VARCHAR(6);
SET @accountID = '10842';
DECLARE @sql NVARCHAR(MAX);
SET @sql = N'EXEC (''SELECT * from A.Accounts WHERE ID = ''''10842'''';'') AT LINKEDSERVER';

[code]...

View 0 Replies View Related

SQL 2012 :: Create Linked Server For Firebird?

Jan 26, 2015

i didn't figure out how to add a firebird linked server via ODBC

my system :

win 7 pro 64
SQL server 2012 express 64
firebird 2.5.3 64
Official ODBC drivers 64

i have created the odbc source without problem, and checked that in visual studio and ssms import data wizard , both show me the data from firebird database but when i try to create a linked server , i have something like this message (the image is from the web)

View 4 Replies View Related

SQL 2012 :: Using Linked-server During (logon Trigger)

Oct 8, 2015

Used linked-server during logon trigger? is it possible? i know we can access tables, SPs, etc with in that server, if i want to check something in other server during logon trigger, can i do it?

View 0 Replies View Related

SQL Server 2012 :: How To Insert Data Into Table From Linked Server

Nov 19, 2013

I wonder if it possible to move data from tables on a linked server to a "normal database"?

Name linked server: Covas
Name table on linked server: tblCountries
Name field: cntCountryName

Name "normal" database: CovasCopy
Name "normal" table: Countries (or dbo.Countries)
Name "normal" field: Country

This is just a test setup. I figure that if I get this working the rest will be easier.

My current query:
select * from openquery(COVAS,'
INSERT INTO CovasCopy.dbo.Countries(Country)
SELECT cntCountryName FROM db_covas.tblCountries;')

View 8 Replies View Related

SQL 2012 :: Selecting From Linked DB2 Server / Specific Column

May 13, 2014

I've got an OLEDB DB2 linked server to a db2/AS400 instance and selecting from a table on the server has never caused problems before. One of the columns is a large text field. If I select all the columns but the large text field, it returns as normal, but including the large text field now, I get:

"Transport error: shared memory provider error: 0 - no process is on the other end of the pipe"

The largest entry in the text field is about 5k characters, and there don't appear to be any strange characters.

View 0 Replies View Related

SQL 2012 :: Can't Access Linked Server When Connecting Via Alias

May 27, 2014

As a database developer, I have so many databases that I "own" scattered across various servers that it''s getting difficult to remember where all of my databases reside. It doesn't work that the DBAs have taken to some very hard to remember server naming conventions.

I was going to create aliases via the configuration manager, but it turns out the DBAs overwrite my entries each night with THEIR aliases and they won't add any for my use.

So I decided to simply add some records to my host file so that instead of having to connect to "SERVER-AD_DADF-DAFDASS" I can just use "CustomerA".

This solution seems to work until I tried to access a linked server. If I connect to the main server via it's actual name, I can hit the remote/linked server with no issue. However, if I connect to the main server using it's alias, connection to the remote/linked server fails with: Login failed for user 'NT AUTHORITYANONYMOUS LOGON'.

The linked server is set up to use current security context and I'm not logging into the alias any differently that I do when using the actual server name.

View 9 Replies View Related

SQL 2012 :: Linked Server And Remote Login Password

Oct 7, 2014

Is there any way to find out the password for the remote login of the Linked server

View 1 Replies View Related

SQL 2012 :: Linked Server To Lotus Notes Database

Nov 24, 2014

I'm having a few issues trying to get a linked server setup from a new SQL2012 installation to a Lotus Notes database. This linked server has previously been working fine on our old SQL2005 environment. All setup using the same details (ODBC driver name matches, account details etc). If we test the connection from the Lotus ODBC driver the test connection is successful, If I then create the Linked server to access this ODBC driver I receive an error :

Cannot initialize the data source object OLE DB Provider "MSDASQL" for linked server "LotusTest"

OLE DB provider "MSDASQL" for linked server "LotusTest" returned message "[Microsoft][ODBC Driver Manager] Driver's SQLSetAttr failed"
OLE DB provider "MSDASQL" for linked server "LotusTest" returned message "[Lotus][ODBC Lotus Notes]

Unable to find path to server. check your network connection is working.(Microsoft SQL Server, Error: 7303)We have just migrated to a SQL Server 2012 64 bit Enterprise from SQL Server 2005 32 bit Standard. We have a 64 bit Lotus client installed to provide the correct ODBC driver which has enabled the test connection direct from the ODBC driver to connect successfully. I'm just at a loss as to how to resolve this issue and get the linked server connecting.

View 0 Replies View Related

SQL 2012 :: Adding Column To A Table Over Linked Server

Apr 22, 2015

I have a situation that I need to add a field to a table over linked server. The specifications of this is dynamic and it is being done in TQL / Stored procedures and this can not change. My code is generating the statement just fine and if I copy paste it to a new SSMS window and execute it WORKS.. The problem is I need to dynamically generate the statement (I am doing that just fine, I THINK). THEN I need to execute the statement IN THE SPROC, this part is not working.

Here is the code:

SET @AlterSQL = @DestinationServerName + '.[' + @DestinationDBName +'].' + @DestinationSchemaName + '.sp_executesql N'' ALTER TABLE '
+ @DestinationTableName + ' ADD ' + @TempColumn + ' int' + CHAR(39)

The above Creates this when I expose it via a PRINT statement:

addb15.[FSParallel].dbo.sp_executesql N' ALTER TABLE Node ADD ImportIdentity int'

After I create the statement I use:

EXEC @AlterSQL

And this returns the following error:

Msg 2812, Level 16, State 62, Procedure ETLDynamicImport, Line 244
Could not find stored procedure 'FSParallel.dbo.sp_executesql N' ALTER TABLE Node ADD ImportIdentity int''.

<hr noshade size='1' width='250' color='#BBC8E5'>

View 1 Replies View Related

SQL 2012 :: How To Run Transaction Across Multiple Instances Without Linked Server

May 18, 2015

i want to run a transaction across mulitpule instences of sqlserver with out linked server.

distributed trnasaction can do it with link server , can it do it with out linked server.

View 9 Replies View Related

SQL 2012 :: Not Exists Linked Server Object Query

Aug 10, 2015

So, I've got this query running and it works great providing there is a record in both DataBases. Now, I need to get all of those that have a record in DBServer1 but not in TranscendDB. I assume i'd use an If not exists, but can't figure out the syntax when using the Linked Object...

select Portfolio
from [TranscendDB].[dbo].[CMContactEvents] as CM
inner join
(
select N.SSN, A.ACCOUNTNUMBER
from [DBServer1].[DB1].[dbo].[Account] AS A,

[Code] ......

View 4 Replies View Related

SQL Server 2012 :: Push Records Using Linked Server

Apr 16, 2015

what is the best way to push records using linked server. below is my query on Source server

insert into LSDestserver.DB.dbo.tablename
select * from #temp order by abc desc

I initially thought to pull records from Source server to LSDestserver but its a temp table. I don't know whether it is possible or not. Is there any other way we can achieve this in optimal way.

View 9 Replies View Related

SQL 2012 :: Create Linked Server With Failover Partner Option?

Jul 22, 2014

it is possible to create Linked server with Failover partner option. I can query when primary server and getting the error when I set the DB Fail over. I have tried with following script and also gone through different sources, but failed. Please see the script and error below.

EXEC master.dbo.sp_addlinkedserver
@server = N'MIRRORLink',
@srvproduct=N'',
@provider=N'SQLOLEDB',
@provstr=N'Server=primary;FailoverPartner=mirror;network=dbmssocn;',

[code].....

View 2 Replies View Related

SQL 2012 :: Allow Authenticated User To Query Excel File Via Linked Server?

May 25, 2014

I have a 3rd party dashboard application that I can only use SQL authenticated logins to connect to the database.

I'm trying to create a query within the application that will directly access an excel file through a linked server.

As a test, I login to SSMS as the sql auth user to run the linked server query below but the following error is returned:

select *
from Corporate...[Sheet1$]OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "Corporate" returned message "Cannot start your application. The workgroup information file is missing or opened exclusively by another user.".
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "Corporate" reported an error. Authentication failed.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "Corporate".

When I login as a Windows auth user, I can successfully run the above query.

I noticed within the linked server's security definition that I cannot specify a windows auth user as the mapped Remote User or as the Remote login

I've tried creating a Credential object with the identity of the windows user and assign that object to the sql auth user but to no avail. I still get the same error

I am using SQL Server express so the option of an automated server agent job to import the excel file is not available.

Details:
SQL Server Express 2012
Office version: Excel 10
Provider: Microsoft.ACE.OLEDB.12.0

View 9 Replies View Related

SQL Server 2012 :: Parameter Datatypes Linked To Underlying Table Column Datatype

Jun 5, 2014

In Oracle when i create any procedure i define parameter datatype linked to under lying table.

For ex
create procedure testprocedure
(param1 customer.name%type,
param2 customer.salary%type )

Here i have defined param1 and param2 with datatype of name and salary of customer table respectively.

This way i do not need to worry about modifying param1 and param2 datatypes when datatypes of name & salary of customer table changes in future.

How can i accomplish this in SQL server.

View 2 Replies View Related

Naming The Database Server(s)?

Apr 2, 2007

Hi.Could somebody kindly tell me what conventions and best practices areused when naming a database server (not the database itself) and/or acluster of database servers?thanks!

View 5 Replies View Related







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