Stuck on new fault with my update Posted: 06 Mar 2013 10:57 AM PST Hi Professionals I am running the following query as advised previously which updates the source table based on a column from the reference table matching...BEGIN TRANSACTION Inner1;GOUPDATE dbsource SET software_name_raw = dbref.software_name_amended FROM dbo.BigTable dbsourceINNER JOIN ( SELECT software_name_raw,software_name_amended FROM RefTable GROUP BY software_name_raw,software_name_amended) dbref ON dbref.software_name_raw = dbsource.software_name_rawgoCOMMIT TRANSACTION Inner1;I have run into a problem which is. If they dont match I need to update the reference tables 2 columns with the new unmatched record to reference something like thisELSE INSERT INTO RefTable(software_name_raw,software_name_amended)Values BigTable(software_name_raw,'Needs Updating')How can or can this be amended easily. |
Command(s) completed successfully. only output set parseonly NOT checked Posted: 06 Mar 2013 04:18 AM PST Hello,I have been trying to solve this for hours. I know it's very likely something really basic but...When I run a built in stored procedure, for example sp_helppublication, in SSMS, I just see this:Command(s) completed successfully.No output. I have checked so many settings. I think I have looked everywhere in the settings for SSMS but maybe not. I definitely don't have the set parseonly checked. Could someone please help? Thanks in advance. |
The SSIS package keeps forgetting the password Posted: 06 Mar 2013 03:57 AM PST I have a SSIS Package that is giving me an error connection'Test connection failed because of an error in initializing provider. Login failed for user.....The package does not remember password.Im connecting to a SQL Server 2005 box using its user_password with sysadmin role.The SSIS package runs fine when you first set up the connection in bidsThe bottom line is that SSIS keeps forgetting the password I feed intothe two Connections that I'm using. I double-click a connection,type the password in, check "Save my password" and hit "OK" but thepassword disappears from there whenever I run the package ordouble-click the connection again.Is anyone know what to do!! please help!! I have a very short time to deploy this package in production. |
combine multiple rows into one dynamically query question Posted: 02 Sep 2009 05:20 AM PDT Hi, I have the below table, and I need to combine theminto one records dynamically (I'm not sure I'm clear on this,so maybe you look at the below table is better).create table Test( id int, name varchar(30), counts int)insert into Testselect 1, 'Math', 5unionselect 1, 'Literature', 3unionselect 1, 'Cooking', 1unionselect 1, 'Reading', 2I would like the result to look like this below, id categorycounts1 Cooking (1), Literature (3), Math(5), Reading(2) the challenge I have is the id can have multiple values like this, how do I know to combine them all dynamically and correctly. thanks a lot if you could help and give any input. |
Splitting a string into fields Posted: 06 Mar 2013 12:46 AM PST Hi AllI have a field called Defects which contain strings like the following. The string makeup is always the same.Scrap : Part Assembly : Surface Defects : ScratchScrap : Part Assembly : Components : Wrong ComponentsScrap : Part Assembly : Other : Change OverRepair : Punching : Surface Damages : CrackWhat I would like to do is create a view that splits the string by the : and have them displayed as individual fields.I started of using CharIndex to find the : and then use left and the charindex to strip the first part out, but I felt doing it this way would involve a lot of LEFTs and RIGHTs to split up the whole string, is there an easier way to accomplish this?CheersDJ |
The absolute basics of coding SQL Server in VB.net Posted: 05 Mar 2013 07:56 PM PST I am trying my best to get my head around SQL Server but seem to be going around in circles. Everything I google is either way too complicated for my simple means or else I find half a dozen different ways to do the same thing.Can somebody please point me to a site, an article or a video where, in clear, plain, simple English, it explains the differences and the relationships between a datatable, a dataset, a dataadapter, a datastream & various other options I keep getting presented with ?!?The sooner I can grasp the concepts and the differences, the sooner I can spend my time actually coding rather than asking questions ;-) !!! |
Invalid precision value Posted: 05 Mar 2013 07:42 PM PST Hi,I am new to MS SQL and the project need arose to bind an OUTPUT blob. Towards that I created a stored procedure which returns a nvarchar(max) type. I do not know what will be the length of this blob as this is constructed by the stored procedure.The SQL Server that I am running this on is 2005.I am binding in my C++ application using SQLBindParameter. This is how I am doing it. retcode = SQLBindParameter(hStmtHandle, output_blobs_[i].cur_pos, SQL_PARAM_OUTPUT, SQL_WCHAR, SQL_WLONGVARCHAR, 0, 0, (SQLPOINTER)output_blobs_[i].cur_blob, 0, (SQLINTEGER*)&size );This is how my stored procedure looks likecreate proc ujo_delete_box @del_dep_list nvarchar(max) OUT, @job_name varchar(64), @joid int, @rstr_del_job int, @rstr_del_depjob int, @ref_integrity int, @stamp int, @del_box int, @user varchar(80)No matter what I do I don't seem to get past the bind stage. With the way SQLBindParamter is depicted, I always end up with the below error when I try to bind the nvarchar(max) field. Error from SQLBindParameter() Failed for stored procedure. SQLSTATE: HY104, Native error: 0, Message: [Microsoft][ODBC SQL Server Driver]Invalid precision valuePlease let me know what am I doing wrong.Regards,Rajesh |
Patching OS for SQL Boxes Advice Posted: 05 Mar 2013 08:21 PM PST Hi all, Anyone have any advice for patching windows on SQL boxes. We have dev environments for about 50% of our live servers. So will patch dev confirm its ok then live (They should be the Same OS, SQL version) I was just planning on doing all high priority updates and leaving software, where its windows search or IE etc. The thing im really not sure on about is .NET, IF SQL needs 3.5 to install should i ignore .NET 4? or upgrade to it? There always seems to be a lot lo .NET patches. so im interested to know what poeple normally do about them. Regards |