Saturday, March 23, 2013

[SQL Server 2008 issues] Check Data While Inserting

[SQL Server 2008 issues] Check Data While Inserting


Check Data While Inserting

Posted: 19 Mar 2013 06:24 PM PDT

Dear All,I have a UI like,LineNo ProdID Discount(%) and a "Insert" Button-------- ------ --------I can insert a single or multiple lines in this UI.While inserting the following data, it will check whether there is any data in Discount Column greater than 18. If so, it will not insert any data and raise an error message.[code="plain"]LineNo ProdID Discount(%)------ ------ -------1 1000 02 1001 23 1002 194 1003 0[/code]I coded but it always checks LineNo1. Please help me to code whether I can check data that is greater than 18 in Discount Column against all the LineNo .Regards,Akbar

Best approach to have mssql 2008 mirror certain fields to MySQL on Web

Posted: 22 Mar 2013 08:33 AM PDT

We have a mssql onsite server.We want to create a Website probably using LAMP and designed with Joomla.We want to link or mirror certain fields from our onsite DB to the DB on the Web, so that clients can go to the web and see their status, tracking,etc.Should I create a new table in MsSQL called web, then mirror that to the Web host? I would like some suggestions, as to what may be the best approach.

Database Restore Causes Database User To Become Inoperable

Posted: 22 Mar 2013 06:23 AM PDT

Frequently, we will send out or receive a backup from our clients. We all have the same login and database user. When we restore the DB, we have to drop the database user and re-create him each time since our ASP.NET application user is not able to log into the database. He is able to log into the server, but not our database. As our client base increases this small little annoyance could really become a problem.Any ideas on how to be able to restore or backup the database in a way that enables the database user to stay valid and operable would be greatly appreciated.Thanks,Jim

How to set query editor tab to display "Executing" in SSMS ?

Posted: 22 Mar 2013 07:46 AM PDT

In my SSMS, tabs headers don't display when query is currently executing. It is especially difficult when I have multiple tabs open. How to set it up to display it ? My version is 2008 R2 x64 EE. I tried Tools/Options but nothing I could find for this.Thanks .

Should I backup more than the database(s) on a server?

Posted: 22 Mar 2013 06:10 AM PDT

I'm a rookie when it comes to backing up a server. I've been able to successfully backup and restore database(s) on SQL Server 2008. But I'm wondering if I should be backing up more than just the database(s). What I mean by this is what if something happens to the server or someone screws up a SSIS package (.dtsx) or screws up a SQL Agent job or I need to recover yesterdays version of some T-SQL code? How would I be able to restore these to an older version?Should I be backing these items to another location off the server or am I over thinking things?I read where some of you forum posters say "I'll be putting that in my toolbox". Where do you put that and how do you take your toolbox from one job to the next? If yes, is there a script or proc I could use as a guide?Thanks.

concatenate rows using for xml path and new line feed carriage

Posted: 21 Mar 2013 10:31 PM PDT

Good day Guysi have this code--------Create TABLE #tempCityState (State Varchar(5), City Varchar(50))Insert Into #tempCityStateSelect 'CO', 'Denver' UnionSelect 'CO', 'Teluride' UnionSelect 'CO', 'Vail' UnionSelect 'CO', 'Aspen' UnionSelect 'CA', 'Los Anggeles' UnionSelect 'CA', 'Hanford' UnionSelect 'CA', 'Fremont' UnionSelect 'AK', 'Wynne' UnionSelect 'AK', 'Nashville'Select Distinct State, (Select Stuff((Select ',' + City From #tempCityState Where State = t.State FOR Xml Path('')),1,1,'')) AS CitiesFrom #tempCityState t-- or tentatively--Select Distinct State, (Select Substring((Select ',' + City-- From #tempCityState-- Where State = t.State-- FOR Xml Path('')),2,200000)) AS Cities--From #tempCityState tDrop table #tempCityState-----------it gives this results:State City------------------AK Nashville,WynneCA Fremont,Hanford,Los AnggelesCO Aspen,Denver,Teluride,Vailbut i want output like this (3 rows exactly with new line feed carriage after each item)http://www.flickr.com/photos/14261289@N02/8580154328/Thanks in adv. for your replies

XML Data Type as a parameter in a Stored Procedure

Posted: 20 Mar 2013 07:06 AM PDT

Hi,I've table as follows,[code="sql"]CREATE TABLE [dbo].[majikanAG_subMajikan_1]( [idx] [int] IDENTITY(-2147483648,1) NOT NULL, [batch_Id] [uniqueidentifier] NOT NULL, [icNo (Baru)] [varchar](100) NULL, [icNo (Lama)] [varchar](100) NULL, [payerNme] [varchar](300) NULL, [zakatAmount] [decimal](10, 2) NULL, [subMajikan] [varchar](100) NULL, CONSTRAINT [PK__majikanA__51EFEBF8002AF460] PRIMARY KEY CLUSTERED ( [idx] ASC, [batch_Id] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY][/code]My Stored Procedure as follows,[code="sql"]CREATE PROCEDURE [dbo].[addAGSummary_SubMajikan_Process1]@agItem xml,@batch_Id uniqueidentifier outputASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON;set transaction isolation level repeatable readBegin transactionBegin Tryselect @batch_Id=NEWID()insert into majikanAG_subMajikan_1(batch_Id, [icNo (Baru)], [icNo (Lama)],payerNme, zakatAmount, subMajikan)select @batch_Id,a.b.value('icNo[1]','varchar(200)') as icNo, --as input1,a.b.value('icNoOld[1]','varchar(15)') as icNoOld, --as input2,upper(a.b.value('payerNme[1]','varchar(100)')) as payerNme, --as input3,--a.b.value('amt[1]','decimal(10,2)') as amt, --as input4,a.b.value('amt[1]','varchar(100)') as amt, --as input4,a.b.value('subCd[1]','varchar(100)') as subCd --as input5,from@agItem.nodes('/data/ag') a(b)COMMIT transactionEnd TryBegin Catch-- Whoops, there was an error--IF @@TRANCOUNT > 0ROLLBACK transaction-- Raise an error with the details of the exceptionDECLARE @ErrMsg nvarchar(4000), @ErrSeverity intSELECT @ErrMsg = ERROR_MESSAGE(),@ErrSeverity = ERROR_SEVERITY()RAISERROR(@ErrMsg, @ErrSeverity, 1)End Catch END[/code]There are 2 scenario1- If @agItem did not have so much data (1000 records), the stored procedure run well2- If @agItem have a so much data (10000 records), the stored procedure cannot process as expectedWhy no (2) is happening? Did XML Data Type is not suitable for 10000 records?Please help. I'm stuck

help with Store procedure

Posted: 22 Mar 2013 03:45 AM PDT

hi guys,can anyone help me1.i need to Write a SP to accept comma separated values and return as list of string values2. i need to Write a SP to find occurences of a character in a string3. i need to Write a SP to find number of words in a sentence

Column reference

Posted: 21 Mar 2013 08:48 PM PDT

Hi,I have a table Gv_voucher which has data like(VoucherId, VoucherNo, TranactionID)1, VVB0001, TRN0012,VVB0002, TRN0013,VVB003,TRN0024,VVB0004, TRN002I have created another table GV_ReceivedOffice in which I required these column VoucherNo and TransactionIDI have created a unique constraint on column VoucherNO in GV_Vocuher table so that I can use it in my another table Gv_received.But how to use column TransactionID of Gv_Voucher table in GV_ReceivedOffice. Is it so that without creating constraint we cant reference a column to another table's column?Please suggest.

Comparing all columns in table

Posted: 22 Mar 2013 02:46 AM PDT

HelloNeed help to solve one problem that I somehow caused... I have a table that has nearly 100 columns, and i have a "copy" of this table with 2 extra columns, to maintain a kind of history. This History table it's filled with the help of a trigger in the main table, that adds a copy of the original row before the change, plus the kind of change made (delete,update), and the date of the change.Now i'm trying to get the history for one particular ID, the PK for the main table. How can I, create a temp table, with every row of the History table, but in each line only show differences from the previous line. For example:I have a table with columns from A to Z, and the original values for the rows were a to z.The first row in the History table, has all the values, but the column A changed from a to 10.The second row, the column T changed to 99...The result that i'm trying to get is something like:Row1 only the 10 in the A column, and the other columns set to nullRow2 only the 99 in the T column, and the other columns set to null...

Checklist after Migrating Databases from 2005 to 2008 R2

Posted: 20 Mar 2013 03:48 AM PDT

I am migrating SQL databases from 2005 to 2008 R2 Enterprise edition. There are only 5 databases but they all are 500 GB or more. I would like to know what checks to make on the dbs after they are moved to the new server. Great hardware on the new server. We have a very small maintenance window and most of the time will be going towards moving databases, testing jobs etc. I am considering running following things in this order, but worried about the time it takes on such a large databases and performance impact. DBCC UPDATEUSAGEDBCC CHECKDBREBUILD/REORGANIZE INDEXESUPDATE STATISTICS (for Indexes that were ReOrganized)RECOMPILE All the procs.Can anyone please provide expert comments if we really need all these or not? Thanks in advance...

Curious: performance difference when using function in a where clause.

Posted: 21 Mar 2013 11:12 PM PDT

Hello all,This is just something I noticed and am [b]wondering[/b] about (I think this is an unexpected effect), there is [b]no problem[/b] to solve.I get a performance difference when I use a function in a where clause. See the code, the performance numbers are below the code.Sorry I was not able to isolate the problem and give definitions and data to reproduce this.Please read the code.[code="sql"]------------------------------------------------------------------------------------select * from client_order where -- ABS(ClientNr) = 12345 [b]ClientNr = 12345[/b] and startdttm = '2012-03-16'----(1 row(s) affected)----Table 'Encounter'. [b]Scan count 30, logical reads 62, physical reads 61[/b], read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.---- SQL Server Execution Times:---- CPU time = 0 ms, elapsed time = 765 ms.-- Estimated execution plan: Estimated Subtree Cost : [b]0.106408[/b]-- Actuel execution plan: Estimated Subtree Cost : [b]0.106408[/b]------------------------------------------------------------------------------------------------------------------------------select * from client_order where [b]ABS(ClientNr) = 12345[/b] -- ClientNr = 12345 and startdttm = '2012-03-16'----(1 row(s) affected)----Table 'client_order'. [b]Scan count 1, logical reads 4, physical reads 4[/b], read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.---- SQL Server Execution Times:---- CPU time = 0 ms, elapsed time = 49 ms.-- Estimated execution plan: Estimated Subtree Cost :[b] 0.0183334[/b]-- Actuel execution plan: Estimated Subtree Cost : [b]0.0183334[/b]------------------------------------------------------------------------------------[/code]Thanks for your time and attention,ben brugman

create sql str with special condition

Posted: 22 Mar 2013 04:05 AM PDT

create sql str with special conditionhellowI have 2 tableTable a(code, price, check)Table b(code, percent)I want to create a sql string such below:Select a.code, a.price, (price * percent) as new_fieldFrom a,b Where a.code = b.codeAnd this condition must be consider in sql str:If (check = 1){ New_field = price * percent}Else{ New_field = price * percent * 8}Now how can put above condition in sql str?Thanks very much

Count dots '.'

Posted: 22 Mar 2013 02:52 AM PDT

Hi geniuses,How do I Count the number of '.' (dots) from a column value:[code="sql"]EconSearchD.01.01.01D.01.01.02D.01.01.03D.01.01.03.00[/code]And if there's 3 '.' -> Level 1 if there's 4 '.' -> Level 2 if there's 4 '.' -> Level 3 to Level 5Thanxs people! Regards

Omnibackup.exe backup got failed while trying through this setup.

Posted: 22 Mar 2013 03:36 AM PDT

In SQL Server,to talk a backup for various databases from various server we are using omnibackup setup to execute SQL database backup not through SQL AGENT JOBS.This is script we are using,OmniBackup.exe -b D:\GenetecBackups -s (local)\OMI -d VideoSQL -MAX_BACKUPS 12(any error on this script pl let me know)We are getting error while executing this setup, BACKUP DATABASE failed with an application error.Error number on LOG : Error: 17836, Severity: 20, State: 17We are getting the above error when trying to back up the Security SQL databases (all servers).I have read this and not sure what size we would make this, any recommendations would be great.Kindly revert me with an good solution.Waiting for a valuable replies.Thanks in Advance friends.

Integration Director access

Posted: 22 Mar 2013 01:05 AM PDT

I am DBA at medium sized company. We recently hired a new Director for project integration. The director requested Sysadmin privilages to all sql servers in the domain. I just do not want get into argument by saying NO to this request so wondering how you folks manage these kind of situations.In most cases director might need is read access I know it might be different from company to company but I just want to hear from experts how to handle these situations.Thanks in advance,Sarwan.

Moving Windows (A/D) Domains

Posted: 22 Mar 2013 03:09 AM PDT

I have SQL Servers that must be moved from one windows domain to another. Moving the servers hasn't been an issue yet, most of gone smoothly. Now we need to move the user accounts.Basically I need to either rename the domain account or copy it to the new domain account.So the old domain user would be OldDomain\user1 needs to be NEWDomain\user1 with all the same database access.I would have thought there would be a simple way to do this but it looks like I need to script out the access and recreate the account. Anyone have any scripts or advice on how to do this. I need to move 20+ servers and hundreds of accounts.....Thanks!

IDENTITY value becoming too big

Posted: 21 Mar 2013 10:59 PM PDT

I have a table that gets a fresh set of data from our source each day. This mean I DELETE almost all the records each day and repopulate it with new data.I do not TRUNCATE the table because according to business rules all the records can't be deleted, so my script is:DELETE FROM Table1WHERE .....This deletes almost all the records each day.Being a DELETE, this means the primary key column, which is an IDENTITY, does not get reseeded but rather this values just keeps getting bigger and bigger.I am running into a scenario where the INT data type on this IDENTITY column is going to become too small.My ID column is on 1,500,254,112 and the maximum for an INT is 2,147,483,647. Now before I just go and change the data type to a bigint, I was hoping someone could give me a better solution to keep the ID value in check?Any suggestions?

Backup task failing

Posted: 22 Mar 2013 01:30 AM PDT

Hi,I have a backup task that isnt working, it used to but a couple of days ago stopped. I created a new version of the task and it has also reported a failure. All of the bak files have been created by the task and I can recover from them. I therefore have no idea why it is reporting a failure.Please see the notes below, not much to go on I know, they are usually more helpful than this:Date 22/03/2013 12:57:06Log Job History (Non-ODM Backups.Backup Databases)Step ID 1Server SQLJob Name Non-ODM Backups.Backup DatabasesStep Name Backup DatabasesDuration 00:37:42Sql Severity 0Sql Message ID 0Operator Emailed Operator Net sent Operator Paged Retries Attempted 0MessageExecuted as user: NEFTEXOIL\SQLAgent. :30:02.41 Code: 0xC002F210 Source: Back Up Database Task Execute SQL Task Description: Executing the query "BACKUP DATABASE [Team] TO DISK = N'K:\SQL_Backups..." failed with the following error: "A nonrecoverable I/O error occurred on file "K:\SQL_Backups\Team_Backups\Team_backup_2013_03_22_125713_7338597.bak:" 112(failed to retrieve text for this error. Reason: 15100). BACKUP DATABASE is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. End Error Progress: 2013-03-22 13:34:34.23 Source: Back Up Database Task Executing query "BACKUP DATABASE [Team_Archive] TO DISK = N'K:\SQL...".: 50% complete End Progress Progress: 2013-03-22 13:34:46.19 Source: Back Up Database Task Executing query "declare @backupSetId as int select @backupSetId =...".: 100% complete End Progress Error: 2013-03-22 13:34:46.71 Code: 0xC002F210 Source: Back Up Database Task Execute SQL Task Description: Executing the query "BACKUP DATABASE [webmap] TO DISK = N'K:\SQL_Backu..." failed with the following error: "A nonrecoverable I/O error occurred on file "K:\SQL_Backups\Team_Backups\webmap_backup_2013_03_22_125713_7418605.bak:" 112(failed to retrieve text for this error. Reason: 15105). BACKUP DATABASE is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 12:57:07 Finished: 13:34:47 Elapsed: 2260.64 seconds. The package execution failed. The step failed.Many Thanks for your help,Oliver

2008 SP2 Recompile

Posted: 22 Mar 2013 02:51 AM PDT

Just read this from Gail Shaw ....http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/'No, you'll still get the non-optimal plan. In 2005 the optimiser is required to create plans that are safe for reuse, even if they won't be reused (because of recompile). Only in 2008 SP2 onwards does the recompile work properly – plans optimal for that particular parameter set.Gail said this on March 24th, 2011 at 23:08'How does it not work properly in SQL 2008 SP1?

Tme dimension Best Way

Posted: 22 Mar 2013 02:59 AM PDT

I currently have two tables, one with information in it and one with time and timeID. They are linked using timeID as a foreign key in the info table. How would I go about making a Time Dimension for this set up?

Remove "SQL Server 2005 (64-bit)" after in-place upgrade to 2008 R2?

Posted: 04 Mar 2013 03:53 AM PST

Hi all,When upgrading SQL, we normally either detach/reattach or backup/restore. However, we have just been handed a server that had an "in-place" (?) upgrade performed from SQL 2005 to 2008 R2. This seems to have left SQL 2005 on the Programs List. In other words, if I go to Add/Remove programs, I see all the usual entries for 2008 (such as "[b]Microsoft SQL Server 2008 (64-bit)[/b]" and "[b]Microsoft SQL Server 2008 Native Client[/b]" and "[b]Microsoft SQL Server 2008 Browser[/b]", etc...).However, there are also two entries for 2005:[b]Microsoft SQL Server 2005 (64-bit)Microsoft SQL Server 2005 Backward compatibility[/b]Note that, in the services list, I [b][i]only [/i][/b]see services for the expected 2008 R2 instance and the users have had no problems connecting to and using the upgraded SQL DBs.So, [b][u]is it safe to remove the two SQL 2005 items listed in the add/remove programs list[/u][/b]? I ask because the files are apparently throwing up red flags when we run our patch/hotfix scans.Thanks!

Search entire database (including procedures, views, etc.) for a string

Posted: 22 Mar 2013 01:28 AM PDT

I've read several articles I found online suggesting various ways to do this, but I thought I would check here. Basically, I need to find every instance of 'COMM" in one of our databases. Any help is appreciated!EDIT: I'm running 2008 R2 in case that helps.

Controlling Replication from Sybase via SQL Server

Posted: 19 Mar 2013 12:19 AM PDT

Hi all,Without me having to look too deep into this, can somebody give me a quick Yes/No on the possibility of a SQL 2008 R2 box controlling the replication of data FROM a Sybase ASE 15 database server (on linux)?SQL 2008 R2 Supports -Publishing data from Oracle to SQL Server.Publishing data from SQL Server to non-SQL Server Subscribers.So therefore a big NO? Or an undocumented possibility?CheersShark

SQL C# CLR TVF issues

Posted: 22 Mar 2013 12:21 AM PDT

This problem is really starting to annoy me now!I created a SQL C# CLR TVF which accepts around 30 parameters. The function was running like a charm, processing around 250000 records in 9 seconds which is amazing considering the amount of string manipulation performed by the CLR function.But for some weird reason and without changing the code of the function or the data set, it started taking 80-90 seconds to run the same code on the sama data set. I even restarted the SQL instance to see if it would go back to the initial speed but to no avail.The query looks like this:[code="sql"]SELECT top 10000 g.ID, g.GUID, g.mkTitle, g.mkNameKey, g.mkAddressKey, g.mkName1, g.mkName2, g.mkName3, g.mkNormalisedName, g.mkOrganisationKey, g.mkNormalizedOrganization, g.mkOrgName1, g.mkOrgName2, g.mkorgName3, g.mkPostIn, g.mkPostOut, g.mkPhoneticStreet, g.mkPremise, g.mkPhoneticTown, g.mkEmailAddress, g.mkTelephoneNumber, g.mkMobileNumber, 1 FROM dbo.Load1XX CROSS APPLY[dbo].[GenerateKeys](ID, GUID, ISNULL('COLNOTPROV', ''), ISNULL(FullContactName, ''), ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL(Address1, ''), ISNULL(Address2, ''), ISNULL('COLNOTPROV', ''),ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL(Town, ''), ISNULL(County, ''), ISNULL(Postcode, ''), ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL(Country, ''), ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL(Email, ''), ISNULL(HomeTelephone, ''), ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL('COLNOTPROV', ''), ISNULL(CustomerURN, ''), ISNULL('COLNOTPROV', '')) as g[/code]The actual execution plan looks like this, so it appears the nested loops is taking the longest time. Is there any way round this?![img]http://s1.postimg.org/awhfrhmkf/friday1.jpg[/img][img]http://s13.postimg.org/zb54ox5mv/friday2.jpg[/img]

Row to Column (Pivot)

Posted: 21 Mar 2013 09:28 PM PDT

[code="sql"]SELECT S.UniversityNo ,S.Name ,U.SSubjectCode ,U.IsPassFROM SStudentUnivPerformamce U INNER JOIN SStudent S oN U.SStudentID = S.StudentID INNER JOIN SSubject SU ON U.SSubjectID = SU.SSubjectIDWHERE U.SBatchID = 4 GROUP BY S.UniversityNo ,S.Name ,U.SSubjectID ,U.SSubjectCode ,SU.Descriptions ,U.IsPassORDER BY S.UniversityNo,U.SSubjectID[/code] I want the Output Like This-------------------------------------------------------------------------UniversityNo Name Sub1 Sub2 Sub3 ......-------------------------------------------------------------------------123 Raja P F P ....124 Kumar P F P ....125 Ravi P F P ....126 Raji P F P ....

Creating reference

Posted: 21 Mar 2013 07:50 PM PDT

HI,I am creating a table GV_ReceivedOffice with this strucutre:But VoucherNo column in this table will reference to one more table GV_Voucher which has column VoucherNo. VoucherNo in GV_Voucher doesnt have any constaint on it.so If i try do in this way to reference VoucherNo in ReceivedOfficetable CONSTRAINT FK_GV_ReceivedOffice_VoucherNo Foreign KEY (VoucherNO) REFERENCES GV_Voucher(VoucherNo)it is not correct. How to do this?Create table GV_ReceivedOffice(ReceivedOfficeID int primary key identity(1,1),VoucherNo varchar(15),TransactionID varchar(10),UserID int,ReceivedDate datetime)

SSRS 2008 Running Value Function

Posted: 14 Jul 2010 11:10 AM PDT

Hi,I am trying to calculate running total by order using SSRS 2008. When i pass following code to SSRS reports getting errror.I am using simple program to calculate running total (RTTL fieldname)by order.Calculated fieldname is RTTL= RunningValue(Field!Orderamt.value,Sum,Nothing) getting errro.When i am using Dataset = RunningValue(Field!Orderamt.value,"Dataset1") getting the same errorWhen i am using groupname getting the same error.Can somebody provide the details how to resolve this issue in SSRS 2008.ThanksA S

Is there ready function for a column to break up into two ?

Posted: 21 Mar 2013 08:31 PM PDT

Hi , I have a table.Table name of LG_XXX_. I have a "Definition_" string column in Table.Locate the first space character, this column space.The left side of the "name" as the right side of the "LastName" column.For Example ;Now position :/*(Field Name)*/_____ Definition_ ___________________ ==========(Value)_____________ ERSOY AYDINNext position :(Field Name1) ___ (Field Name2)NAME___________ LASTNAME=========_____ ========ERSOY__________ AYDINIs there ready function for a column to break up into two ?Best regards

Order by CASE

Posted: 21 Mar 2013 08:54 PM PDT

Hi geniuses, need some help here.[code="sql"]Select r.Title, r.impact,r.probabilityFROM DB_Tabs_Risk rOrder by r.impact desc[/code][code="sql"]Title impact probabilityRiskA 10 0,1RiskB 10 0,5RiskC 9 0,8RiskD 5 0,5RisckE 5 0,3[/code]I need to order this based on something likeWhen r.impact >= 7 AND r.probability >= .7 (on top)When r.impact <= 3 AND r.probability <= .3 (bottomElse (middle)How do I T-SQL'it?Thanks in advnce.

Masking a password in a stored procedure input

Posted: 21 Mar 2013 08:41 PM PDT

Hi Folks,I'm making a stored procedure that receive many parameters. One of them is a user password.When I execute the stored procedure using the Management Studio, I write the password in a text box field.Is it possible to mask this input?Any comment should be appreciated.Kind Regards.

No comments:

Post a Comment

Search This Blog