MVA SQL Server Query Assessment question

Hi Guys
I was doing a course on MVA, Querying Microsoft SQL Server Quick Start. This question came up in the assessment:
True or False: You use the INTERSECT operator to combine results from two SELECT statements. Only rows that appear in both results sets are displayed.
I answered it as TRUE but it marked it wrong.
Am I not right??
Thanks

Hi,
Choose yourself :-)
http://technet.microsoft.com/en-us/library/ms188055.aspx
[Personal Site] [Blog] [Facebook]

Similar Messages

  • Sql server query

    sql server query to rearrange the rows after inserting the rows in a table

    You want to re-arrange the data physically?!!! Why? I believe its something impossible other than having a clustered key(there could be some strange ways of doing it) and a thing that should not worry about. Always there is a ORDER BY CLAUSE to order your
    data while retrieving 
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • From SharePoint Content Database, Using SQL-Server Query how to fetch the 'Document GUID' based on 'Content Type'

    I want to get all the documents based on content type using SQL Server Query. I know that, querying the content database without using API is not advisable, but still i want to perform this action through SQL Server Query. Can someone assist ?

    You're right, it's not advisable, may result in corruption of your databases and might impact performance and stability. But assuming you're happy to do that then it is possible.
    Before you go down that route, have you considered using something more safe like PowerShell? I've seen a script exactly like the one you describe and it would take far less time to do it through PS than it would through SQL.

  • Official documents on escaping characters in SQL Server query statements

    Hi,
    Are there any official documents on how to escaping special characters in SQL Server query statements? I find a lot of online resources discussing about this, but there are no definitive conclusions on:
    Which characters should be escaped? (Some only said single-quote needs to be escaped, double-quote does not need. While others said both need to be escaped)
    How to escape characters? (Some said using two single-quote to escape a single-quote. Others said using a backslash, etc.)
    So I just wonder if there is an official document from Microsoft regarding this?
    Thanks
    Alan

    Depends on where you're using them
    If its string values then single quotes(') should be escaped by putting one more single quote before it.
    If its LIKE operator you can use ESCAPE keyword or use [] to escapre special characters 
    see
    http://visakhm.blogspot.in/2013/01/wildcard-character-based-pattern-search.html
    If inside SSIS expression you can escape characters like \ " etc by adding an extra \ before the characters
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Converting SQL Server Query to Oracle

    Hello TechFriends,
    Can any one of u please tell me equivalent of following SQL Server Query?
    The same query runs in Oracle but givesa same reocrds in different order!! I want such an equivalent oracle query that gives records in same order as Sql Server does.
    select
    ProfValue_ProfScaleFK ProfScale,
    ProfValue_Value ProfValue,
    isnull(ProfValueDesc.name, ProfValue_name) ProfName
    from
    ProfValueDesc inner join TBL_LMS_Lang
    on lang_fk = lang_pk and langid = 'en'
    right outer join ProfValue
    on ProfValue_ProfScaleFK = ProfScale_fk and ProfValue_Value = ProfValue_FK ;
    Regards & TIA.
    Anand.

    If you want a specific ordering why don't you add an ORDER BY clause?
    Donal

  • How to transfer logins and passwords between instances of SQL Server query

    Hi
    Microsoft have provided a SQL Script on there support site with regards to moving accounts from one SQL Server to another SQL Server.
    KB Link: http://support.microsoft.com/kb/918992/en-us
    My question is should I migration the [NT AUTHORITY and [BUILTIN\. My thinking is no.
    Regards

    Hello,
    Please follow the below link :
    http://sqlmag.com/query-analyser/sql-server-login-transfer
    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/

  • Switch from MySQL to MS SQL Server, Query not working

    I'm sure there is a simple setting somewhere for this, but cannot seem to find it and really would appreciate some assistance. Have an application which uses JDBC to connect to a MySQL DB to run the following query without an issue:
    SELECT * FROM users
    This returns the desired results. Changed to connect to MS SQL Server 2000 using the JDBC-ODBC bridge and the same query returns no results. The problem, SQL Server wants this query instead:
    SELECT * FROM [users]
    I don't want to have to change queries depending on the DB, as that is supposed to be one of the advantages of JDBC. Is there a setting in MySQL (or the JDBC driver) to have it work correctly if I pass table names in []? Or is there a setting in MS SQL Server (or in the JDBC, or ODBC) to have it accept queries without the []?
    Or is there a different approach that I'm missing which would avoid this whole problem?
    Thanks,
    Matt

    I suspect your database definitions are different. It has nothing to do with your java code.
    The bracket syntax is used to indicate the more standard quoted identifiers in standard SQL.
    Thus you could do this in oracle and in MS SQL Server...
    SELECT * FROM "users"
    I suspect that the above will work for your MS SQL Server database and will not work for your Oracle database. However if you created the table in oracle and specifically used "users" (with the double quotes around the name) when creating the table then it would work.
    Of course if the database definitions are different it means you must use different SQL for each. Just as if the name of the table was 'other' rather than 'users'.

  • SQL Server Studio Management Question

    Hello,
    I am creating a DB using SQL Server 2005 ( Studio Management )  and I ran a few sql queries. I ran a query and got the following error message:
    Here they are with Code #s:
    Msg 5074, Level 16, State 1, Line 906
    The object 'CK__SavedSear__Remov__5614BF03' is dependent on column 'RemoveFromSyncTime'.
    Msg 4922, Level 16, State 9, Line 906
    ALTER TABLE DROP COLUMN RemoveFromSyncTime failed because one or more objects access this column.
    Executing Release 2.0 Script - Part 4
    Msg 245, Level 16, State 1, Line 37
    Conversion failed when converting the varchar value 'Script cannot be run out of order. Last ID cannot be less than ' to data type int.
    Can anyone help in letting me how to resolve this issue ?
    Thanks

    I've got a similar issue on SQL 2000 DB, see below;
    Server: Msg 5074, Level 16, State 1, Line 1
    The object 'DF__CISDetail__Ccs_O__7917DB30' is dependent on column 'CCS_OP_714_VALID_TO'.
    Server: Msg 4922, Level 16, State 1, Line 1
    ALTER TABLE ALTER COLUMN CCS_OP_714_VALID_TO failed because one or more objects access this column.
    As I've only created the table as a temporary measure to import some external data, I'm going to try removing the constriants applied and then alter the columns I need, I can then re-apply my constraints afterwards.

  • SQL server Query to sort the Stored procedure as text

    Hi
    I have a requirement as below :
    Stored procedure in SQL server has some 1000 lines of code where the SP uses select, insert , update ,delete and Joins on direct tables and as well as temp tables , the requirement is to get all text code from sp which is used for either select/insert
    except update and delete.
    for example :
    Create PROCEDURE testproc
    AS
    Begin
    /*Statement 1*/
    select id from emptable
    /*Statement 2*/
    select address into #empAddress from empAddresstbl
    /*Statement 3*/
    update a
    set id = 0 from usertbl a 
    /*Statement 4*/
    Update u
    set access=0 from usertbl u
    inner join permissionstbl p
    on u.userid = p.userid
    /*Statement 5*/
    select name into #empname
    from empnametbl
    inner join Nametbl on
    empname.id = name.id
    END
    for the given sample sp the output of query shld be
    from emptable
    from empaddresstbl
    from empnametbl
    join nametbl
    it shld not consider the table name from update/delete and the tables used for joins in updates/delete.
    This has to be achieved using  SQL
     Thanks,

    Hi All,
    Problem is solved after adding files to microsoft access 2000 runtime. runtime missing some DLLs related to sql server 2000 to update those files follow the links below
    http://support.microsoft.com/?kbid=287484
    http://www.microsoft.com/office/orkarchive/2000ddl.htm#accsql
    Thanks,
    Brahma

  • Variable database name in SQL Server query using Oracle database link

    Hi All,
    I have an ApEx 4.1 app running on 11g x64 (11.2.0.1) on Windows Server 2008 x64, and I have some data integration points with a SQL Server (2005 and 2008) that I need to establish. I have configured the database link with dg4odbc and it works beautifully... I can execute queries against the SQL Server database without any problems using the database link.
    However, there is a scenario where the SQL Server database name is dynamic, and I need to generate it on the fly in a PL/SQL block, and then use that in a dynamic SQL query (all of this in ApEx). This is where I run into problems... when I am querying the default database based on the ODBC connection and I don't have to specify the database name, there is no issue. But when I need to access one of several other non-default databases, I keep receiving the "invalid table" error.
    This runs fine:* (note that "fv" is the name of my database link)
    v_query1 := 'select "ReleaseDate" from dbo.Schedules@fv where dbo.Schedules."SchedID" = :schedule';
    EXECUTE IMMEDIATE v_query1 into rel_date using schedule;
    I then take that rel_date variable, convert to a varchar2 (rel_date_char), and then use it as the database name in the next query...
    This returns an error_ (Error ORA-00903: invalid table name)
    v_query2 := 'select "PARTNO" from :rel_date_char.dbo.ProdDetails@fv where "SchedID" = :schedule and "UnitID" = :unit
    and "MasterKey" = :master and "ParentKey" = :parent';
    EXECUTE IMMEDIATE v_query2 into part_number using schedule, unit, master, parent;
    I have also tried using all of the following to no avail:
    'select "PARTNO" from ' || :rel_date_char || '.dbo.ProdDetails@fv where "SchedID"...
    'select "PARTNO" from ' || rel_date_char || '.dbo.ProdDetails@fv where "SchedID"...
    'select "PARTNO" from ' || @rel_date_char || '.dbo.ProdDetails@fv where "SchedID"...
    'select "PARTNO" from @rel_date_char.dbo.ProdDetails@fv where "SchedID"...
    Is there a way to do this in PL/SQL?
    Thanks for any help!
    -Ian C.
    Edited by: 946532 on Jul 15, 2012 7:45 PM

    Just did a test using passthrough:
    SQL> set serveroutput on
    SQL> declare
    2 val varchar2(100);
    3 c integer;
    4 nr integer;
    5 begin
    6 c:= dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
    7 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 'select count(*) from EMP');
    8 LOOP
    9 nr:= DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
    10 exit when nr=0;
    11 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c,1,val);
    12 dbms_output.put_line(val);
    13 end loop;
    14 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
    15 end;
    16 /
    24576
    PL/SQL procedure successfully completed.
    SQL> declare
    2 val varchar2(100);
    3 c integer;
    4 nr integer;
    5 begin
    6 c:= dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
    7 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 'select count(*) from dbo.EMP');
    8 LOOP
    9 nr:= DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
    10 exit when nr=0;
    11 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c,1,val);
    12 dbms_output.put_line(val);
    13 end loop;
    14 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
    15 end;
    16 /
    24576
    PL/SQL procedure successfully completed.
    So all 3 ways work for me.
    Edited by: kgronau on Jul 23, 2012 10:08 AM
    Now using variables to perform the select:
    SQL> declare
    2 val varchar2(100);
    3 c integer;
    4 nr integer;
    5 tabname varchar2(20) :='EMP';
    6 ownr varchar2(20) :='dbo';
    7 dbname varchar2(20) :='gateway';
    8 begin
    9 c:= dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
    10 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 'SELECT count(*) FROM '||dbname||'.'|| ownr || '.'||tabname||'');
    11 LOOP
    12 nr:= DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
    13 exit when nr=0;
    14 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c,1,val);
    15 dbms_output.put_line(val);
    16 end loop;
    17 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3(c);
    18 end;
    19 /
    24576
    PL/SQL procedure successfully completed.
    => instead of executing the statement using "execute Immediate" we have to use PASTHROUGH package to pass the statement to the SQL Server.
    Edited by: kgronau on Jul 23, 2012 10:10 AM

  • SQL Server Query Plan Generation take longer

    Dear all,
    We are dealing with a wired issue where queries on there first execution take approx 1 min to 2 mins to execute and later execution completes in less than a second,Can you please help us understand why sql server is taking longer time to generated the query
    plan
    Below is the result of files stats
    Mohd Sufian www.sqlship.wordpress.com Please mark the post as Answered if it helped.

    SYS.DM_OS_MEMORY_CLERKS
    MEMORYCLERK_SQLOPTIMIZER 136 912
    CACHESTORE_PHDR 1864 0
    CACHESTORE_XMLDBTYPE 8 0
    CACHESTORE_EVENTS 16 0
    USERSTORE_OBJPERM 824 0
    USERSTORE_TOKENPERM 840 968
    MEMORYCLERK_SQLSTORENG 2736 4312
    CACHESTORE_FULLTEXTSTOPLIST 32 0
    MEMORYCLERK_XE 64 168
    CACHESTORE_XPROC 72 0
    OBJECTSTORE_SNI_PACKET 3336 112
    CACHESTORE_BROKERRSB 8 0
    OBJECTSTORE_SERVICE_BROKER 424 0
    MEMORYCLERK_SQLSERVICEBROKERTRANSPORT 48 0
    MEMORYCLERK_XE_BUFFER 0 0
    MEMORYCLERK_SQLGENERAL 1608 4144
    CACHESTORE_XMLDBATTRIBUTE 8 0
    MEMORYCLERK_SQLHTTP 8 0
    CACHESTORE_STACKFRAMES 0 16
    MEMORYCLERK_SQLCONNECTIONPOOL 2440 0
    MEMORYCLERK_SQLSERVICEBROKER 152 544
    CACHESTORE_NOTIF 16 0
    CACHESTORE_XMLDBELEMENT 8 0
    OBJECTSTORE_LOCK_MANAGER 24 0
    MEMORYCLERK_SQLBUFFERPOOL 0 1688
    MEMORYCLERK_SQLSOAP 0 0
    MEMORYCLERK_TRACE_EVTNOTIF 0 0
    CACHESTORE_OBJCP 6576 512
    CACHESTORE_CONVPRI 64 0
    MEMORYCLERK_QSRANGEPREFETCH 0 0
    CACHESTORE_BROKERREADONLY 80 0
    MEMORYCLERK_SQLCLRASSEMBLY 0 0
    MEMORYCLERK_SOSNODE 8 16320
    MEMORYCLERK_SQLQUERYPLAN 0 0
    OBJECTSTORE_SECAUDIT_EVENT_BUFFER 16 0
    MEMORYCLERK_BHF 0 0
    CACHESTORE_SQLCP 22680 3544
    OBJECTSTORE_LBSS 96 192
    CACHESTORE_SYSTEMROWSET 1832 0
    MEMORYCLERK_FULLTEXT 24 0
    USERSTORE_SCHEMAMGR 2632 328
    MEMORYCLERK_SQLQUERYCOMPILE 0 0
    CACHESTORE_TEMPTABLES 16 0
    CACHESTORE_BROKERTBLACS 200 0
    CACHESTORE_BROKERTO 8 0
    CACHESTORE_BROKERKEK 8 0
    MEMORYCLERK_SQLXML 0 0
    USERSTORE_SXC 64 0
    MEMORYCLERK_SNI 240 32
    MEMORYCLERK_FULLTEXT_SHMEM 0 0
    CACHESTORE_BROKERUSERCERTLOOKUP 8 0
    CACHESTORE_BROKERDSH 8 0
    MEMORYCLERK_SQLSOAPSESSIONSTORE 0 0
    MEMORYCLERK_SQLQERESERVATIONS 0 0
    MEMORYCLERK_HOST 16 0
    MEMORYCLERK_SQLCLR 8 0
    MEMORYCLERK_SQLXP 16 0
    USERSTORE_DBMETADATA 1912 0
    MEMORYCLERK_SQLUTILITIES 112 0
    CACHESTORE_VIEWDEFINITIONS 16 0
    MEMORYCLERK_SQLQUERYEXEC 80 0
    sys.dm_os_performance_counters
    object_name counter_name cntr_value
    SQLServer:Buffer Manager Buffer cache hit ratio 556
    SQLServer:Buffer Manager Buffer cache hit ratio base 612
    SQLServer:Buffer Manager Page lookups/sec 4054066
    SQLServer:Buffer Manager Free list stalls/sec 0
    SQLServer:Buffer Manager Free pages 483
    SQLServer:Buffer Manager Total pages 503088
    SQLServer:Buffer Manager Target pages 1710080
    SQLServer:Buffer Manager Database pages 494479
    SQLServer:Buffer Manager Reserved pages 0
    SQLServer:Buffer Manager Stolen pages 8126
    SQLServer:Buffer Manager Lazy writes/sec 0
    SQLServer:Buffer Manager Readahead pages/sec 378700
    SQLServer:Buffer Manager Page reads/sec 493985
    SQLServer:Buffer Manager Page writes/sec 2421
    SQLServer:Buffer Manager Checkpoint pages/sec 0
    SQLServer:Buffer Manager AWE lookup maps/sec 0
    SQLServer:Buffer Manager AWE stolen maps/sec 0
    SQLServer:Buffer Manager AWE write maps/sec 0
    SQLServer:Buffer Manager AWE unmap calls/sec 0
    SQLServer:Buffer Manager AWE unmap pages/sec 0
    SQLServer:Buffer Manager Page life expectancy 262
    SQLServer:Cursor Manager by Type Cache Hit Ratio 0
    SQLServer:Cursor Manager by Type Cache Hit Ratio Base 0
    SQLServer:Cursor Manager by Type Cached Cursor Counts 0
    SQLServer:Cursor Manager by Type Cursor Cache Use Counts/sec 0
    SQLServer:Cursor Manager by Type Cursor Requests/sec 0
    SQLServer:Cursor Manager by Type Active cursors 0
    SQLServer:Cursor Manager by Type Cursor memory usage 0
    SQLServer:Cursor Manager by Type Cursor worktable usage 0
    SQLServer:Cursor Manager by Type Number of active cursor plans 0
    SQLServer:Cursor Manager by Type Cache Hit Ratio 0
    SQLServer:Cursor Manager by Type Cache Hit Ratio Base 0
    SQLServer:Cursor Manager by Type Cached Cursor Counts 0
    SQLServer:Cursor Manager by Type Cursor Cache Use Counts/sec 0
    SQLServer:Cursor Manager by Type Cursor Requests/sec 0
    SQLServer:Cursor Manager by Type Active cursors 0
    SQLServer:Cursor Manager by Type Cursor memory usage 0
    SQLServer:Cursor Manager by Type Cursor worktable usage 0
    SQLServer:Cursor Manager by Type Number of active cursor plans 0
    SQLServer:Cursor Manager by Type Cache Hit Ratio 0
    SQLServer:Cursor Manager by Type Cache Hit Ratio Base 0
    SQLServer:Cursor Manager by Type Cached Cursor Counts 0
    SQLServer:Cursor Manager by Type Cursor Cache Use Counts/sec 0
    SQLServer:Cursor Manager by Type Cursor Requests/sec 0
    SQLServer:Cursor Manager by Type Active cursors 0
    SQLServer:Cursor Manager by Type Cursor memory usage 0
    SQLServer:Cursor Manager by Type Cursor worktable usage 0
    SQLServer:Cursor Manager by Type Number of active cursor plans 0
    SQLServer:Cursor Manager by Type Cache Hit Ratio 0
    SQLServer:Cursor Manager by Type Cache Hit Ratio Base 0
    SQLServer:Cursor Manager by Type Cached Cursor Counts 0
    SQLServer:Cursor Manager by Type Cursor Cache Use Counts/sec 0
    SQLServer:Cursor Manager by Type Cursor Requests/sec 0
    SQLServer:Cursor Manager by Type Active cursors 0
    SQLServer:Cursor Manager by Type Cursor memory usage 0
    SQLServer:Cursor Manager by Type Cursor worktable usage 0
    SQLServer:Cursor Manager by Type Number of active cursor plans 0
    SQLServer:Cursor Manager Total Cursor conversion rate 0
    SQLServer:Cursor Manager Total Async population count 0
    SQLServer:Cursor Manager Total Cursor flushes 0
    SQLServer:Memory Manager Connection Memory (KB) 2864
    SQLServer:Memory Manager Granted Workspace Memory (KB) 0
    SQLServer:Memory Manager Lock Memory (KB) 7944
    SQLServer:Memory Manager Lock Blocks Allocated 40550
    SQLServer:Memory Manager Lock Owner Blocks Allocated 43550
    SQLServer:Memory Manager Lock Blocks 10003
    SQLServer:Memory Manager Lock Owner Blocks 10133
    SQLServer:Memory Manager Maximum Workspace Memory (KB) 10280520
    SQLServer:Memory Manager Memory Grants Outstanding 0
    SQLServer:Memory Manager Memory Grants Pending 0
    SQLServer:Memory Manager Optimizer Memory (KB) 1048
    SQLServer:Memory Manager SQL Cache Memory (KB) 2080
    SQLServer:Memory Manager Target Server Memory (KB) 13680640
    SQLServer:Memory Manager Total Server Memory (KB) 4024704
    Mohd Sufian www.sqlship.wordpress.com Please mark the post as Answered if it helped.

  • Converting MS SQL Server Query to Oracle Query

    Hi There,
    I've a strange problem. My project uses both MS SQL Server and Oracle server at run time. I've lot of queries which are written in MS SQL Style. Now, iam planning to write a helper class whic converts MS SQL Query to Oracle Query. Please Help me if any one has that kind of Helper with you.
    Thanks And Regards,
    Sasi Kanth

    That is why persistence applications like Hibernate or
    CMP get used for apps that will use more than one DB,
    but it takes upfront planning.
    If you have a set of automated unit tests that work
    with SQL Server, they will be a big help in getting
    your Oracle code up and running.Indeed - JUnit and Ant would be a big help here.
    It sounds like you have SQL in your JSPs, that will
    work against you as well if so. If you are using a
    DAO pattern, this will be much easier, as you can
    re-implement each DAO for Oracle.If you'd layered this app properly, you might just implement an OracleDAOFactory and be done with it. Interfaces and a DAO layer would go a long way.
    This is why layering is such a good idea. It isolates changes in a smaller subset of classes.
    But your problem sounds pretty big. It'd be daunting even if it were well designed.

  • SQL server service accounts question

    We created a test SQL environment using a Technet evaluation copy of Windows Server 2012 along with an evaluation copy of SQL2012. After testing, everything is working as planned so were going to enter the product keys for both Windows Server and SQL 2012.
    My question is that once we have our Server licensed we’re going to start a new domain and recreate all the user accounts but I installed SQL using a local user account I created called ”sqladmin”. Once Server 2012 is the DC in the new domain will I need to
    change all the service accounts for SQL in order for it to function or can I still use the local “sqladmin” user account? If I can re-use that local account are there any downside to that? What’s the best practice in this scenario

     Once Server 2012 is the DC in the new domain will I need to change all the service accounts for SQL in order for it to function or can I still use the local “sqladmin” user account? If I can re-use that local account are there any downside to that?
    What’s the best practice in this scenario
    Hi,
    You can use your sqladmin account but that wont be a good security practice. You should always follow principal of least privilege and should run SQL server with domain account having least privilege.Below link will help you in this
    Configure SQL server account and services
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    My TechNet Wiki Articles

  • SQL server query without indicating server name

    I am writing a query  in SSIS and  utilize servername everytime  but it drags every time
    I am authorized to  work in Development area and can indicate deve  server
    But   Senior  officer ask me  not to use Server name  and when  package goes to  production   query  can execute without  indicate  server name any idea 
    thank you very much.
    Vijay
    Vijay Patel

    I think you're using linked server in your queries based on your description.
    While working in SSIS you dont need linked server. You'll just add connection manager to connect to your dev server and database and then use it for your tasks. Inside your query you will just reference objects using schemaname.objectname convention.
    You will make servername and database name configurable by adding them as configurations (parameters in SSIS 2012 if you use project deployment). Then you will be able to pass values for configurations from outside based on variety of options like through
    XML file, from SQLServer table, Environment variables etc
    see
    http://www.mssqltips.com/sqlservertip/1405/sql-server-integration-services-ssis-package-configuration/
    http://nexxtjump.com/2013/01/14/ssis-2012-configuration-guide-part-1-introduction/
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • SQL Dev 2.1 connected to a SQL Server query

    I use SQL developer to query oracle db's and from the Query result, if i right click i get the following options;
    Save grid as report...
    Single record view...
    Count Rows...
    Find/Highlight...
    Export Data
    However when i do this against an SQL server I only get teh following;
    Save grid as report...-this is grayed out and can not be used.
    Single record view...
    Count Rows...
    Find/Highlight...
    I do not get the export option, does anyone know why? or what I can do to get it?

    With SQL Developer 2.1.0 the export feature was removed for all not oracle database.
    In 2.1.1 the export feature is working again so if you need to export on SQL server you should upgrade to 2.1.1.

Maybe you are looking for