Ho to Write Query for dynamic in sql server for IN operation.

hi ,
we was write store procedure dynamically for IN operation,when i select 4 values it was update only 3 item last selected values are not update .if select more then 5 it will showing the below error
ALTER PROCEDURE [dbo].[UpdateEMPdetails]
@NID varchar(50),
@EID nvarchar(max),
@RT bit,
@Ackd bit,
@VerifiedBy varchar(80),
@TableName varchar(100)
as
declare @SqlQueary nvarchar(max)
set @SqlQueary = 'update '+ @TableName +' set RT='+CAST(@Rt AS CHAR(1))+',Ackd='+CAST(@Ackd AS CHAR(1)) +',Verified_By='''+@VerifiedBy+''' where NID='''+@NID+''' and ' +
' EID in('''+ @EID+''''+')'
print @SqlQueary
exec UpdateEMPdetails 'EMP14-302',"000008922','00000010242','000008923','00000010242','0000008922','00000010242','0000008922','00000010242",1,1,'xyz','EMPTB'
when i run this one we will getting the below error
Msg 103, Level 15, State 4, Line 1
The identifier that starts with '0000008922','00000010242','00000008922','00000010242','0000008922','000000010242','00' is too long. Maximum length is 128.

Hi PS_L,
This is the forum for SharePoint .For your question please use the related Forum, following link is SQL
Server Forum:
http://social.technet.microsoft.com/Forums/sqlserver/en-us/home?category=sqlserver 
This question, I think if you change "000008922','00000010242','000008923','00000010242','0000008922','00000010242','0000008922','00000010242"
to  N'''000008922'',''00000010242'',''000008923'',''00000010242'',''0000008922'',''00000010242'',''0000008922'',''00000010242''' will solve it. 
Qiao Wei
TechNet Community Support

Similar Messages

  • I want to query oracle database from sql server can anyone tell steps 2 fo

    i want to query oracle database from sql server can anyone tell steps 2 followed
    i tried with linked servers but it is throwing errors can anyone hepl in this regard
    The operation could not be performed because the OLE DB provider 'MSDAORA' was unable to begin a distributed transaction.
    OLE DB error trace [OLE/DB Provider 'MSDAORA' ITransactionJoin::JoinTransaction returned 0x8004d01b].

    First of all - you are in the wrong forum.
    Look either for the Database general or search for Transparant / Heterogenous Gateways.
    cu
    Andreas

  • I want to query oracle database from sql server can anyone tell steps 2 fol

    i want to query oracle database from sql server can anyone tell steps 2 followed
    i tried with linked servers but it is throwing errors can anyone hepl in this regard
    The operation could not be performed because the OLE DB provider 'MSDAORA' was unable to begin a distributed transaction.
    OLE DB error trace [OLE/DB Provider 'MSDAORA' ITransactionJoin::JoinTransaction returned 0x8004d01b].

    First of all - you are in the wrong forum.
    Look either for the Database general or search for Transparant / Heterogenous Gateways.
    cu
    Andreas

  • Upgrade OM 2012 to SP1 Beta - Version of SQL Server for the Operational Database and the Data Warehouse

    Hello,
    When I try to verify the prerequisites to upgrade my SCOM 2012 UR2 Platform to SP1 Beta, I have these errors :
    The installed version of SQL Server is not supported for the operational database.
    The installed version of SQL Server is not supported for the data warehouse.
    But when I execute this query Select @@version on my MSSQL Instance, the result is :
    Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)   Jun 17 2011 00:54:03   Copyright (c) Microsoft Corporation  Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: ) (Hypervisor) 
    But
    here, we can see that :
    Microsoft SQL Server: SQL Server SQL 2008 R2 SP1, SQL Server 2008 R2 SP2, SQL Server 2012, SQL Server 2012 SP1, are supported.
    Do I need to pach my MSSQL Server with a specific cumulative update package ?
    Thanks.

    These are the requirements for your SQL:
    SQL Server 2008 and SQL Server 2012 are available in both Standard and Enterprise editions. Operations Manager will function with both editions.
    Operations Manager does not support hosting its databases or SQL Server Reporting Services on a 32-bit edition of SQL Server.
    Using a different version of SQL Server for different Operations Manager features is not supported. The same version should be used for all features.
    SQL Server collation settings for all databases must be one of the following: SQL_Latin1_General_CP1_CI_AS, French_CI_AS, Cyrillic_General_CI_AS, Chinese_PRC_CI_AS, Japanese_CI_AS, Traditional_Spanish_CI_AS, or Latin1_General_CI_AS.  No other collation
    settings are supported.
    The SQL Server Agent service must be started, and the startup type must be set to automatic.
    Side-by-side installation of System Center Operations Manager 2007 R2 reporting and System Center 2012 Service Pack 1 (SP1), Operations Manager reporting on the same server is not supported.
    The db_owner role for the operational database must be a domain account. If you set the SQL Server Authentication to Mixed mode, and then try to add a local SQL Server login on the operational database, the Data Access service will not be able to start.
    For information about how to resolve the issue, see
    System Center Data Access Service Start Up Failure Due to SQL Configuration Change
    If you plan to use the Network Monitoring features of System Center 2012 – Operations Manager, you should move the tempdb database to a separate disk that has multiple spindles. For more information, see
    tempdb Database.
    http://technet.microsoft.com/en-us/library/jj656654.aspx#BKMK_RBF_OperationsDatabase
    Check the SQL server agent service and see whether it is set to automatic AND started. This got me confused at my first SP1 install as well. This is not done by default...
    It's doing common things uncommonly well that brings succes.

  • Powershell for to list SQL Server Windows Groups

    Hi All:
    I m planning to write a script, to pull SQL Server Windows Groups members list by using powershell.
    By using dsa.msc i can view the members of a particular SQL widows groups., the same i want to do using powershell., is there any way to do this. I want to run this from remote machine.
    Please let me know how can we do this and per-requist... Already installed PowerShell 3.0 and loaded the recommended modules on it.
    Thanks,
    Satish Kumar.
    Thanks, Satish Kumar. Please mark as this post as answered if my anser helps you to resolves your issue :)

    Hi,
    I was able to run the command on the other machines with no problem. Have you tried right-clicking, Run As Administrator?
    According http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/29/use-active-directory-cmdlets-with-powershell-to-find-users.aspx
    “This warning message: “WARNING: Error initializing default drive: 'Unable to find a default server with Active Directory Web Services running.'” is generated because I have several domain controllers, and not all of them have
    the
    Active Directory Management Gateway Service installed. Depending on which domain controller authenticated my workstation, the warning appears. The solution is to install the Active Directory Management Gateway Service
    on all of the non-Windows Server 2008 R2 domain controllers. The other solution is to ignore the warning and specify the
    server parameter each time when using one of the cmdlets (but that will mean the PSDrive will be unavailable).”
    In addition, this issue is more related to PowerShell, for quick and accurate answers to your questions, it is recommended that you initial a new thread in our PowerShell forum for dedicated help.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Can't figure out how to install sql server for PHP

    I am trying to install SQL Server for PHP on a server with Server 2008 32 bit.  The exe from http://www.microsoft.com/en-us/download/details.aspx?id=20098 keeps tell me that it is an invalid win32 application.  I've tried running as administrator
    as well.  Somewhere I read you need to open the exe with 7zip.  I was able to do that and see all the files in there, but where do I go from there?
    Thanks
    Mike
    edit: forgot to mention I'm using Apache for my server

    That solution is obsolete. The current solution is here:
    http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx
    bill ross

  • Alternative for Cursor in SQL Server 2012

    Hi all,
      I keen to know Alternative for Cursor in SQL Server 2012. Why everyone telling Cursor have performance impact. Any other alternative for row by row comparison like Array in SQL 2012 ?
    Thanks

    It is not the cursor that kills you - it is the loop as such. I've seen more than one example of a poor man's cursor, where they have selected TOP 1 from a #temp ORDER BY, and several operations on the temp table - which is completely void of indexes,
    making the operations for the loop control the slowest in the batch. So you use cursor when you need to iterate.
    But in many cases, you should work and think set-based instead.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Equivalent datatype in Oracle for datetime of SQL Server

    Hello Everyone,
    I'm very much new to Oracle. I have been working with SQL Server since 3yrs. Currently I'm working with Oracle 11g.
    What is the equivalent datatype in oracle for datetime in sql server with which has the format YYYY-MM-DD HH:MM:SS?
    I tried with timestamp and date which didnt solve my prob.... Please help me in using the equivalent datatype for the format provided above...
    Regards,
    Bhanu Yalamanchi.

    Oracle date format can be anything you want, either by default at the session level or preferably explicitly using to_char and a format mask.
    Format masks are documented here.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements004.htm#CDEHIFJA
    SQL> create table t (d date);
    Table created.
    SQL> insert into t values (sysdate);
    1 row created.
    SQL> select * from t;
    D
    19-JUL-11
    SQL> alter session set nls_date_format = 'YYYY-MM-DD HH:MI:SS';
    Session altered.
    SQL> select * from t;
    D
    2011-07-19 08:27:59
    SQL> select d, to_char(d, 'YYYY-MM-DD'), to_char(d,'Day') from t;
    D                   TO_CHAR(D, TO_CHAR(D
    2011-07-19 08:27:59 2011-07-19 Tuesday
    SQL> alter session set nls_date_format = 'DD-MON-YY';
    Session altered.
    SQL> select d, to_char(d, 'YYYY-MM-DD HH24:MI:SS') from t;
    D         TO_CHAR(D,'YYYY-MM-
    19-JUL-11 2011-07-19 08:27:59

  • Best option for website plus SQL Server?

    Best option for website plus SQL Server?
    OPTION 1: Azure website + SQL VM
    OPTION 2: Azure website + SQL VM within Virtual Network
    OPTION 3: Website VM + SQL VM both within Virtual Network
    Pros/cons of each?  I’m looking there SIMPLEST solution so long as also SECURE.
    Thanks.

    Hi,
    With Azure web sites, you don't have to manage Virtual Machines, network load balancers, or deployment infrastructure yourself. All of these capabilities are built in and provided by the Azure Websites service.
    It depends on you. Personally, the easiest way would be creating an Azure Web site and using a SQL Azure database associated with the site.
    If you want to use a SQL VM as a database server, I recommend you to create it in a virtual network as it is supported for integration between your Azure virtual network and the Azure Websites:
    Azure Websites Virtual Network Integration
    Best regards,
    Susie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Is it possible to have access a table of DB SQL Server for the DB Oracle?

    Is it possible to have access a table of DB SQL Server for the DB Oracle? How?
    Thank you, Paulo.

    You can configure Heterogeneous Distributed Database Systems

  • Is the query analyzer part of SQL Server?

    Hey all,
    I have installed SQL Server 2005 on windows 2003 server. It did not install the query analyzer.
    Is the query analyzer part of SQL Server or do we need to install it separately?
    Thank you,
    Bye.

    Is there something about this question that is related to Oracle? It would appear that you'd want to ask this over in an appropriate Microsoft SQL Server forum...
    Justin

  • Is the query analyzer part of sql server database?

    Hey all,
    I have installed SQL Server 2005 on windows 2003 server. It did not install the query analyzer.
    Is the query analyzer part of SQL Server or do we need to install it separately?
    Thank you,
    Bye.

    Why not ask it in a Microsoft forum ?
    Nicolas.

  • Setting up SQL Server for LiveCycle ES2

    I have few queries regarding the installation please help.
    I am trying to install livecycle ES2 in Windows 7 system,Weblogic 11g,Sql server 2005 Dev Sp3
    1. In the installation guide under the section setting up sql server for Livecycle ES2 the below point mentioned .
    Select the Memory page and enter a size in the Minimum Server Memory (in MB) box that is equal to
    the size of the free memory on the server.
    How to find the free memory on the server ??
    http://help.adobe.com/en_US/livecycle/9.0/prepareinstallsingle.pdf
    2. Is It required to create LiveCycle ES2 database user, schema, and login in Sqlserver 2005 ? this step is not mentioned as optional why its required to create this stuffs ?
    3. While installing the Live Cycle Server when the installer prompts for a database configuration popup which db i should point to is it the db created for Livecycle or it should be the db from which i want fetch the data?
    4. In case if i am connecting to my application db (the place where my app data presents) where do i link the Livecycle db created with the Livecycle Server configuration?

    Hi,
    Do you have solution for this yet?
    I have same issue.
    Thanks
    YogLC

  • Hibernate mapping XML files for the two SQL Server tables below.

    Hello all..,
    Question 1:
    I am working on a project that needs to support a database with an inherited legacy schema that you cannot change. The schema is provided below.Hibernate mapping XML files for the two SQL Server tables below. Please provide those two XML files. Assume some hypothetical package and class names. Assume that no "fancy" stuff such as lazy initialization, optimistic locking etc is needed at this time.
    CREATE TABLE [SURVEY_ANSWERS] (
    [ANSWER_ID] [int] IDENTITY (1,1) NOT NULL,
    [QUESTION_ID] [int] NOT NULL,
    [POSITION] [int] NULL,
    [TEXT] [varchar](350) NULL
    CREATE TABLE [dbo].[SURVEY_QUESTIONS] (
          [QUESTION_ID] [int] IDENTITY (1, 1) NOT NULL ,
          [TEXT] [varchar] (350) NULL
    GO
    ALTER TABLE SURVEY_ANSWERS
    ADD CONSTRAINT pk_SURVEY_ANSWERS PRIMARY KEY(ANSWER_ID,QUESTION_ID);
    ALTER TABLE [dbo].[SURVEY_QUESTIONS] ADD
           PRIMARY KEY  CLUSTERED
                [QUESTION_ID]
    GO
    ALTER TABLE [dbo].[SURVEY_ANSWERS] ADD
           FOREIGN KEY
                [QUESTION_ID]
          ) REFERENCES [dbo].[SURVEY_QUESTIONS] (
                [QUESTION_ID]
          )Question 2:
    Assume that you are working on a project developing, say, a banking application. You are the Architect and thinking that Hibernate ORM should be used for the entire access to the relational database. As usual, you have created (or auto-generated) a set of HBM XML files as well as POJOs for which you define the mappings. Assume now that a new requirement has just popped up. The system needs to be able to import new bank accounts and user information in bulk from a very large XML file at once and store it in the database. Assume the XML file contains all necessary information to populate fields in database tables. As performance is very important for this operation. Given this description, how would you approach the problem?
    Please describe briefly.
    -Thanks and regards
    Praveen Soni

    You're not fooling anyone Dennis_Mox. But nice try.Jeez, man. Mail me at denismox[at]yandex.ru, I will show you that exact test, dammit.

  • Best size for VM SQL Server for a start or maybe Azure SQL Database?

    Hello Everyone,
    My question is quite general but some of You may have already considered similar issues. Let's say or assume I have the website and mobile application - social kind - used by:
    1. 10 K users
    2. 100 K users
    3. 1 K K users
    4. 20 K K users MAX
    I am strongly considering use of VM SQL Server mostly because of its PARTITIONING functionality, some advantages in the context of INDEXING compared to Azure SQL Database and JOBs availibility.
    Question: what would be the best size and count of VMs related to SQL Server for the start and later?
    Question 2 - I am able to move JOBs functionality to my Worker role if I wanted to consider use of Azure SQL Database. SQL Server still has at least those 2 advantages (Partitioning, better Indexing) - is it worth considering Azure SQL Database service for
    100 K users and more?
    Regards,

    Hello Jambor,
    Considering the number of users i wouldnt recommend an Azure SQL database, because of certain limitations like Max worker threads, Max sessions, etc. Also the maximum size of the database can be 500GB.
    Please refer http://msdn.microsoft.com/en-us/library/azure/dn741336.aspx and http://msdn.microsoft.com/en-us/library/azure/dn369873.aspx for the Azure SQL database options and limitations.
    If your application needs to scale-out, Azure SQL Databases are recommended. If it needs scaling-up - then the choice is SQL Server on Azure VM. Please refer http://azure.microsoft.com/blog/2012/06/26/data-series-sql-server-in-windows-azure-virtual-machine-vs-sql-database/
    and http://azure.microsoft.com/en-us/documentation/articles/data-management-azure-sql-database-and-sql-server-iaas/ for comparison.
    If you already have your application running successfully on your on-premise server, you could use a similar machine on Azure for hosting your SQL server instance. The options are at http://azure.microsoft.com/en-us/pricing/details/virtual-machines/. You could
    start with a SQL Server enterprise edition on an A3 VM and then scale-up as needed.
    Regards,
    Kumar Bijayanta

Maybe you are looking for

  • My iPhone 4 is no longer recognized by my car.

    My iPhone 4 is no longer recognized by my car stereo since upgrading to iOS 5. Is there a fix for this?

  • Problem in formatting ,scan disk i need to set cd rom as first boot device

    hi, For formatting ,scan disk i need to set cd rom as first boot device But whenever i do it from manager and restart the machine It takes long to get back the console of the machine. By the time machine boot's up, its from hard disk. How would i avo

  • Sorting Albums in alphabetic order on iPad

    I set up a set of Albums in iPhotos on my iMac. Later I added a new album and it went to the bottom of the list of albums on the left side of screen. I physically dragged that last album up among the other albums to put it in alpha order. All well an

  • Why is my macbook air making such a loud noise?

    I have a Macbook Air 13". I have just switched it on and the fans are making are considerably louder than usual. The laptop isn't hot at all, in fact from what I can feel it's blowing out quite cool air. Any ideas on why it is doing this and how to s

  • Form hangs when try to open excel

    Hi everybody, When I try to upload some data from excel it work's ok when i'm doing it on xp, but when i'm on windows server 2003 won't upload. Form hangs on code noted below. On both OS are Excel 2003. args := OLE2.create_arglist; OLE2.ADD_ARG(args,