Sunday, July 14, 2013

[SQL Server 2008 issues] Filegroup

[SQL Server 2008 issues] Filegroup


Filegroup

Posted: 10 Jul 2013 08:39 PM PDT

Hi All,Please let me know whether it is possible to use the same secondary filegroup for 2 different databases.I tried manually and it did not allow.Just wanted to confirm the same.

Find The Similar Matching String

Posted: 13 Jul 2013 04:35 PM PDT

Dear,I have a customer table containing many duplicate names and custid is the unique key. But the customer names are not 100% similar. For example, [code="plain"]CustID CustName------- -------------100 ABC CO101 ABC CO.102 ABC CO&103 ABC CO,NY[/code]Here all the custname refers to similar customer. Now I wanna delete the duplicate names. I need to search custnames which are 80% similar and delete those customers.Please help me to do this.Regards,Akbar

How to take backup of Single table and how to restore?

Posted: 13 Jul 2013 03:44 PM PDT

Hi... How to take backup of Single table and how to restore? is there any query like database backup?shivakumar...

what is database refresh?

Posted: 13 Jul 2013 03:45 PM PDT

hi...How to Refresh database in sqlserver 2008? database refresh or rebuild both r same or not?

IN and NOT IN for sql xml column

Posted: 13 Jul 2013 12:18 AM PDT

I have a table with a xml column.Xml is similar to [code="xml"]<Root> <Row> <user>abc</user> <Rowid>1</Rowid> </Row> <Row> <user>vf</user> <Rowid>2</Rowid> </Row> <Row> <user>ert</user> <Rowid>3</Rowid> </Row> <Maxrowid>3</Maxrowid></Root>[/code]Now below query return sl_no column and myxmlcolumn of rows containing xml column having values 'abc' or 'xyz' in node 'user'(<user>).Below query i am using similar to IN option of sql. [code]SELECT [mytable].[Sl_no],[mytable].[myxmlcolumn] FROM [mydb].dbo.[mytable] WHERE ( [myxmlcolumn].exist('for $x in /Root/Row where ( ($x/user[fn:upper-case(.)=(''ABC'',''XYZ'')]) ) return $x')>0 ) [/code]I want similar kind of query which does same work as sql 'NOT IN' does. That is in my case i want rows not having values 'abc' or 'xyz' in node 'user'(<user>) in xml column.So please help me on this.

Will the mirroring will be able to work properly if restricted growth or change the setting of max size of database

Posted: 13 Jul 2013 09:19 AM PDT

I have a mirror database.they are set to unrestricted growth. As per company policy the database should be in restricted growth.should I change it to restricted growth or change the setting of max size , but then I am in confusion will the mirroring will be able to work properly.

Alter colum on table with many constraint HHEELLPP!!

Posted: 13 Jul 2013 05:05 AM PDT

Thanks you very much for your time as its greatly appreciated. The situation seems to be simple as it should be but for some reason this situation is throwing me some massive headaches…I have a table and that table has a column definition needs to be altered from numeric to int..this table also has 41 constraints on it as I ran to show me all the constraints. The server is set so I should be able to make the changes as I went into the object explorer ->tools->options->designer->table and databse design and uncheck the proper box. SELECT * FROM sys.objectsWHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%bl%'Then taking all the constraints that came back..next I ran:IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[DF__bl__count_em__0275918A]') AND parent_object_id = OBJECT_ID(N'[dbo].[bl]'))ALTER TABLE [dbo].[bl] DROP CONSTRAINT [DF__bl__count_em__0275918A] GORan this on all constraints and then tried to run:ALTER TABLE [dbo].[bl]--NOCHECK CONSTRAINT allALTER column [count_em] int not null;Yet this still return the error :Msg 5074, Level 16, State 1, Line 1The object 'DF__bl__count_em__0275918A' is dependent on column 'count_em'.Msg 4922, Level 16, State 9, Line 1ALTER TABLE ALTER COLUMN count_em failed because one or more objects access this column.Any help or ideas are greatly appreciated. THANK YOU

How do I run query from Query Designer ?

Posted: 12 Jul 2013 11:54 PM PDT

when I right click on [b]Query Designer[/b] , I find [b]Execute SQL[/b] menu is disabled .How do I run query from Query Designer editor then ?I am using MS SQL Server Management Studio 2008

help with query

Posted: 13 Jul 2013 06:39 AM PDT

hi,I have a table:version item price1 a 1.002 a 1.203 a 1.301 b 2.002 b 2.20I need to create a query that will select the latest version price for each itemthe outcome should be like that:version item price3 a 1.302 b 2.20please help :-)regards,aviv

Data center migration

Posted: 10 Jul 2013 07:35 AM PDT

I hope this forum is "general" enough for this question. I figure most people here have experienced this issue in one way or another.We are migrating our data center and we are concerned about our SQL servers with relative data.Our goal is to move the server as smooth as possible to the new location, which is only about 200 yards around the corner, but there are bumps, door entries, rough sidewalks, etc.Does anybody on here have some best practices regarding server transportation he or she would be willing to share?Thanks in advance.

Difference between Full backup and Copy-only full backup

Posted: 07 Jul 2013 06:13 PM PDT

I saw in this [url=http://www.sqlservercentral.com/Forums/Topic567010-357-1.aspx#bm1311005]link[/url] that full backup does not truncate the log.So what is the difference between full backup and copy-only full backup?For the log backup there is copy-only backup which prevent the log chain from breaking without truncating the log. So what is copy-only full backup?

No comments:

Post a Comment

Search This Blog