So to the above table I have added a new field/column named "ProdLongDescr(varchar, Null)"
So, I need to populate this newly added column with specific values for each row depending on "ProductCode" which is different forevery row. The problem is that I have 25 rows.So instead of Writing 25 individual update scripts, is there a way in which single query will do the same job instead of writing one update query for each row ?. If so can some one guide me how to achieve that OR point to me a good resource.
Below are a couple of Individual update scripts I Wrote. "ProductCode" is different for all 25 rows.
Update tblValAdPackageElement SET ProdLongDescr = 'Slideshows' WHERE ProductCode = 'SLID' And szElementDescr='Slideshow' if @@error <> 0 begin goto ErrPos end
Update tblValAdPackageElement SET ProdLongDescr = 'CategorySlideshows' WHERE ProductCode = 'SLDC' And szElementDescr='CategorySlideshow' if @@error <> 0 begin goto ErrPos end
So to the above table I have added a new field/column named "ProdLongDescr(varchar, Null)"
So, I need to populate this newly added column with specific values for each row depending on "ProductCode" which is different forevery row. The problem is that I have 25 rows.So instead of Writing 25 individual update scripts, is there a way in which single query will do the same job instead of writing one update query for each row ?. If so can some one guide me how to achieve that OR point to me a good resource.
Below are a couple of Individual update scripts I Wrote. "ProductCode" is different for all 25 rows.
Update tblValAdPackageElement SET ProdLongDescr = 'Slideshows' WHERE ProductCode = 'SLID' And szElementDescr='Slideshow' if @@error <> 0 begin goto ErrPos end
Update tblValAdPackageElement SET ProdLongDescr = 'CategorySlideshows' WHERE ProductCode = 'SLDC' And szElementDescr='CategorySlideshow' if @@error <> 0 begin goto ErrPos end
Im creatting an SSIS project that uses an Data Flow OLE DB Source to read data from an SQL Table and import it into a Destination table using Data Flow OLE DB Destination. but now everytime I run the project it appends all the rows not the new data rows only. How can I make the application so that it appends only the new data from a source table to a destination table. Is there maybe another Data Flow Control that can copy source table to destination and the next time it runs it only copy new rows. or any other way to do this using SSIS.
in this computer sqlserver express edition is installed, i want to remove this express becoz in configuration manager it show two SQLSERVER'S are running. when i browse from COMPUTER - 2 for network servers it show server name as HASH/SQLEXPRESS, but not the main SQLSERVER.
COMPUTER -2
IP::::129.100.100.142
COMPUTER NAME::: FEROZ
MEMBER OF WORKGROUP
can anyone help me how to connect these two computers and remove this express edition
I'm trying to append rows horizontally - I'm using the "xml path" approach
SELECT E.[USER_NAME] As 'User Name', ( SELECT ',' + C.[PERMISSION_NAME] FOR XML PATH('') ) As [Associated Groups] FROM TABLEA As A JOIN TABLEB AS B ON A.PK_OBJ_ID = B.FK_APP_OBJECT_REF JOIN TABLEC AS C ON C.PK_PERMISSION_ID = B.FK_PERMISSION_REF JOIN TABLED AS D ON D.FK_PERMISSION_REF = C.PK_PERMISSION_ID JOIN TABLEE AS E ON E.PK_PERSONNEL_ID = D.FK_PERSONNEL_REF WHERE A.[OBJECT_NAME] = 'MyObjectName'
It's not working. I'm getting:
User nameAssociated Groups A. SmithG1 A. SmithG2 A. SmithG3 etc...
What I'm looking for is:
User NameAssociated Groups A. SmithG1, G2, G3 etc...
I have created a DTS package which transfers data from a SQL 2000server table to a text file. Each time the package is executed thedata in the text file is replace with the new data from the currentexecution of the package. Can DTS append new text to a text file andnot replace it each time the package executes. Is there an option orseeting for this? I havent seen one. Can anyone help me out on this.Thank you,Brett
I have a client that requres me to add a header line and trailer line to a flat file. The trick is the header and footer row is required to have a length of 120 with 5 colunmns while the data included in the query has a length of 1125 and about 70 columns. How can I append a header row to a file through SSIS.
I want to loop through rows and append values to a declared variable. The example below returns nothing from Print @output, it's as if my @output variable is being reset on every iteration.
declare @i int,@output varchar(max) set @i = 1 while @i < 10 begin set @output = @output + convert(varchar(max),@i) + ',' print @output set @i = @i +1 end
I'm a newbie DBA and i'm trying to create a package that would extract data from MySQL and inserts them to a SQL 2005 Server. I'm quite new to this SSIS and would like to ask help from you to help me go through with this.
Hi i tried designing a SSIS package which loads only those rows which were different from existing rows in the table , i need to timestamp the existing row with an inactive date when a update of that row is inserted (ex: same studentID ) and the newly inserted row with a insert time stamp so as to indicate the new row as currently active, in short i need to maintain history and current rows in same table , i tried using slowly changing dimension but could not figure out, anyone experience or knowledge regarding the Data loads please respond.
example of Data would be like
exisiting data
StudentID Name AGE Sex ADDRESS INSERTTIME UPDATETIME 12 DDS 14 M XYZ ST 2/4/06 NULL 14 hgS 17 M ABC ST 3/4/07 NULL
New row to insert would be
12 DDS 15 M DFG ST 4/5/07
the data should reflect
StudentID Name AGE Sex ADDRESS INSERTTIME UPDATETIME 12 DDS 14 M XYZ ST 2/4/06 4/5/07
12 DDS 15 M DFG ST 4/5/07 NULL
14 hgS 17 M ABC ST 3/4/07 NULL
Please provide your input as much as you can even though it might not be a 100% solution.
I have to run a DTS package to export data into a dBase file. I first have to delete the existing data within the dbase file, but I can only get it to delete the data, not the actual rows. The file continues to grow in size. Is there a way to delete the rows from the dbase file through the DTS package?
I have a DTS package that needs to refresh data in 3 separate Excelspreadsheets on a daily basis. The problem is that unless I manuallydelete the previous day's data, it appends rather than replaces.I can't delete the excel files on a daily basis, as they have to bethere for the DTS package to be able to export to Excel. What I wantto do is create a VBScript (ActiveX Control) to delete all the rows ofdata except the first row within each spreadsheet as the first step ofthe DTS package. Then the remaining steps would run and thespreadsheets would only have the current day's data at the end of theprocess.Thanks for any help offered.
Yet another question again on the issues with SSIS. I have a package now which is working fine.
The package consists of a control flow and i have 2 DF tasks which are unionall first and then saved into a sql server destination.
It's fine up to this point but i've just been notified that i would need to generate 2 files based on different values after i combined the data from 2 sql server DF tasks.
My question is how can i know the rows which are being saved on this sql server destination.
I have a primary key which is an autoincrement column.
I'm working with integration services 2008 and I have a package where I selected a certain set of rows from an Oracle database and then I insert this data set into a SQL database. When the package is inserting in SQL database, it shows that all the rows were inserted, "green", but when I check the amount of data (I count), it's not the same as it was in Oracle.
For example: there are 15390 rows in Oracle and the packages inserts sometimes 9801, 8310, 9952, 9934, 9975, 5437, 9909 rows in SQL server.The package does not abort! It simply does not insert all the rows!
I have implemented a caching strategy using the sqlcachedependency and sql server 2005 backend using the broker service.This works fine and well when i am connecting to the SQL Server 2005 under service account that is in the role db_owner. In a production enivironment i am reluctant to do this so i created another service account that only has execute permissions on the stored procedures.When i use this limited service account for my ASP.net web application, the broker service does not send any messages to the web app to invalid the cache. When checking the event log and SQL profiler i get errors all relating to the user not having access to the SqlQueryNotificationService queue. So i did a lot of googling and tried running the grant scripts below with no luck using this limited service account. Keep in mind everything works fine if i use an account with db_owner priviledges. These are the grants i have tried based on numerious articles GRANT CREATE PROCEDURE TO three_d_ss_loginGRANT CREATE QUEUE TO three_d_ss_loginGRANT CREATE SERVICE TO three_d_ss_loginGRANT SUBSCRIBE QUERY NOTIFICATIONS TO three_d_ss_loginGRANT RECEIVE ON QueryNotificationErrorsQueue TO three_d_ss_loginGRANT REFERENCES ON CONTRACT::[http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification] TO three_d_ss_login These are the grants i have tried that does not work GRANT SEND ON SERVICE::SqlQueryNotificationService TO three_d_ss_loginGRANT RECEIVE on SqlQueryNotificationService_DefaultQueue to three_d_ss_loginCan some one suggest what i need to do to get sqlcacheddependencies to work with a sql2005 backend under a limited priviledged service account? ThanksJim
I have the following XML in an XML column in a SQL 2005 Database.<DeliveryList xmlns="http://schemas.adventure-works.com/DeliverySchedule"><Delivery SalesOrderID="43659"><CustomerName>Steve Schmidt</CustomerName><Address>6126 North Sixth Street, Rockhampton</Address></Delivery><Delivery SalesOrderID="43660"><CustomerName>Tony Lopez</CustomerName><Address>6445 Cashew Street, Rockhampton</Address></Delivery></DeliveryList>I need to query that column using the value method to retreive the addressof the first delivery. I come up with this,SELECTDeliveryList.value('data((/DeliveryList/Delivery/Address)[1])','nvarchar(100)')DeliveryAddressFROM Sales.DeliverySchedulebut it tells meXQuery [Sales.DeliverySchedule.DeliveryList.value()]: There is no elementnamed 'DeliveryList'I have tried every permutation of the path and I can not seem to get it towork? Any ideas?
I'm using custom authorization in reporting services 2000 to restrict the users. To do this we created a dll customauthorization.dll and placed it in reportserver bin folder and performed changes in rsreportserver.config, rssrvpolicy.config, and web.config files. Now its time to upgrade our servers to SQLServer 2005. Now in SQLServer2005 what new enhancements were done with respect to security and what all extra steps should i follow to perform the upgradation with custom authorization. Please give me suggestions how to upgrade my reports to SQL2005 so that my custom authorization still works.
Hello,I installed sqlserver2005_express on my PC (localhost) and I try to execute a sql query with ASP.NET.Here's my page :Dim mySqlConnection as SqlConnection = new SqlConnection("server=JOE10155SQLEXPRESS;Trusted_Connection=yes;UID=sa;PWD=xxxx;database=xxxx") Dim mySqlDataAdapter as SqlDataAdapter = new SqlDataAdapter("SELECT * FROM Entreprise WHERE (EntrepriseNr =999)", mySqlConnection) Dim myDataSet as DataSet = new DataSet() mySqlDataAdapter.Fill(myDataSet,"Entreprise")The problem is :System.Data.SqlClient.SqlException: Autorisation SELECT refusée sur l'objet 'Entreprise', base de données 'xxxx', schéma dbo'.if someone have an idea?
hello, What are the requirements to install sqlserver2005 in my pc.I am using windows xp sp2 in my pc. One of my friend said, windows server2003 is compulsory(to get data base functionality in sqlserver 2005 and other features) in local pc .Is it correct? And i am not getting database features in xp sp2. Can any one help me?
hello everyone i have created a table in sqlserver2005 named "Departments" - in this table different departments of a telephone ( landline ) company are to be stored,which deals with complaints registered to them by there users. i want to know the name of these different departments which deals with complaints assigned to them like if i do have complaint from a user who has problem with his handset then that complaint will be assigned to "Maintance dept." as i was never in indusrty , i need the help in filling the table. just do write me name of departments and the nature of complaints wh they deal with!!! thanks for the consideration
I had installed the sample database " AdventureWorks ",but i couldn't find it in SQL Server Management Studio,and I noticed than it was installed into "Microsoft SQL Server 2005 Samples" directory,but not "Microsoft SQL Server" directory,what can I do to find the datebase. I am a beginner,and learning sqlserver by using tutorials,someone help me? many many thanks.
I have 0 experience with SQLMail, and I don't want to go too deep into it as I already am trying to learn more than I can with the other parts :) I'm wondering, is there an easy way to have SQL Email me when anything strange happens with the SQL server? It would be awesome to get alerts to my phone.
(New to SQL Server Installs)I installed SQL Server 2005 Developer Edition on a WinXP-SP2workstation and can see some enterprise databases on the network justfine.My problem is I cannot register a local database on the local drive fortesting/education purposes.(I accepted all of the defaults on the install and thought all waswell.)There are a couple of small databases that are in development in ourgroup and I need to work on when offline from the network.Short of uninstalling the whole product and doing it over, what stepscan I take to remedy this so I will be able to work with DB's locally?Thanks.
hi all, what is the best way to remove SQLSERVER2005 from my computer running XP-sp2 when i try to remove from tha ADD and Remove program from the control panel it's start the wizard but going to stuck..
There is no prompt ' UPGRADE' when I install SqlServer2005 Also check select @@version after installed Still be 'Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug 6 2000 00:57:48 Copyright (c) 1988-2000 Microsoft Corporation Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2) ' Why does this happened? OS is Windows2003 Server Thanks
Hi, Can any1 tell me how to connect to Sqlserver2000 from sqlserver2005 ...I cant see sqlserver2000 instance name when i try to search in database engine
I've a problem with a created view in sqlserver2000 that I'm now using in sqlserver2005.
This is the view :
CREATE VIEW hsarti01_VD1 AS SELECT TOP 100 PERCENT * FROM hsarti01 WITH(index(hsarti01_PK)) ORDER BY 1,2 desc,3,4
When I do the "select * from hsarti01_VD1" in sql server 2000, I see in the result that the order by is been using. but in sql server 2005 it's just using the order of the primary key and not the order by !
Hello All,I am trying to create a DTS package.I have two tables tbl_A and tbl_B with similar data/rows but noprimary keys.tbl_A is master.I would like this package to query tbl_A and tbl_B and find1)all rows in tbl_A that are different in tbl_B, 2)all rows in tbl_Athat are not present in tbl_B and3)all rows in tbl_B that are not present in tbl_A, and then just showthose rows.Can this be done with a simple UNION?Perhaps this could produce a temp Table that can be dropped once theDTS package exists successfully.The 2nd part after all the above rows are retrieved is that I wouldlike to add an addional Column to the retrieved data called STATUSwhich has 3 possible values(letters) at the end of each row...M (modified) means that row exists in tbl_B but has 1 or moredifferent columnsA (add) means this row exists in tbl_A but not in tbl_BD (delete) means this row exists in tbl_B but not in tbl_AI'm hopping this DTS package would output a nice comma seperated TXTfile with only...1) rows from tbl_A that are different in tbl_B (STATUS M)2) rows from tbl_A that are not present in tbl_B (STATUS A)3) rows from tbl_B that are not present in tbl_A (STATUS D)Can a DTS package in MS SQL be used to perfom all of the above tasks?I would very much appreciate any help or any advise.Thanks in advance :-)