Showing posts with label Sql. Show all posts
Showing posts with label Sql. Show all posts

Saturday, October 22, 2016

To find how many tables,procedure etc are there in the SqlServer

To check how many tables are there in the DataBase:-

select * from sys.objects where sys.objects.type = 'u'

Here is a list of other object types you can search for as well:
AF: Aggregate function (CLR)
C: CHECK constraint
D: Default or DEFAULT constraint
F: FOREIGN KEY constraint
L: Log
FN: Scalar function
FS: Assembly (CLR) scalar-function
FT: Assembly (CLR) table-valued function
IF: In-lined table-function
IT: Internal table
P: Stored procedure
PC: Assembly (CLR) stored-procedure
PK: PRIMARY KEY constraint (type is K)
RF: Replication filter stored procedure
S: System table
SN: Synonym
SQ: Service queue
TA: Assembly (CLR) DML trigger
TF: Table function
TR: SQL DML Trigger
TT: Table type
U: User table
UQ: UNIQUE constraint (type is K)
V: View
X: Extended stored procedure

Friday, September 16, 2016

To insert data into the table using linq c#

           using (bmEntities dbcontext = new bmEntities())
   {
                taskdetail td = new taskdetail();

                td.tdate = Convert.ToDateTime(txtdate.Text);

                td.name = txtexp.Text;

                td.amount = Convert.ToDecimal(txtamt.Text);

                td.uid = 1;

                dbcontext.taskdetails.Add(td);

                dbcontext.SaveChanges();

    }

Git Commands

Git Version   To check the git version Git -v       Git Clone To clone the repository, use the following command: Git clone [u...